Quality Attribute Trade-offs: Consistency vs Availability vs Latency

Why non-functional requirements conflict: CAP and PACELC, consistency vs latency, security vs usability, cost vs availability, and how to decide trade-offs.

Published November 27, 2026

Every architecture is a set of trade-offs. You cannot have maximum consistency, availability, low latency, rock-bottom cost and unbreakable security all at once. Good engineers do not avoid trade-offs; they make them deliberately, based on which qualities matter most for each part of the system. This article covers the trade-offs you will meet most often and how to reason about them.

The concept

The CAP theorem says that during a network partition, a distributed data store must choose between consistency (every read sees the latest write) and availability (every request gets a non-error response). Since partitions happen in any real network, the practical choice is CP (refuse some requests to stay consistent) or AP (answer with possibly stale data).

PACELC extends CAP to normal operation: if there is a Partition, choose Availability or Consistency; Else, choose Latency or Consistency. Even without failures, keeping replicas strongly consistent requires coordination (waiting for a quorum or a leader), which adds latency, especially across regions. That everyday latency-versus-consistency trade-off matters far more often than partitions do.

The trade-offs you will meet

Trade-offGainCostTypical resolution
Consistency vs latencyAlways-correct readsCross-replica coordination per writeStrong for money, eventual for likes/feeds
Consistency vs availability (partition)No conflicting dataErrors during partitionsCP for inventory/ledger, AP for carts/presence
Security vs usabilityFewer breachesFriction (MFA, timeouts)Risk-based auth, passkeys
Availability vs costLess downtimeRedundant regions, on-callMatch nines to business impact
Performance vs maintainabilitySpeedComplex, specialised codeOptimise hot paths only
Time-to-market vs scalabilityShip soonerRe-architecture laterDesign seams, not full scale

Strong consistency costs a round trip

ClientLeader (Mumbai)Replica (Frankfurt)write x=5replicateack (+120 ms)committed
Synchronous cross-region replication: strong consistency, paid for in latency.

Eventual consistency is fast but stale

ClientLeader (Mumbai)Replica (Frankfurt)write x=5committed (fast)replicate asyncread x (may be stale)
Asynchronous replication: fast writes, but a replica may briefly serve old data.

Decide per data type, not per system

Real systems mix models. An e-commerce site might use strongly consistent transactions for payments and inventory reservations, eventual consistency for product reviews and recommendation feeds, and a cache with minutes of staleness for the catalogue. Write down which guarantee each data type needs and why; that table becomes one of the most useful documents in the project.

Practical examples

Tunable consistency in Cassandra

Choose per query: QUORUM reads + QUORUM writes overlap, giving strong consistency for that data.

CONSISTENCY QUORUM;
INSERT INTO balances (account_id, amount) VALUES (42, 1000);
CONSISTENCY ONE;   -- fast, possibly stale, fine for a timeline
SELECT * FROM timeline WHERE user_id = 42 LIMIT 50;

Read-your-writes with a primary fallback

Route a user's reads to the primary for a few seconds after they write.

def db_for_read(user):
    if time.time() - user.last_write_at < 5:
        return primary
    return random.choice(replicas)

Writing a trade-off down

A short record of what was chosen and what was given up.

Decision: Shopping cart uses eventually consistent, multi-region storage (AP).
Gained:   cart always writable, even during regional outages.
Gave up:  rare duplicate items after a partition; resolved by merging carts at checkout.

Common mistakes

  • Claiming a system is "CA": without partition tolerance it is simply not distributed.
  • Making everything strongly consistent "to be safe" and paying latency and availability costs everywhere.
  • Making everything eventually consistent and then discovering double-spent balances.
  • Hiding trade-offs instead of documenting them, so the next team repeats the debate.
  • Optimising a quality nobody asked for while neglecting the top-ranked one.

Key takeaways

  • Quality attributes conflict; trade-offs are unavoidable.
  • CAP is about partitions; PACELC adds the everyday latency vs consistency choice.
  • Choose consistency per data type based on business impact.
  • Document each trade-off: what you gained and what you gave up.

FAQ

Is PostgreSQL CP or AP?

A single-primary PostgreSQL setup favours consistency: if the primary is unreachable, writes fail until failover. With async replicas, reads from replicas can be stale.

What is eventual consistency in plain words?

If no new writes happen, all replicas will converge to the same value eventually. In practice "eventually" is usually milliseconds to seconds.

How do I explain trade-offs in an interview?

Name the options, state what each gains and loses, pick one, and tie the choice to a requirement you agreed earlier.

More Architecture articles