Why Two People See Different Instagram Like Counts: CAP Theorem at Production Scale

One user sees 120 likes, another sees 121. Instagram chose availability over consistency for engagement counts, and kept strong consistency where it matters.

Dhananjay AggarwalDhananjay Aggarwal, · 8 min read
Share
Summarize with AI
Two phones on a globe showing the same post at 120 likes and 121 likes, above the three CAP properties. From a post by Dhananjay Aggarwal.

If you have ever refreshed an Instagram post and noticed the like count differ by one between two people viewing the same post, you have seen a distributed systems trade-off in action. This is not a bug, a cache glitch or a UI race condition. It is a deliberate architectural decision rooted in the CAP theorem and enforced at production scale.

Two people see different Instagram like counts because Instagram runs likes as an AP system under the CAP theorem. A like is written to a nearby region and copied to other regions asynchronously, and each user reads from the nearest replica. Counts can differ by one for a moment, then converge to the true total.

This article breaks down what is happening, why it happens, and why the system is designed this way.

The Observable Symptom#

The symptom is that two users viewing the same Instagram post moments apart can see like counts that differ by one, such as 120 and 121.

Two users view the same post within a short window.

  • User A sees 120 likes
  • User B, moments later, sees 121 likes

Both views are correct for the system state at that moment. The mismatch is temporary and resolves itself.

User A's phone shows the post with 120 likes and User B's phone shows the same post with 121 likes. From a post by Dhananjay Aggarwal.

This behavior is not accidental. It is a direct consequence of how Instagram prioritizes system guarantees.

What is the CAP theorem?#

The CAP theorem says a distributed system cannot guarantee consistency, availability and partition tolerance all at once.

In a distributed system, you cannot guarantee all three of these properties at once:

  • Consistency: every read reflects the most recent successful write.
  • Availability: every request gets a non-error response, even during failures.
  • Partition Tolerance: the system keeps operating despite network splits or delayed communication between nodes.

Network partitions are not theoretical. At global scale, they are a constant reality, which removes the option of dropping partition tolerance. The real choice is between consistency and availability during partitions.

Is Instagram an AP or a CP system?#

Instagram operates as an AP system for engagement metrics like likes.

Availability First#

  • Feed loads must never block.
  • Likes must render instantly.
  • User interaction cannot wait for cross-region coordination.

Partition Tolerance Is Non-Negotiable#

  • Data is replicated across regions.
  • Network latency and packet loss are expected.
  • Regional isolation must not take the app offline.

Strong Consistency Is Sacrificed Temporarily#

  • Like counts can diverge briefly.
  • Reads may return slightly stale values.
  • The system does not take a global lock on every write.

This is eventual consistency by design, not by compromise.

The CAP triangle with Availability and Partition Tolerance ticked and Consistency crossed out. From a post by Dhananjay Aggarwal.

Why doesn’t Instagram use strong consistency for likes?#

Enforcing strong consistency for likes would require coordination across replicas before serving reads or confirming writes.

That introduces several problems:

  • Cross-region quorum latency on every like.
  • Feed rendering blocked on consensus.
  • Cascading delays during partial outages.
  • Worse tail latency, even during normal operation.

A like count that is off by one has negligible semantic impact. A frozen feed does not.

From a product and engineering perspective, availability outweighs numerical exactness.

How the Like Write Path Actually Works#

An Instagram like is written to a nearby region’s replica first and copied to other replicas asynchronously, while reads come from the nearest replica.

A simplified flow looks like this:

  1. User taps like.
  2. A nearby region accepts the write.
  3. The local replica updates immediately.
  4. The write propagates asynchronously to other replicas.
  5. Other regions catch up over time.

Reads are served from the nearest replica, not from a globally serialized source of truth.

Client A writes to Region 1, which replicates to Region 2 over asynchronous links. From a post by Dhananjay Aggarwal.

Eventual Convergence and Correctness#

Instagram like counts converge: replicas reconcile in the background until every count reflects the true total.

Although reads may diverge for a while, the system guarantees convergence.

  • All likes are durably recorded.
  • Replicas reconcile in the background.
  • Conflicts are resolved deterministically.
  • Counts eventually reflect the true total.

This is not relaxed correctness. It is delayed visibility.

Temporary inconsistency is allowed. Permanent inconsistency is not.

What Instagram Does Keep Strongly Consistent#

Instagram keeps authentication and sessions, payments and ad billing, username uniqueness and security-critical state transitions strongly consistent.

Not all data follows AP semantics. Certain paths demand strict guarantees.

Strong consistency is enforced for:

  • Authentication and session validity.
  • Payments and ad billing.
  • Username uniqueness and identity mapping.
  • Security-critical state transitions.

These operations cannot tolerate divergence, even briefly. They typically rely on tighter coordination, stronger isolation and more conservative availability trade-offs.

Two columns: AP covers like counts, feeds and replicas; CP covers auth, payments and usernames. From a post by Dhananjay Aggarwal.

The Engineering Principle Behind the Decision#

Distributed systems are not built around absolutes. They are built around impact.

Instagram accepts minor, temporary numerical drift because:

  • The user experience stays fluid.
  • The system stays resilient under failure.
  • Global scale becomes tractable.

The CAP theorem is not an academic constraint here. It is an operational reality enforced millions of times per second.

The next time two people see different like counts, they are watching a production-grade consistency trade-off do exactly what it was designed to do.

Frequently asked questions#

Why do Instagram like counts differ between users?

Instagram serves like counts from the nearest replica, and new likes reach other regions asynchronously. Two people reading from different replicas can briefly see different counts, such as 120 and 121.

Is a different like count on Instagram a bug?

No. A like count that differs by one is a deliberate result of Instagram choosing availability over consistency for likes. The mismatch is temporary and resolves itself.

Is Instagram AP or CP?

For engagement metrics like likes, Instagram is AP: it favors availability and partition tolerance and accepts brief inconsistency. For authentication, payments and username uniqueness, it enforces strong consistency.

What is eventual consistency?

Eventual consistency means replicas can briefly return different values but reconcile in the background until every read reflects the true total. Temporary inconsistency is allowed, and permanent inconsistency is not.

Can a distributed system give up partition tolerance?

Not at global scale. Network partitions are a constant reality there, so the real choice is between consistency and availability during a partition.

Found it useful? Clap for it.
Share
Summarize with AI
Prefer IntervueClub on GoogleShow our posts more often in Top Stories
Dhananjay Aggarwal

Written by Dhananjay Aggarwal

All posts