Skip Navigation

mysql or postgresql? Which is better for an Internet-facing application

Hey, Threadiverse! I'm looking for informed opinions on database choices.

I can stand up an Internet-facing application and have it use either MySQL or PostgreSQL. Which is the better choice, and why do you think so?

Thanks!

48 comments
  • PostgreSQL is just better. It's supports transactions on DDL (things like altering table structure) and enforces unique constraints after transactions complete ... so you can actually do a bunch of important stuff (like update your table structure or swap unique values between rows) safely.

  • Most applications can do just fine with SQLite, but if you need something with a lot more write speed, go with PostgreSQL.

  • Choosing is not so much about whether it's internet facing or not. From the programmer's perspective and an administrator's perspective there are pros and cons to both. As someone looking to self-host, if you want to run a service that works with either, I would make the choice based on what seems the most supported, or which one you feel the most comfortable looking up and performing administrative tasks on. I tend to use postgresql more just because I have more experience with it and can recommend it if that's what you need, but mysql can be just as good or better in many circumstances. Pick whichever one looks easier to you.

  • I have historically gone with PostgreSQL and had no complaints. The licensing issues concerning MySQL also give one pause (Oracle are greedy bastards who will use any excuse to extract money from captive customers, so depending on their properties is to be avoided). Having said that, these days, SQLite is probably sufficient for many workloads and has the advantage of not requiring a database server.

48 comments