7 points · by shahinghasemi · 4y ago · 11 comments
I'm thinking of shared-codebase and shared-database paradigm for it's simplicity(no synchronization needed). Have you encountered this situation? Is it possible/and how to handle this objective with single database for all tenants? Further, I'm using PostgreSQL database.
Thanks in advance.
Separate database will only work if you'll have a handful of customers, and even then a pain.
But I'd re-think whether a single database is truly the right answer. What is driving you to that solution?
And is consistency across tenants really a hard requirement? Would an eventual consistency model work?
How does migration factor in? Do you mean migrating one database vs multiple databases?
What exactly would you be migrating? And if it’s written in code, migrating individual tenants one at a time, at your pace or when a particular tenant is ready to migrate, might be a feature and not a bug.
There are ways you can mitigate this. Strong isolation is one. Throttling tenant calls could be another.
We don’t know your specific use case enough, but it’s something to think about now.
This is generally referred to as the noisy neighbor problem.
https://docs.aws.amazon.com/wellarchitected/latest/saas-lens...
Also how much data will each tenant consume?