Database preference?

Mysql or Postgresql? Or some other database.

What do you prefer and does it really matter down the road? Anybody have disaster stories where you choose one and it turned out another would have been better? Do you use different dbs depending on the job or do you stick with the same one always?

Peter Song wrote in post #1014023:

Mysql or Postgresql? Or some other database.

What do you prefer and does it really matter down the road? Anybody have disaster stories where you choose one and it turned out another would have been better? Do you use different dbs depending on the job or do you stick with the same one always?

I'm afraid that asking this question here on this forum (or any similar forum) is probably going to leave you more confused than you are right now.

As for me I typically use MySQL in production and SQLLite in development. I do this for a couple of reasons, but primarily it helps to keep my code database agnostic. Also, using SQLLite in development makes things really easy and convenient.

As I said, I typically use MySQL in production, but that doesn't mean I think MySQL is the best database. PostgreSQL is probably the better database. However, I know MySQL better since I've been using it longer, and I find the setup and configuration of MySQL to be easier for me.

I'm also not a concerned about my choice since MySQL is serving the needs of my application. Paraphrasing from something I read somewhere, "If you haven't yet deployed, then you don't have a scaling problem."

In other words choose the database that you feel most comfortable with and use it. Chances are it will work out just fine. If it doesn't, and you've written clean database agnostic code, then you can switch to something else once you've proven, with metrics, that your choice isn't doing the job.

A couple of points to note.

* The Django community recommend PostgreSQL. * Heroku, the Rails deployment people, use PostgreSQL exclusively behind the scenes.

PostgreSQL usage has been growing steadily for many years and has more open source contributors and mailing list posts than MySQL. PostgreSQL consistently differentiates itself from MySQL by advanced features and ease of use, as well as very low bug rates. MySQL was definitely the more popular database 7-10 years ago but I'm not sure how to measure that any more. PostgreSQL is 25 times faster than it was 7 years ago and the latest version looks to improve on that by significant margins. PostgreSQL's feature set exceeds that of Oracle in some areas, not just MySQL. PostgreSQL 9.1 should be available within about 2 months and includes fully synchronous log based replication. PostgreSQL works well from <100MB to beyond 1TB databases.

I need to declare myself here as a PostgreSQL developer, though that means I can provide additional details if required on any questions.

Thank you both for the replies. I've had issues with PostgreSQL and it seems like the main advantage of Mysql is ease of use. So I was wondering if Mysql would make life easier. Anyway, the advice about being database agnostic is good... always good to be flexible when you can.

I'll stick with PostgreSQL for now (as my issues are probably just from lack of experience). It does seem like a lot of the interesting stuff is being done on it. Oh, and looking forward to the 9.1 release.