Game Development Community

MYSQL

by Hallsofvallhalla · in Torque 3D Professional · 03/15/2010 (3:27 pm) · 16 replies

Hello everyone, After using every engine under the sun including building a MMORPG with the Kit and TGE, I have finally decided go with T3D and man I am really impressed with it so far.

Anyways can someone point me to any information regarding connecting to MYSQL databases through Torque. Docs, tuts, ect..

Thanks!

About the author

Been in game design for about 4 years now. Some of my titles are Forsaken sanctum 3d mmo and a web browser mmorpg. Urban Realms - WB mmo. Planetary Wars - WB mmo. Quests Of Crocania WB mmo. also teach tutorials on Web Development.


#1
03/15/2010 (3:57 pm)
I posted a similar question not that long ago

http://www.torquepowered.com/community/forums/viewthread/112067

Good luck.
#2
03/15/2010 (7:28 pm)
There are a few resources for connecting to MySql - here is one that is reported to work with T3D:

http://www.torquepowered.com/community/resources/view/13528

However, If you're looking for a free (free as in cost) database, PostgreSQL is very fast and very free, and the SQL is more standard:

http://www.torquepowered.com/community/resources/view/14975

I've been moving some of our work applications over to it (save a ton of money on licensing), and it's very robust. I recommend it.
#3
03/15/2010 (8:28 pm)
MySQL is free unless you go with their paid/supported version. There are restrictions of course on distribution because of GPL though. PostgreSQL is MIT License which is pretty much like BSD so you do have a lot more freedom in what you can do with it plus it is still community driven instead of owned by Oracle :-).

--Josh
#4
03/15/2010 (8:54 pm)
Yeah, MySQL is free if you are developing an open source application. If you are not (and you cannot with T3D) then you have to pay a commercial license fee.

www.mysql.com/about/legal/licensing/index.html

In my day job, we had some developers who assumed it was free, and now we are stuck paying "through the nose" while they rewrite their code. I'd hate to see this happen to anyone else, when there is a markedly superior alternative that is really free.


#5
03/16/2010 (3:20 am)
Postgres has the better memory management of the two popular alternatives. Sadly many projects DROP Postgres support as time goes by and go with MySQL. Right now the future of the DB is also uncertain, with it being acquired by Sun who then were acquired by Oracle. We had Sun people visiting at work, and even they had no idea what the immediate future would bring. They knew their hardware, and that was it :P

Save yourself a legal headache and pick the right DB from the beginning :)
#6
03/16/2010 (5:26 am)
@Jaimi,

Commercial fees is only if you are deploying Mysql in your bundle/package.
I'm not sure you have to pay anything if you are using Mysql as a back-end database on the server side. So depanding of the kind of usage, we need to take care of this licence agreement.

@Ronny,
If I remember well oracle announced they will no anymore support/upgrade mysql in 5 years.
So alternative solution may grow up, like postgres.
#7
03/16/2010 (11:28 am)
wow thanks for the replies. I will not be packaging mysql. I will be using it as a backend and from a webhost. It will be used as for a website integration into the game. Kinda like a textbased browser mmorpg with 3d exploring ;)
#8
03/17/2010 (12:51 pm)
If that's the plan, direct connection to the DB is not the solution. Then you use SSL-based access through the web or some other form of security layer.
#9
03/17/2010 (3:15 pm)
This is a little off the original topic, but I'd just like to clarify what elvince said.
Does the commercial fee only apply when distributing mysql to an end user?
In my current (free) project, clients access a T3D dedicated server, which uses mysql to connect to a database. Since I am not distributing the dedicated server, and there is no mysql code on the clients, I was under the impression that this is free? Is this correct?
#10
03/17/2010 (8:40 pm)
Just *using* mysql is not a problem. However, the problem is that the client side portions (odbc, jdbc, etc) for MySQL are GPL also. So if you write an app that connects to MySQL, and distribute that app, and you have used the MySQL connectors to connect to it, then you have to release as GPL also. It doesn't sound like you are in this mode since you are using a non-distributed dedicated server.

