MySql

Community Forums/Monkey2 Talk/MySql

Richard Betson(Posted 2015) [#1]
I just wanted to make the case for database access in Monkey2. If you are going to for example have your game use a password and username and tie it to a MySql database to authenticate the account a Monkey2 program would need to access a MySql database. So in my case I have a MyBB message board that uses a MySql data base to store usernames, passwords and lots of other data. This data can be used by a server (say a VPS with a Linux server made in Monky2) to act as the authenticator accessing the database directly.

There are pluses to having access to a MySql databases in addition to authentication you can use the database to verify/record purchases or update scores or record and keep track of stats, so many awesome useful things you can do with MySql access.

Coupled with a nice networking library MySql database access would make a welcome addition for those looking to support a bit larger scale in their enterprise as well as support many specialized uses.


ziggy(Posted 2015) [#2]
You can always use XML and https to communicate to a php service in the mysql linux server. I think this may help separate layers, unless you're wanting to do the server thing in Monkey too, I don't see this as a super priority, but maybe it's just me!


nullterm(Posted 2015) [#3]
Atleast for mobile apps, the prescribed way is to go through a web service that has an XML or JSON based API.


Richard Betson(Posted 2015) [#4]
Well,

In my case the Monley2 server described above would need to handle encryption. database access and more. For example the server (I described above) may depending on the networking library Monkey2 uses provide UDP hole punching by handing off the port used by the contacting client to a game server. While I can use XML and HTTPS coupled with PHP I feel it is at best a circuitous route and unfriendly to hobbyist coders who are not likely to dive into XML and PHP not to mention setting up a proper HTTPS web server.

I feel a more direct path is in order one similar to Brucey's 'database.mod' which provides direct access to a MySql database.


AndroidAndy(Posted 2015) [#5]
Danilo mentioned the POCO Features which among other things appears to have unified database access to not only MySQL but SQLite and ODBC. Not sure Mark would support POCO directly, but it might be a good model for considering how to make MX2 easier to integrate and maintain with this type of C++ library. Quite frankly though all this chatter doesn't add up to much unless Mark gives his input and consideration.


Richard Betson(Posted 2015) [#6]
That POCO block diagram does look sexy. :) Does it support 64bit?

unless Mark gives his input and consideration

I'm sure he's lurking about digesting it all. :)

Edit- I would add that support for database access and in the case of say using POCO even XML are areas that MX2 can excel at for a relative small investment in development time when compared to spending the time developing a 3D engine. Supporting these kinds of features could give MX2 that something that makes it attractive.


AndroidAndy(Posted 2015) [#7]
@Richard Betson - Yes, 32-bit and 64-bit builds are supported according to the documentation.


Richard Betson(Posted 2015) [#8]
It certainly has an impressive feature set, is multithreading and is nicely aimed at internet development. Impressive at first glance and covers most of my features checklist.


Why0Why(Posted 2015) [#9]
I have wanted db support for different things for awhile and it would be great if MX2 supports it. However, if you are primarily doing authentication and other small things that you are looking for, you can use one of the .net languages and just expose a web service for something like that.


Richard Betson(Posted 2015) [#10]
you can use one of the .net languages and just expose a web service for something like that

I feel ya.. But I cant help but point out the potential hobbyist aspects of MX2 which is a 'stated' market. Why not provide an easy path in MX2 to MySql and to other networking/back end components as a clear distinction from other gaming languages. It is I think worth considering as an example including say POCO and Raknet into MX2. How awesome is that. ;) My point is that this is one area where the marriage of a 2D (for now) gaming language to a smooth 'back end / networking' development framework makes sense. It certainly makes sense to a hobbyist or even an accomplished professional coder to prefer such an integrated potential language especially across many targets. That kind of continuity and ease is gold.


Derron(Posted 2015) [#11]
API is way better than a direct mysql communication of your app and the DB server

[EDIT]
See my post here:
http://pastebin.com/LaGE8APb

I wasnt able to post it here - as the content seems to bug the forum (internal server error). When doing this multiple times, the server will be down for about an hour (had this multiple times in the past - for blitzmax.com and monkey-x.com)

bye
Ron


marksibly(Posted 2015) [#12]
> I'm sure he's lurking about digesting it all. :)

I am indeed!

I don't know much about this stuff so I don't have much to say, but I am following links etc.

I do know I tried to use POCO for something a while back but gave up - can't remember why though...


Richard Betson(Posted 2015) [#13]
I do know I tried to use POCO for something a while back but gave up - can't remember why though.

I am looking for perhaps a better fit and something simpler to implement.