Earlier quoted context omitted.
How does the architecture block major refactors or improvements? Are you running a single codebase for all your tenants, albeit with separate schemas for each? Edit: on reading the link you included, it seems like a lot of the problems are on the Rails implementation of the architecture with ActiveRecord and Apartment rather than with the architecture itself.
Here I'll give you one: If you want to change a property of the database that will give your specific use improved performance, you have no way to transactionally apply that change. Rolling back becomes a problem of operational scale, rolling out as well. What if you need to release some feature, but that feature requires a database feature enabled? Normally you enable it once, in a transaction hopefully, and then ro…
Ask HN: Has anybody shipped a web app at scale with 1 DB per account?
131–140 of 264 posts
Re: Ask HN: Has anybody shipped a web app at scale with 1 DB per account?
#132Earlier quoted context omitted.
It also makes sharding/ horizontal scalability a non-issue, at least until you get a big enough customer.
But like, every database is easy to shard/horizontally scale until you get a big enough customer. Why do the extra leg work?
Re: Ask HN: Has anybody shipped a web app at scale with 1 DB per account?
#133Re: Ask HN: Has anybody shipped a web app at scale with 1 DB per account?
#134The inability to reuse database connections would be a huge performance hit. In a traditional webapp backend, you have a pool of connections to the database. User01 hits your service, and grabs a connection off the pool. User02 does the same, and so on. These connections get put back in the pool for reuse once a user is done with them. In your design, every time a user hits your service, a new connection, specific to…
Re: Ask HN: Has anybody shipped a web app at scale with 1 DB per account?
#135I’ve managed a system with millions of users and tens of billions of rows, and I always dreamed of DB per user. Generally, ~1% of users were active at a given time, but a lot of resources were used for the 99% who were offline (eg, indexes in memory where 99% of the data wouldn’t be needed). Learned a few tricks. If this is the problem you're trying to solve, some tips below. Start by optimizing your indexes. Ensure…
Re: Ask HN: Has anybody shipped a web app at scale with 1 DB per account?
#136My startup currently does just this 'at scale', which is for us ~150 b2b customers with a total database footprint of ~500 GB. We are using Rails and the Apartment gem to do mutli-tenancy via unique databases per account with a single master database holding some top-level tables. This architecture decisions is one of my biggest regrets, and we are currently in the process of rebuilding into a single database model.…
Re: Ask HN: Has anybody shipped a web app at scale with 1 DB per account?
#137It worked out pretty well. The only downside was that analytics/cross customer stats were kind of a pain.
The customers all seemed to like that their data was separate from everyone else's. This never happened, but if one database was compromised, everyone else's would have been fine.
If I were starting a B2B SaaS today where no customers shared data (each customer = a whole other company) I would use this approach.
Re: Ask HN: Has anybody shipped a web app at scale with 1 DB per account?
#138A fun read for sure
[0]https://www.colinsteele.org/post/27929539434/60000-growth-in...
Re: Ask HN: Has anybody shipped a web app at scale with 1 DB per account?
#139So to upgrade the application we'd upgrade the everyone application and then do the same with each enterprise client. We only had a few.
I'd recommend trying to avoid it if you can, and if you can't charging the appropriate amount of money which is an arm and a leg.