Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Please see this response

I'm creating a website that has the potential to become extremely reliant on its data, and would need to be, eventually, serving up lots of data fast. When I read the above answer, I feel that perhaps MySQL isn't the best DB for me to be using.

The problem is that I don't really know much about databases in general. I'm this atypical "Web 2.0" programmer who thinks MySQL is great because, well, it's all I've ever used.

I have some questions:

  • What should I know about databases so that I may make a more informed decision in the future? What resources would you recommend?

  • Can I still use a PHP Framework, such as CakePHP, while choosing "alternative" databases? Is this a recipe for disaster?

share|improve this question

closed as off-topic by gnat, Bart van Ingen Schenau, MichaelT, GlenH7, Kilian Foth Sep 12 '14 at 10:18

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – gnat, Bart van Ingen Schenau, MichaelT, GlenH7, Kilian Foth
If this question can be reworded to fit the rules in the help center, please edit the question.

I think that response on SO is pretty terrible, actually. MySQL used to need this, Postgres used to need that...who cares? As of 5.0 MySQL cleaned up its most grievous errors and filled the last gaps that are really likely to be important. Server crash with "complicated group by"? This is just FUD. I'm not a MySQL fanboy, I've used Postgres just as much and SQL Server and Oracle more, but that reply is still pretty revolting. –  Jeremy Dec 2 '10 at 22:28
I wouldn't worry too much about it. If the poster of that answer is even right, then it's at the extremes - I've used MySQL for a number of years in production and I've never encountered any performance issues resulting from it. Either way: once you get to the point where your site/service is that big, a DBA is worth the money - learn enough to do a good job, but focus on what you're good at. –  Steve Evers Dec 2 '10 at 22:39
awesome. thanks guys. –  joslinm Dec 3 '10 at 0:17

3 Answers 3

up vote 3 down vote accepted

Probably any decent book on database design would be helpful. This book has good reviews. Learn plenty about designing tables with relationships and normalizing your data. You would be surprised how many times I see people store "flags" in one column as a big long string of "Y"'s and spaces and then parse out the flags when the retrieve their data. Don't do that.

I wouldn't rule out MySQL as suitable for your website. MySQL is the database of some big websites. Facebook runs on PHP/MySQL, and I'd say they have a fair amount of rows and updates to handle.

I would focus on delivering good content. If your site becomes so popular that MySQL can't handle it, you'll be able to afford hiring someone to scale your database layer. Of course, the better your design starts the longer it will last.

Usually PHP frameworks abstract the database layer to some extent. For example, CodeIgniter has DB "drivers" for MySQL, Postgres, SQLite, etc. So, theoretically, switching your RDBMS shouldn't be a huge hassle.

share|improve this answer
thumbs up for "focus on delivering good content" (and everything else). thanks! –  joslinm Dec 3 '10 at 0:19

Just go with what you are familiar with.

You can keep the ability to switch RDBMS's later if you take care to avoid vendor-specific features (or when avoidance is prohibitively expensive, then properly encapsulate). Using an ORM goes a long way to help one avoid and encapsulate vendor-specific differences, too.

Worrying about the performance abilities of your RDBMS at this stage is premature optimization or YAGNI. The axiom is something like your problem isn't scalability, it's getting people to even hit your site. I forget who said it where.

share|improve this answer
Worrying about performance in a databse MUST be done at design time, they are not easy to refacotr when you have 10,000,000 records. –  HLGEM Dec 2 '10 at 21:55
I'm not talking about database design, I'm talking about selection of a RDBMS. The OP's question seems to be pondering if they should use MySQL or something else like Microsoft SQL Server or Oracle or PostgreSQL. –  qes Dec 3 '10 at 5:34

I have taken 2 different DB theroy class, in undergraduate and graduate(10 years apart though). But it did not work out for me that much.

I mainly use Oracle, so I purchased some of recommended books from on-line and read several chapters for developers. It helps me a lot!!

I would recommend to find a book saying

  1. Explaination of various type of JOIN with example
  2. Basic Index theory
  3. Any kinds of Stored Procedure(Not sure if MySQL has it)
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.