4 ms·
In the case of Facebook, instead you would shard by feature. Every database server has replicateds of the user/friends data, but there'd be a separate server fo
by ROFISH 18y ago
In the case of Facebook, instead you would shard by feature. Every database server has replicateds of the user/friends data, but there'd be a separate server for the events or for groups.
- mdasen 18y agoAnd what about when there are too many events for a single shard? And maybe I'm wrong, but I feel like the friends data would be the biggest issue. Eventually, you get into some decently ugly stuff if you get big enough. Most people never have to worry about sharding (even 37signals doesn't), but there aren't just easy answers.
- axod 18y agoThe easy answer is to avoid the db wherever possible. For example, when people decide to write a chatroom, they often decide to put each message in a database. Which is sort of a ridiculous thing to do. Using in memory tables, flat files, etc where possible beats databases.