Avatar of meredian
Backend Developer at Beamery
Shared insights
on
MongoDBMongoDBPostgreSQLPostgreSQL

In my opinion PostgreSQL is totally over MongoDB - not only works with structured data & SQL & strict types, but also has excellent support for unstructured data as separate data type (you can store arbitrary JSONs - and they may be also queryable, depending on one of format's you may choose). Both writes & reads are much faster, then in Mongo. So you can get best on Document NoSQL & SQL in single database..

Formal downside of PostgreSQL is clustering scalability. There's not simple way to build distributed a cluster. However, two points:

1) You will need much more time before you need to actually scale due to PG's efficiency. And if you follow database-per-service pattern, maybe you won't need ever, cause dealing few billion records on single machine is an option for PG.

2) When you need to - you do it in a way you need, including as a part of app's logic (e.g. sharding by key, or PG-based clustering solution with strict model), scalability will be very transparent, much more obvious than Mongo's "cluster just works (but then fails)" replication.

READ LESS
5 upvotes2 comments9K views
Mauro Bennici
Mauro Bennici
May 5th 2019 at 1:53pm

Did you have a look at CitusDB extension for PostgreSQL?

Reply
Anton Sidelnikov
Anton Sidelnikov
May 7th 2019 at 4:09am

Mauro, never had a change to try it.

Reply
Avatar of Anton Sidelnikov

Anton Sidelnikov

Backend Developer at Beamery