BASE
BASE 是 NoSQL 的弱一致模型:基本可用、软状态、最终一致,牺牲强一致换可用性与扩展性。
用途
为分布式系统提供高可用与水平扩展,接受临时不一致。
机制
Basically Available:允许部分故障仍响应。Soft State:状态可不一致(需收敛)。Eventually Consistent:停止更新后最终所有副本一致。与 ACID 对立,由 CAP 定理决定取舍。
用例
- 大规模分布式存储
- CDN 与缓存
- 社交动态 feed
- 购物车与推荐
示例
- 输入
Brief inconsistency after a write输出All replicas eventually convergeEventual consistency
常见错误
- Using BASE when the business needs strong consistency
- Use ACID systems for finance and similar domains