Hacker News new | ask | show | jobs
by penne12 1096 days ago
Postgres by far. The inbuilt json support is great. In addition, Postgres as a whole has decades of bullet proofing behind it. MongoDB doesn't have many advantages, has many bugs and sharp edges, and doesn't have enough advantages to justify it's use. In [an old analysis by Jepsen](https://jepsen.io/analyses/mongodb-4.2.6), MongoDB 4.2.6 exhibited "read skew, cyclic information flow, duplicate writes, and internal consistency violations. Weak defaults meant that transactions could lose writes and allow dirty reads."

Will note that json/text columns are better than jsonb. Lower serialization overheads and surprisingly smaller binary size. Or better yet, just normalize to a columnar format.

2 comments

Counterpoint: Postgres is very hard to properly configure in a HA configuration and is hard to scale out, and this will pretty much force you down a path of using managed Postgres. If you DIY a serious deployment you’ll be spending a ton of time researching it and getting it just right.

In other words Postgres is actually kind of expensive for serious use despite being “free.” It’s just something to be aware of. Kubernetes is another “free” system with this nature.

If I were starting a new project today I would look hard at cockroachdb. Its license is on paper less free than Postgres but in practice it’s more free for many use cases, and it’s a modern raft database with auto failover and pretty easy scaling.

Postgres feels like something from 1980s Unix. Everything is manual and clunky and very arcane.

Regarding json/text instead of jsonb,

https://medium.com/geekculture/postgres-jsonb-usage-and-perf...

Says that jsonb is better suited for my needs as I need it to be indexed for lots of searching. Almost all my queries will have a where clause on this jsonb column.