Hacker News new | past | comments | ask | show | jobs | submit
> The reason DBs like Mongo or Dynamo exist is because Postgres has a scaling problem.

I've used Postgres at a few places and the #1 problem was always high availability, not scaling. One Postgres cluster could easily handle 100000 transactions per minute, but when a primary node went down it was a page and manually failing over to the spare then manually replacing the spare. The manual tooling was very finicky but at least it worked, no automated solution came even close. Lack of a good HA story is why I avoid self-managed Postgres as much as possible.

Good thing we support HA as well: https://docs.pgdog.dev/features/load-balancer/

Load balancer with health checks and failover, works out of the box. :) Battle-tested at this point too, so could be worth a look.

I've extensively used Dynamo (internally at Amazon and externally) and even founded a DB startup with it at it's core. Boiling down scalability of Postgres vs Dynamo as it's written in blog is a bit terse. Dynamo scales writes horizontally with the keyspace, forever. Postgres simply can't, and no number of layers between the machines and the developer changes that. Sharding, pooling, Citus are all layered on top of an engine where a given row's writes still land on one primary.
Dynamo DB isn’t even good at being a KV store. Almost every time we have to also back it with S3 because of size limitations.
did you use single table design?

and yeah you have to spend a lot of upfront time designing your data models

loading story #48488700
Dynamo is a fundamentally different DB to Postgres. If your problem fits into the dynamo approach (I'd argue that more problems do), then you should be using it. No all problems fit, though.
Agreed, my critique was about how the article frames scalability. I've yet to see an OLTP problem that can't live in something like Dynamo. KV can model anything if you put in the work, the question is how much modeling discipline you trade for the scale, and in my experience the up front work is always worth it. Most of the time operational issues are swept under the rug and not consider tech debt.

Take for example AuroraDB: the sheer engineering it took to make SQL do scalable OLTP at all tells you how much that flexibility actually costs to keep.

loading story #48489638
Curious how the DB startup with Dynamo at its core went. We use it heavily. The primary tricky thing for us at the moment is aligning pricing with workload value.
loading story #48481315
Except that dynamo is still just glorified mysql? https://news.ycombinator.com/item?id=18871661

I don’t think the backend matters. It’s the frontend wrapper that makes or breaks HA.

If Dynamo is glorified MySQL then Hacker News is also glorified MySQL. The system is the whole system, not just one part of it.
That's great news! I'll bookmark this in case I'm forced to manage Postgres again.
What do you use instead?
loading story #48485324
Is a load balancer HA?
Not by itself if it's naive, but if it's able to assess target health and avoid degraded instances then it becomes a component in HA, the other being integrating an orchestrator for gracious recovery.
from their docs:

> PgDog does not detect primary failure and will not call pg_promote(). It is expected that the databases are managed externally by another tool, like Patroni or AWS RDS, which handle replica promotion.

Why the snark comment? The PgDog project has been around for a while, it's not vibe coded.
Not gp but I didn’t perceive any snark in the comment you are replying to
okay, it does appear that the LLM didn't write any of this. i guess the simple answer is that it is not HA.
Combined with a replication strategy and automated health checks, a load balancer could direct traffic to a healthy instance automatically.
What happens when the load balancer fails?
HA has to be all the way through, in which case you might not need a load balancer because each client already connects to a separate server. If you do, then you can have one load balancer per client machine.
Patroni 1.0 was released in 2016, i.e ~10 years ago.

https://github.com/patroni/patroni

loading story #48481064
Patroni serves this niche pretty well at this point.
Have you tried cnpg? Worked amazingly well for my usecases
Have you looked into things like CloudnativePG? https://cloudnative-pg.io/
loading story #48481347
~1600 TPS is not 'high scale'.
loading story #48482092