But then again, we didn't think we were in that mode either, and now we're paying oracle 30K per month in licensing fees while we retarget a new database.

This is why I recommend to people to use Postgres instead. Besides being completely free, non-gpl, faster, more compliant with SQL standards, and more scalable, it is also *not owned by anybody*. It will never be sold out, because it can't be sold out.

#11
03/20/2010 (8:42 pm)
Wow, i did not know this about MYSQL.
This changes alot for me.
#12
03/21/2010 (2:00 pm)
btw I figured out how to connect to my mysql database and posted my results for those looking It is a hosted database on a webserver.

http://www.torquepowered.com/community/forums/viewthread/112771
#13
04/22/2010 (5:35 pm)
Ok, Here's a thought: have Torque 3D connect to a server script that handles the mysql connection. You can redistribute your torque application while not distributing any mysql code at all. Your server script would be connected with torque and in turn handle the database. Most hosting includes a mysql database as part of the hosting package, you need a host to download your game anyway. This of course, would be for an online game only, like a mini-mmorpg.
#14
04/23/2010 (7:00 am)
@Don - So, you can create a free CGI script for handling MySQL connections from your T3D game and then sell the game that uses a server that requires the script? It all still sounds like semantics to me, though I'm not a lawyer. It still sounds like PostgreSQL is the better option because all of these issues become moot.

Is there such a stigma built up around PostgreSQL? I haven't done the research, but it seems that people are bending over backwards to avoid it. I have read that Postgre isn't quite as performant in certain situations. Does anyone know what DBMS Blizzard or Turbine or Sony uses? Or Funcom for that matter? I don't and I doubt that we'd get an answer if we asked, but it would be interesting to find out.

@Jaimi - Hell, you could have bought MS SQL Server 2k8 Enterprise for $25k. That really stinks. Now that I think about it, the only real good press I've heard about Oracle is from Oracle....
#15
04/23/2010 (10:23 am)
I don't get the Postgres hate, either. It's good, it's open and you're not bound to an expensive license to do certain things with it. From what I've read it also beats MySQL in certain situations, so speedwise the two choices are about the same. If either was many times as fast in average use, there would be a clear choice, but I think the difference is so small that you would want the one that makes it easiest to do what you want to do.

In technical aspects, that would make them exactly equal. There is no difference in how you access them. So that leaves licensing issues. Postgres is guaranteed to not be a headache for your legal department.

Yeah, Oracle are the only people who actually like Oracle nowadays. Migrating away isn't an easy job, so they have their captive audience ;)
#16
04/24/2010 (10:54 pm)
I don't think the representation of MySQL here is accurate .IANAL but ...

The OP wanted to use mysql in a backend . In a production environment he could use the community edition for free ( the community edition is GPL ) .

http://www.mysql.com/downloads/mysql/

He could use any one of many methods to get data in/out of this DB and into his application . However so long as he does not modify , or distribute the DB server, its still free .

We evaluated both Postgre SL server and MySQL server for several ( non torque ) projects and ended up using MySQL each time. One item that keeps landing in the MySQL column in built in ( non 3rd ) party support for replication. Another is actually the paid license option . When your project gets to the point of revenue generation its very important you can get help when a problem arises with a critical part of your infrastructure.

Its only very recently that Postgre and MySQL reached semi parity in terms of ease of use and performance. MySQL has been in the lead for some time . For a time Postgre's lack of ease of use and other problems were infamous and thus the source of much of the " Postgre hate" seen around the web.

Were it me ,I would suggest you make your application DB query mechanism DB engine independent. You may well find that you need a hybrid strategy when loads increase.

All this being said to would really be nice if Torque included a native OBDC connector as part of the product then this entire discussion would be moot.