Real-world mechanisms, state management, edge cases, performance trade-offs, and practical coding.
Answer:
In traditional hashing, keys are mapped to servers using node_index = hash(key) % N (where $N$ is the cluster size).
graph TD
subgraph Hash Ring
Ring[Circle 0 to 2^32-1]
NodeA[Server A] -->|Clockwise Next| NodeB[Server B]
NodeB -->|Clockwise Next| NodeC[Server C]
NodeC -->|Clockwise Next| NodeA
end
Key[Key: hash=1200] -->|Move Clockwise| NodeB
Server_A_1, Server_A_2). This ensures keys are distributed uniformly, preventing hot-spots on single machines.Answer: Sharding splits a large database horizontally, storing different subsets of rows (shards) across distinct database servers.
graph LR
User[User ID] --> Router{Shard Router}
Router -->|ID: 1-100| Shard1[(Shard 1)]
Router -->|ID: 101-200| Shard2[(Shard 2)]
shard_id = hash(key) % total_shards.JOIN queries across multiple servers is incredibly expensive and slow.Answer: The CAP Theorem states that a distributed system can guarantee at most two of the following three properties simultaneously in the event of a network partition:
graph TD
C[Consistency - Strong CP] --- A[Availability - Highly AP]
A --- P[Partition Tolerance - Vital]
P --- C
Answer: A Message Queue (MQ) decouples message producers and consumers, buffering request bursts.
Answer: Throttling engines used to enforce system-wide fair-use limits.
You've completed the 5 free sample questions. Get unrestricted lifetime access to every question, model answer, implementation challenge, and all 27+ technologies for a single payment.
₹399 India / $9 International · One-time settlement · Zero subscription