Page 1 of 1
What db to choose?
Posted: Thu Nov 06, 2003 7:34 am
by Leash
Hi,
I've developed a php-application for online betting and so far I have used MySQL as a database. Now I'm a bit worried that MySQL isn't the most suitable database if we release this website for some countries and get to handle many thousands of members, betting and doing stuff on the website.
I'd like som advice from any of you who has been in this situation before.
Should we start off with MySQL and if traffic grows we move on to Oracle for instance? Or would you recommend us to start with some other database?
Do you guys use any DB-class (ADODB etc) to easily move to other databases or what is your approach?
Thanks!
/A.
Posted: Thu Nov 06, 2003 3:33 pm
by infolock
well, there is a lot of opinions and arguments that can be thrown at that, but i'll give you my 2p's anyways.
#1, mysql is one of the most POWERFUL databases that you can use with php... it's stable, it's fast, and it's small.
#2. your biggest problem isn't gonna be with the database you use, it's gonna be the security in your script. i think it's nascar that uses mysql as their database enviornment, and they have had thousands of simutanious connections hitting their dbs and mysql stood firm.
#3. it's all about how the coder himself is familiar with the database management. if you have someone who is new to mysql, and not very familiar as to how to setup correct user accounts for access to the databases, but he does know how to with Access or any other db, go with the other. you can always study up on mysql in your free time and then convert your databases over to it when you feel comfortable.
there are a lot more experienced programmers out there that may have a difference in opinion, but that's my 2p's at least.
Posted: Thu Nov 06, 2003 10:48 pm
by hedge
I wrote my own database wrapper. It only has about 4 functions so it's pretty easy to adapt to another DB, currently it only supports Oracle and ODBC but it would be very easy to adapt to other db's.
My philosophy is to try and put as much of the business logic as possible into the db and have a very light front end that just does storage and retrieval. I do this by writing pl/sql procs, functions etc. This means that I need a DB that is very feature rich.
I very much like Oracle but PostgreSQL is very impressive and open source.
Posted: Fri Nov 07, 2003 5:04 am
by JAM
I can also add just my personal opinion, because it takes much more info than you gave to discuss it to the fullest.
Just as example, we do not know how intence the scripts work against your database, nor how popular the betting system will be in the end, money available to put into licences etc....
MySQL should be sufficient for very long (or as hedge mention, it's cousin postgre's), and also worth every penny when you buy the licence (imho).
Actually transfering the data from MySQL to Oracle should 'not' be a big issue if that times come. How to do it, I personally cant say, but I would not think it's much harder than dump the data to a file, and insert it in the new database generally speaking...
Check MySQL's pages about benchmarking (
http://www.mysql.com/doc/en/MySQL_Benchmarks.html) and it's links. That might perhaps give you more information to go on.
Posted: Fri Nov 07, 2003 7:09 am
by Leash
Thanks guys for your inputs! They're all very helpfull for my discussion with my business partners.
I didn't write that much info about this project cause I didn't want to get you bored with details and because I'm in the middle of developing the platform for the betting system. So I don't have everything figured out yet.
The idea is simple, get some customers registred and let the use our system for the betting and to handle the payments.
We're aiming for 20.000 registred members within a year. The use of our system will ofcourse have some serious peaks when everyone leaves there bets at the same time. That I have to solve... :O
Are there any good reading about php-projects with this kind of database use? Any good links?
infolock-> About the security of my script, do you have any good reading to recommend about that issue? Thank's for that input!
Thanks again!

Posted: Fri Nov 07, 2003 6:20 pm
by infolock
if you want to know about security, i'd suggest reading some books about e-commerse and how SSL calls work within php. i don't have a broad range of books myself ( currently only 1 that doesn't tell you much about the cryptology mehtods you are gonna have to use ), but i'm sure if you went to joseph beth's you could find one or 3 that suit your interest.
overall, if i was going to choose a DB application that i know works ( ranging from ODBC, Peridox, Sql, Oracle, and MySQL), i would go with MySQL not only for it's function availability that php gives you, but also for the lower cost and easy maintenance.
not to mention, there are so many different mysql administrative applications out there, people are practically begging you to use it.
all in all, you are gonna find that if you don't have this script written already, then ultimately you are gonna be looking at around 6-8 months for development ( for security, design, and coding all together), and that's only YOUR job.
i'm not trying to put your idea down by throwing all the bad things about it at you because you have a very good idea that a lot of people are trying to impliment. it's just it's gonna be a long road of focusing mainly on security. Overall, good luck. I hope to see the URL of your system when you finish. Least i'll be able to say i talked to the dude that built it

Posted: Sat Nov 08, 2003 11:20 pm
by fractalvibes
I would think MySQL sufficient for the task, by all accounts it appears to be a robust database that can handle quite a load. The trick to any such application is writing very efficient SQL and making sure the database is as optimized as possible - i.e. proper indices and so forth.
Postgres seems a little more feature-rich from what I have read, but don't know much about it. If your budget allows, you could look at Oracle, etc. I use DB2 everyday, both NT and OS/390 versions. Caveat - I think with such as Oracle and DB2 - you can get fantastic performance and stability, but such requires having a knowledgable DBA - they are not for average layman
fv
Posted: Thu Nov 13, 2003 3:59 pm
by Leash
OK, thanks again guys!
I think we'll continue with MySQL and see how it goes.
Do you have any ideas of splitting up a database into several?
I've read about this at a forum. The idea is to divide the database in different "modules". Let say, in my case, one database with the member stuff and one database with all transactions (the buyings and bettings).
Whats the pros and cons with this setup?
See ya!
Posted: Thu Nov 13, 2003 6:14 pm
by Weirdan
I'd suggest using load balancer with replication farm for your application, I think it would be much more efficient for your task. Say, two two-way replicated masters with 4 slaves for each.
Posted: Sat Nov 15, 2003 4:22 pm
by Leash
So, does anyone have any tips about load balancer or replication farm?
I've coded a lot of php-applications but never used anything like this.
And ideas? About further reading?
Thanks again! This is fun, and I'll let you know about my progress!