

PostgreSQL vs MySQL (and to lesser extent also compared with MSSQL and Oracle) - babul

I know this is subjective to how/where you use it but am wondering what people who have used PosgreSQL think about it.<p>I see that the newer version match MySQL in speed while retaining better data integrity (and in many cases PGSQL is actually faster in both default install &#38; after optimisations).<p>I want to build some web apps (ideally in Ruby On Rails and some in Django) and want something that scales better and is more robust.<p>Thoughts, comments, experiences and insights appreciated.<p>Basic overview @ http://is.gd/d5l gives some good intial pointers but needs more real world experiences to be added.<p>Thanks.
======
SwellJoe
I will tell you all you need to know in three (run on) sentences:

PostgreSQL is historically a more complete and reliable SQL database, that was
once slower than MySQL but is now slightly faster for most workloads.

Either database will probably work great for anything you will ever need from
them--if you are running into scaling problems for a site that we've never
heard of (I assume we've never heard of it) you're probably doing something
pathological.

Google uses MySQL heavily, so despite its many historical problems, if you
grow big enough to run into them, you will figure out a way to solve them and
in some cases you will cause them to be solved for the general MySQL userbase,
as Google has done.

------
epi0Bauqu
I have lots of experience with Postgres (including scaling somewhat from a web
app perspective) and have nothing really bad to say about it. It scaled well.
The key (at least for me) is to make sure indexes are in memory, which I think
will be the case no matter what DB you use.

~~~
e1ven
Have you used server-clustering with pgsql? Slony doesn't do multi-master, and
requires manual failover; I understand the technical reasons for this (The
slave may not be up to date, so data will be lost, etc), but we're looking for
other options.

pg_cluster and it's ilk seem under tested, but I'd be VERY interested in your
experiences, if any.

Clustering under mysql has always been fairly trivial, so it'd be nice to find
a decent solution.

~~~
epi0Bauqu
I have found that the situations you really need clustering are few and far
between in the world of web apps. We had over 20M users and we're running fine
on one 2U database server. It had 6 disks (RAID 5, with two hot spares) and
16GB of memory. The indexes all fit in memory.

The acquiring company of our business immediately decided they wanted more
hardware for clustering, and set up Slony. I was semi-involved in it, and I
witnessed no problems. On a bigger scale, I understand that skype uses pgsql
and obviously does clustering:
[https://developer.skype.com/SkypeGarage/DbProjects/SkypePost...](https://developer.skype.com/SkypeGarage/DbProjects/SkypePostgresqlWhitepaper)

Also check out [http://highscalability.com/postgresql-high-availability-
webs...](http://highscalability.com/postgresql-high-availability-websites) and
[http://highscalability.com/skype-plans-postgresql-
scale-1-bi...](http://highscalability.com/skype-plans-postgresql-
scale-1-billion-users)

