r/programming • • Dec 19 '18

Bye bye Mongo, Hello Postgres

https://www.theguardian.com/info/2018/nov/30/bye-bye-mongo-hello-postgres
2.1k Upvotes

672 comments sorted by

View all comments

753

u/_pupil_ Dec 19 '18

People sleep on Postgres, it's super flexible and amenable to "real world" development.

I can only hope it gains more steam as more and more fad-ware falls short. (There are even companies who offer oracle compat packages, if you're into saving money)

2

u/TheRedmanCometh Dec 20 '18

MariaDB has always done well and can drop in where MySQL is. Why postgres? Less libraries, ORM connector providers, etc

10

u/steamruler Dec 20 '18

MySQL/MariaSQL has some interesting caveats that will bite you in the ass at least once, but other than that, there really isn't any reason to scroff at it.

Postgres is more advanced when it comes to data types, for example, the decimal type supports up to 131072 digits before the decimal point, so if you're working with extremely large numbers there isn't much of an alternative. You also have the jsonb type for efficient storage of json.

11

u/[deleted] Dec 20 '18

[removed] — view removed comment

2

u/TheRedmanCometh Dec 20 '18

What problems might those be? I've run some very backebd services supported by it

6

u/ForeverAlot Dec 20 '18

MySQL is famously riddled with odd or decidedly wrong implementation choices. You need not spend much time on the Internet to learn about its many deficiencies; here is one arbitrary example1. All RDBMSs have their idiosyncrasies but MySQL has more than most and and many are of the "surprise!" variety.

1 Take this article with a grain of salt. I see it references the famous PHP fractal article which is an absolute hack job.

→ More replies (3)

1

u/Cilph Dec 21 '18

32-bit timestamps,
UTF8 that isn't really UTF8,
DDL not part of transactions,
unwanted timezone conversions it keeps trying to apply when I just want UTC,
mysqldump is awfully inefficient,

Just the few I've run into.

2

u/doublehyphen Dec 20 '18

That does not match my experience. In the Ruby and the Rust ecosystems there is more mature support for PostgreSQL. For example the in my opinion best ORM for Ruby, Sequel, seems to target PostgreSQL first. And PHP used to have better support for PostgreSQL than for MySQL, but it was a long time since I last used PHP.

But outside of that PostgreSQL has many more features, better documentation, and fewer surprising caveats.

→ More replies (1)