Try
↑ ↓ move↵ openesc close
In this lesson · topic 4 of 7
  1. 1. One post, a million timelines
  2. 2. Requirements, numbers, API and data model
  3. 3. Push, pull and hybrid in the lab
  4. 4. The celebrity problem
  5. 5. The hybrid and its threshold
  6. 6. Feed storage and pagination
  7. 7. The news feed in review

Topic 4

The celebrity problem

4 min read

Push at a glance

In a push feed the average post made 20.9 insertsmeasured and the average read took 5.5 msmeasured. A read is one lookup, and it is the same for everyone. That is the appeal.

The price is paid at write time, and it is paid unevenly. The largest post in the run made 972 insertsmeasured.

A big post blocks the queue

Writers have a fixed rate. In the lab it is 500 inserts a tick. A post with 999 followers takes two ticks of the writers’ whole capacity, and every post behind it waits.

With an even spread, the 99th percentile post waited 0.8 ticksmeasured before it reached every inbox. At the default skew it was 2.0 ticksmeasured. At a skew of 1.5 it was 6.2 ticksmeasured.

The mean post did not change. The tail grew, because a rare big post delays the small posts queued behind it. This is the same shape as a hot partition. See partitioning and the queue as a buffer for the same effect with queues.

Other costs of push

  • Inboxes for inactive users. A user who has not opened the app in a year still gets every post copied into their inbox. Skip users who have been away, and rebuild their feed on return.
  • Unfollow and delete. An unfollow or a deleted post has to be removed from many inboxes, or filtered at read time. Filtering at read is simpler.
  • Cold start. A new user with an empty inbox needs a feed built by pull.

What the model leaves out

The lab has no queue priorities, no batching and no sharded writers. Real writers can spread one huge post across many workers, which shortens the delay and does not remove the cost. The model also posts uniformly. Real celebrities may post more or less often than others.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms