Hacker News new | ask | show | jobs
by threeseed 1119 days ago
MongoDB remains the 5th most popular database: https://db-engines.com/en/ranking

And there are four major reasons still to choose MongoDB over something like PostgreSQL.

a) PostgreSQL has terrible support for horizontal scalability. Nothing is built-in, proven or supported.

b) MongoDB has superior ability to manipulate and query the JSON.

c) MongoDB is significantly faster for document-attribute updates.

d) MongoDB has better tooling for those of us that prefer to manage our schema in the application layer.

3 comments

By the time you need to shard PostgreSQL (billions of records?), you have lots and lots of resources to overcome that difficulty, a la Notion.
If you want to be high-availability then you need sharding or something like it from day 1. There's still no first-class way of running PostgreSQL that doesn't give you at least a noticeable write outage from a single-machine failure.
> If you want to be high-availability then you need sharding or something like it from day 1

Sharding has nothing to do with high-availability.

You horizontally scale for high availability as well as scalability.

And primary-secondary failover in my experience is rarely without issues.

There is a reason almost every new database aims to be distributed from the beginning.

>> There is a reason almost every new database aims to be distributed from the beginning.

That's partly because you can't compete with the existing RDBMSs if you're single node: they are good enough already. Nobody will buy your database if you don't introduce something more novel than PostgreSQL, whether that novelty is worth it or not.

Primary-secondary is simple and robust. If I had a dollar for every time I saw split-brain clusters....

---

And to respond sibling comment about "noticeable" downtime....

Primary-secondary failover in <1m is very feasible. And each minute downtime is a mere 0.002% for the month.

Primary-secondary isn't what is hurting your availability.

The experience for at least some of us is that failover is not robust. At all. And that < 1m is best case scenario that still requires a person to be monitoring the process.

And given that the entire industry has moved to a distributed model despite its complexity gives you a hint as to which way the wind has been blowing for the last decade.

You don't need to be that arrogant. The number-one reason why there are no new (No)SQL-Databases for one node is that the existing databases are great and you can't monetize them.

Failover is automatic for PG when using e.g. Patroni. Of course you lose active transactions and that might be a showstopper, but monitoring failover? I am curious when you'll have to do that.

a) not true b) not true c) not true d) not true e) a lot of people have no idea json support exists in PostgreSQL.
Agreed, when you see the index size in Mongo vs PostgreSQL, you will quickly understand that a single PostgreSQL instance can outscale a huge Mongo cluster.
PostgreSQL isn't the only RDMS to chose from.