3 ms·
Everyone's experience is of course their own, but I wanted to provide a counterpoint from my experience over the past 5 years. At NationBuilder we do schema-bas
by jacobkg 10y ago
Everyone's experience is of course their own, but I wanted to provide a counterpoint from my experience over the past 5 years. At NationBuilder we do schema-based multi-tenancy with Postgres. We have over 30,000 schemas spread across over a dozen databases. One of our databases has more than 5,000 customer schemas on it (the average is about 2,500). Nevertheless we are able to run a Rails application, execute migrations, generate new schemas using the Schema.rb file, add and remove indexes, and many of the other items mentioned in the article.
Has it been challenging? Absolutely. But it definitely is possible. Furthermore we have not found a better way to ensure the privacy of our customer data (separate schemas is the closest we can get to guaranteeing that a badly written join won't expose data to the wrong customer).
PS - I applaud the authors of the original article for publishing their schema management code as the open source Apartment gem (which I wish had existed when we were starting out)
- arethuza 10y agoI had no idea what NationBuilder does (definitely not in the target market) - but having had a look at your website I can see why your customers could well be rather security conscious!
- barrkel 10y agoWe do SaaS for the financial industry, and we started out creating a separate virtual network with multiple VMs for each customer. Router firewalling, iptable lockdown, IP whitelisting to customer IP range. Encrypted disks (backed by SAN) for database storage with different keys per customer. Etc. So we had to scale up our deployment process to multiple concurrent migrations per customer pretty much from day one. The downside of this is that customers need to be big to afford the constant overhead of physically renting the machinery to serve them, administer them etc. So we're moving towards multi-tenancy from the other angle, aiming at smaller firms with less stringent data security requirements.