Using Horizontal Sharding for Multitenancy
Horizontal sharding was added to Active Record multiple databases in 6.1.[355]
Horizontal sharding is a general mechanism to run copies of a same-schema database on more instances. What are some use cases?
One compelling use case for horizontal sharding is for multitenant architectures. For Software as a Service (SaaS) platforms with hundreds of customers, some customers may have exceptional query volume or data growth. When those customers are in a database on an instance that’s shared by many customers, they can create a “noisy neighbor” problem, where the resources they consume degrade the performance for others.
To address that, organizations may migrate the data for that customer out of the multicustomer ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access