2 ms·
Hypothetical: So, you have 26 companies using Basecamp (Company A-Company Z). Your single database server can't handle all 26 companies so you decide to shard
by mdasen 18y ago
Hypothetical: So, you have 26 companies using Basecamp (Company A-Company Z). Your single database server can't handle all 26 companies so you decide to shard them.
Your previous setup:
Webhead1-|- Database1
Webhead2/
So, you have two webheads reading from one database. You need to shard and have a second database:
Webhead1--Database1 (Companies A-M)
Webhead2--Database2 (Companies N-Z)
Easy! Think of it this way: because a person at Company A is never accessing Company Z's data, there doesn't need to be any communication between the databases. So, it shards in the same way that Wordpress shards: different sites are on different servers.
With Basecamp, you don't need every company to be on the same server because you don't move data between companies. But you don't need a separate server for every company either. So, you can put a bunch of companies on the same server and a bunch on another server and you're done. There's nothing magic or RoR specific.