Skip to the guide

Counting at scale: likes, views and sharded counters

IntermediatePattern5 pages

At the finish of a city marathon, a volunteer clicks a counter for every runner, quick but now and then wrong, and with four lanes there's a clicker per lane. A mat reads each runner's timing chip as she crosses, once whoever she is, and an official adds the mat's reads up every few seconds for the board above the line. Nobody counts the spectators along the route one by one; the organisers estimate the crowd.

Runners crossing are likes, and the chip mat's reads are the like rows, one per person per post: the truth you can recount. The official is an aggregator and the board is the cached total readers see, while a clicker is a counter bumped per event, the tempting shortcut, and a clicker per lane is a sharded counter. The estimated crowd is an approximate count, which is all views and unique viewers need. Every social design shows a count somewhere, and interviewers listen for which counts must be exact, where the truth lives, and what one viral post does to a counter. The move: keep the events you could recount as the truth, derive the count from them in batches, and estimate whatever nobody needs exact.