Web アプリケーションにおける MySQL と PostgreSQL [closed] 質問する

Web アプリケーションにおける MySQL と PostgreSQL [closed] 質問する

私は Python (Django) を使用して Web アプリケーションを開発していますが、本番環境にデプロイする場合、MySQL と PostgreSQL のどちらがより適しているかを知りたいです。

1つにポッドキャストジョエルは、MySQL に問題があり、データが一貫していないと言いました。

誰かがそのような問題を抱えているかどうか知りたいです。また、パフォーマンスに関しては簡単に調整できるのでしょうか?

ベストアンサー1

将来の読者への注意:以下のテキストは 2008 年 8 月に最後に編集されました。この編集時点では、ほぼ 11 年前になります。ソフトウェアはバージョンごとに急速に変更される可能性があるため、以下のアドバイスに基づいて DBMS を選択する前に、それがまだ正確であるかどうかを調べる必要があります。以下の新しい回答を確認してください。


より良い?

MySQL は、Web ホストによって提供されることがより一般的です。

PostgreSQL ははるかに成熟した製品です。

そこにはこの議論はあなたの「より良い」質問に答えるものです

どうやら、このウェブページ, MySQL is fast when concurrent access levels are low, and when there are many more reads than writes. On the other hand, it exhibits low scalability with increasing loads and write/read ratios. PostgreSQL is relatively slow at low concurrency levels, but scales well with increasing load levels, while providing enough isolation between concurrent accesses to avoid slowdowns at high write/read ratios. It goes on to link to a number of performance comparisons, because these things are very... sensitive to conditions.

So if your decision factor is, "which is faster?" Then the answer is "it depends. If it really matters, test your application against both." And if you really, really care, you get in two DBAs (one who specializes in each database) and get them to tune the crap out of the databases, and then choose. It's astonishing how expensive good DBAs are; and they are worth every cent.

When it matters.

Which it probably doesn't, so just pick whichever database you like the sound of and go with it; better performance can be bought with more RAM and CPU, and more appropriate database design, and clever stored procedure tricks and so on - and all of that is cheaper and easier for random-website-X than agonizing over which to pick, MySQL or PostgreSQL, and specialist tuning from expensive DBAs.


Joel also said in that podcast that comment would come back to bite him because people would be saying that MySQL was a piece of crap - Joel couldn't get a count of rows back. The plural of anecdote is not data. He said:

MySQL is the only database I've ever programmed against in my career that has had data integrity problems, where you do queries and you get nonsense answers back, that are incorrect.

and he also said:

It's just an anecdote. And that's one of the things that frustrates me, actually, about blogging or just the Internet in general. [...] There's just a weird tendency to make anecdotes into truths and I actually as a blogger I'm starting to feel a little bit guilty about this

おすすめ記事