cloudpatterns.appClassroomKatasWhiteboardBlog
Kata

Celebrity day

Pixel’s writes — uploads, likes and comments — have outgrown its one database: 400 a second, each kind through its own web server (no load balancer here: copies of a database would each have to take every write), and the database falls over.

25 minHard

Members kata

Membership isn’t open yet. One kata or case is open to you now, 1 more with a free account.

The canvas opens for members

The brief

Pixel’s writes — uploads, likes and comments — have outgrown its one database: 400 a second, each kind through its own web server (no load balancer here: copies of a database would each have to take every write), and the database falls over. Then, at second 40, a celebrity posts and her fans pile on: 400 likes and comments a second on her photos, all keyed by her user id. They come in through her router — the same shard rule, applied to her one key. A database takes 2 CPU units a write (plus 10 idle): a large server holds about 185 writes a second before it passes 95% busy, an xlarge about 375 — and any server kept above 95% busy for 5 seconds goes down and stays down. Keep every write stored, hers included. So work it out: once she posts, how many writes a second land on your busiest shard?

What it checks

  1. 1Explain why shards add write and storage capacity where read replicas add only read capacity, and why each shard still needs replicas of its own.