System design

Advanced

A cart that never forgets

Shoppers add items to their cart and sometimes see them disappear on the next page. The cart lives in a Cassandra cluster. At 11:00 a node will fail. Make the cart consistent and keep it available.

This is CAP and PACELC in practice: the consistency level decides how many replicas must answer each read and write.

What your design must achieve

  • Stale reads < 0.01 %
  • Availability ≥ 99.95 %
  • Latency p99 < 150 ms

What you will master