Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Postgres is enough as long as you have a good multi-tenant setup e.g. a separate database per customer.

Ran a single postgres instance with multi-tenant SaaS product that crossed 4B records in a few tables, even with partitions and all the optimization in the world, it still hurts to have one massive database.

We still got bought tho, so I will agree its enough



> Postgres is enough as long as you have a good multi-tenant setup e.g. a separate database per customer.

Separate per customer has a lot of advantages (especially around customer security and things like deletion) but you can also shard by customer right from the beginning; customer #1 in the "odd" shard, customer #2 in the "even" shard etc. Switching to database per customer if that is working well is relatively easy so you're future proofed both ways.


Worked at a company that suffered from this too. Compounded by the feature that let customers share data with other customers, so single DB was a decent architecture to begin with. And we were on postgis v1, which had no straightforward upgrade path to 2.0, nor was it supported by later versions of Postgres. Restoring a backup became a multi-day affair.


That's easier now than ever with services like neon.tech and fly.io where you can quickly spin up new databases via api.


Better still, take a look at Nile's "tenant virtualization" concept: https://www.thenile.dev/


That is cool, thanks!

I feel like this is going to solve a lot of saas businesses problems.


How did you use partitions for scaling? Hash based partitioning on the primary keys of your tables? Or something else?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: