Evaluation of a Distributed Cache's Design

Lesson 61 of 25610 min readPremium lesson preview
In this lesson2 sections

Evaluation of a Distributed Cache's Design

Evaluate the cache on the complete request path and under the failures it must tolerate. Local data-structure complexity is only one part of latency; network time, miss handling, and contention also matter.

Requirements compliance

Let’s evaluate the design against our requirements.

High performance

The following design choices contribute to high performance:

  • A binary search over a sorted consistent-hash ring takes time, where counts ring positions. With one position per shard, it is the shard count; virtual nodes add positions. Other lookup representations can have different costs.

  • Hash tables provide expected constant-time lookup, subject to hashing and collision behavior.

  • A doubly linked list supports constant-time LRU pointer updates once the entry is located, but concurrent access can contend on shared state.

  • Transport, serialization, queueing, and payload size contribute to remote-call latency. TCP or UDP alone does not guarantee speed.

  • Read replicas can distribute eligible reads within their combined capacity.

  • RAM avoids a local disk read, but does not eliminate the other costs on a cache hit.

The rest of this lesson is for Premium members

Premium opens every lesson in this course, along with all questions and solutions on PracHub.