Course contentsShow
← Software Engineering
Lesson 1409 of 1,93341. Scalability and Distributed SystemsFree lesson

AP Systems: Choosing Availability Over Consistency

How AP systems remain available during partitions by accepting temporary inconsistency, and when this trade-off is appropriate.

AP Systems: Choosing Availability Over Consistency

You'll learn: When and why distributed systems sacrifice immediate consistency to guarantee availability during network failures.

The Core Trade-Off

In an AP system (Availability + Partition tolerance), the system remains operational and responsive during network partitions, even if that means different nodes temporarily return different data. When the network splits, both sides continue accepting reads and writes independently—consistency comes later, once the partition heals.

Think of it like two bank branches losing their network connection. An AP system lets both branches continue processing transactions locally. When the connection restores, they reconcile any conflicts. The alternative (CP system) would shut down one or both branches until the connection returns—safe, but unavailable.

When AP Makes Sense

AP systems excel when:

  • User experience matters more than perfect accuracy: Social media feeds, recommendation engines, shopping carts
  • Downtime is more costly than temporary inconsistency: E-commerce during peak sales, streaming services
  • You can tolerate and resolve conflicts later: Many conflicts are resolvable through versioning or last-write-wins

For example, if two users edit their profiles simultaneously on different servers during a partition, both updates succeed immediately. The system reconciles them later using timestamps or version vectors.

The Consistency Cost

The "inconsistency" isn't permanent—it's eventual consistency. Users might see stale data briefly, but the system converges to a consistent state after the partition heals. You must design your application to handle conflicts and accept that reads might return outdated values.

Key Takeaway: AP systems prioritize keeping your service available to users during network failures, accepting that data will be temporarily inconsistent across nodes but will eventually converge once the partition resolves.