Sharding easy
In system design, what is the primary goal of implementing 'Geo-Sharding'?
- A To partition the data based on the physical file size of the records on the disk.
- B To store data near the user's physical location (e.g., US users in a US datacenter) to minimize network latency and comply with local data privacy laws.
- C To utilize high-speed satellite links as a secondary communication channel for the database.
- D To shard data based on the geometric complexity of the stored objects.
Answer: B. To store data near the user's physical location (e.g., US users in a US datacenter) to minimize network latency and comply with local data privacy laws.
Geo-sharding is a hybrid strategy. It provides two massive benefits: speed (reducing the RTT for global users) and compliance (obeying laws like GDPR that restrict where personal data can be stored). While it solves these problems, it introduces a unique challenge: 'Global Consistency'. If a user from Paris travels to Tokyo and updates their profile, the system must decide whether to move their data to a local server or accept the long-distance latency for every request.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In an E-Commerce platform, why might you choose to shard the `Orders` table by `user_id` rather than the more obvious `order_id`?
- In the context of database scaling, what is the fundamental difference between 'Vertical Partitioning' and 'Horizontal Partitioning' (Sharding)?
- If Shard A fails in a large cluster, and its incoming traffic is automatically re-routed to Shard B, what is the risk of a 'Cascading Failure'?
- In a standard 'Modulo Sharding' setup (`key % N`), what is the primary consequence of adding a new server to the cluster (increasing N from 10 to 11)?
- From an engineering perspective, when should you choose 'Vertical Scaling' (a bigger server) over 'Horizontal Scaling' (Sharding)?
- Which sharding strategy is mathematically optimized for efficient 'Range Scans' (e.g., retrieving all records created between January and March)?