Mixed Strategies: Hybrid Systems
What you'll learn: How real-world systems often combine CP and AP strategies across different subsystems based on data criticality.
The Core Idea
After learning about CP systems (prioritizing consistency) and AP systems (prioritizing availability), you might think every system must choose one side. In reality, most large-scale applications are hybrid systems that apply different CAP strategies to different parts of their architecture based on what each subsystem actually needs.
Think of a hospital: emergency room decisions (life-critical) require absolute accuracy and can wait briefly if systems are syncing. Meanwhile, the cafeteria menu board can show slightly stale data—it's better to stay up even if a soup option changed five minutes ago and hasn't propagated yet.
Why Hybrid Approaches Win
Different data has different requirements:
- Critical data (payments, inventory counts, user passwords): Use CP strategies. Brief unavailability during partitions is acceptable; incorrect data is not.
- Non-critical data (user timelines, recommendations, view counts): Use AP strategies. Temporary inconsistency is fine; going down loses users.
For example, an e-commerce platform might use:
- CP system for inventory management (preventing overselling)
- AP system for product reviews (showing slightly stale reviews is acceptable)
- CP system for checkout and payment processing
- AP system for browsing history and recommendations
The Practical Reality
You don't architect "a CAP system"—you architect subsystems with appropriate guarantees. A shopping cart might be AP (always add items), but order confirmation is CP (must be accurate). This lets you optimize each piece for its actual requirements rather than forcing everything into one model.
Key Takeaway: Real systems are hybrid—they apply CP strategies to critical data requiring consistency and AP strategies to data where availability matters most, giving each subsystem the guarantees it actually needs.