In 2014, the Messenger engineering team described an ordered queue of updates. The phone’s read position could stay put while the device was offline and new messages continued to arrive. On its return, the system had a place to resume.

That approach works when there is an ordered log and both sides agree on the position. There is another situation, familiar when two devices spend time apart. Each holds items the other has never seen. Neither can see the complete picture.

A place in the log, or two different sets

A cursor means “I have reached this point.” It is a cheap way to resume when both sides agree on the order of events. If the old log is no longer available or the reference has expired, the system may need to fetch a fresh starting copy.

In set reconciliation, the question is “What have you got that I do not have?” A Cornell report showed how sets can be represented as polynomials to reduce the amount exchanged when the difference is small. More recent work archived by MIT explores summaries that can grow until the difference can be resolved.

Sources in this section 123

The price of asking first

Imagine two notebooks with one hundred references each, 98 of them shared. If the aim is to combine the collections, each side needs two references from the other. First comes a separate cost: exchanging enough information to identify the four items present on only one side.

If almost everything has changed, an ever larger summary may cost more than sending a full copy. The choice depends on bandwidth, the length of contact, the processing available and the way the contents change. Counting transmitted objects alone can hide the cost of comparing them.

Examples of approaches to compare under controlled conditions.
ConditionApproach to evaluate
Ordered log availableResume from the last confirmed position
Independent, similar collectionsCompare summaries and request missing items
Many differences or no usable historyConsider transferring a complete copy

Sources in this section 23

Knowing what exists leaves conflicts to resolve

An update can delete an item or replace a version. Membership in a set, a conflict between versions and permission to receive an object are separate questions. When a system identifies a missing item, it still has to confirm that it is entitled to request it and knows what to do with it.

To assess a communications prototype, the lab could measure total bytes, rounds of exchange, memory and how often it has to restart with a complete copy. The examples in this feature explain how the problem is structured. They draw on no internal performance results.

Sources in this section 123

Sources and references

  1. Meta Engineering · Technical account of the Messenger mobile infrastructure in 2014
  2. Cornell University · Yaron Minsky, Ari Trachtenberg and Richard Zippel on set reconciliation
  3. MIT · Practical Rateless Set Reconciliation

Sources reviewed on .