mySQL for newbies with brucey mod

BlitzMax Forums/BlitzMax Beginners Area/mySQL for newbies with brucey mod

Ghizzo(Posted 2009) [#1]
Hi!


i've to say that i never used mySQL and a database in my applications... now i would like to add database support in my program using the great Brucey mysql mod, and i need to know some little things about mysql and the module:

1- the database will be on my web server (wich support mysql)... can i have a read/write access to the database via internet using blitzmax ONLY? or i need a PHP script on the server for this?

2- my application will run on different computers at the same time... can my application modify the database from different computers?

Thanks for info...as you can see i'm a totally newbie with databases ;)


xlsior(Posted 2009) [#2]
1- Yes, provided that your internet provider allows direct connects into MySQL from the outside world. Some (like godaddy) don't, and you can only interface with the database through management applications also hosted by the ISP.

2- Yes, for the most part, provided that #1 is true. Depending on *what* you are doing, certain operations may lock parts of the database preventing other computers from modifying the same data at the same time... But in principle you can have many simultaneous connections to the same dataset.


Ghizzo(Posted 2009) [#3]
Thanks xlsior for the info!


Foolish(Posted 2009) [#4]
I didn't know any vendor allowed direct access to mySQL.


I am guessing your DB requirements are pretty light. If so, the PHP scripting requirements wouldn't be overwhelming.


xlsior(Posted 2009) [#5]
I know of at least one hosting provider that does, but they suck eggs in every other respect so I won't bother naming them...


Ghizzo(Posted 2009) [#6]
for a intensive database use, what's the best approach?


Foolish(Posted 2009) [#7]
If you are looking at using a hosted service with mySQL, PHP, then this is best suited for intermittent, smaller transctions where latency isn't a huge issue. Score boards and server tracking maybe can work here. Also keep in mind you are sharing resources with other applications/people on a hosted server, so performance can be unpredicatable. If you are hitting the database for game/level initialization or post level completion updates, then you won't be hurt by the latency too much since people are used to waiting. Don't depend on it to keep pace with gaming loops.

Now, this may be out of reach for a hobbyist, but to answer your question...

For the best possible speed and performance for intensive DB use you need your own dedicated appserver. Your server can be programmed in whatever language you like, but .NET/Java/C++ which can be multithreaded is a good place to look. Personally, I have always hated C++ and Java is the cheapest to implement. JDeveloper from Oracle is a free download and a good IDE.

Your Server gets requests from the client and then uses a DB connector like JDBC, ODBC to connect to the database and execute your create, update, or delete transactions. You can then return your results to the client however you wish.

If you keep your database simple, then you'll be able to stay out of trouble. If your data model is complex, find a guy who knows who to program a database. A solid application uses stored procedures on the database to actually handle the transactions for the best possible performance. They will also help with transaction management which is essential to maintain data integrity.