Inkwell's posts live in a key-value store. Writers publish and edit posts all day, and many of them refresh straight away to check. Every few minutes one of them writes in: the post they just published isn't there. A second later, it is.
What it does
- Write: a writer publishes or edits a post.
- Read: someone opens a post. Often it's the writer who just changed it.
Workload
A steady 20 000 rps, 95% reads / 5% writes, for 20 seconds, against 100 000 posts. Popular posts get most of the reads and most of the edits.
How to build it
The app tier is fixed: six xlarge replicas behind a load balancer. You choose the key-value store's partitions (small, each 5 000 read units and 1 000 write units a second) and its consistency:
| Consistency | Each read costs | Reads see |
|---|---|---|
| eventual | 1 read unit | any copy, possibly a moment behind |
| strong | 2 read units | the latest write |
| strong_after_write | 2 units for keys written in the last second, 1 for the rest | the latest write when it's recent |
- Build client, load balancer, app server, KV store, and run it. Look at Read your writes in the results.
- Fix it for writers, then look at what it cost.