Reading — step 1 of 5
Read
High-Availability Registry
A single registry is a SPOF. If it dies, no service can find any other.
Replication options:
Consensus-replicated (Raft/Paxos):
- 3-5 servers
- Strongly consistent
- Lower throughput
- Used by: Consul, etcd, ZooKeeper
Peer-to-peer (Eureka):
- Many servers; gossip-replicated
- Eventually consistent
- High throughput
- Higher staleness; AP per CAP
Federation: multiple datacenters, each with its own cluster. WAN replication for cross-DC discovery.
Choosing CP vs AP:
- CP (Consul, etcd): registry data is always consistent. Lookup may fail during partition (some clients can't reach quorum).
- AP (Eureka): registry always responds; data may be stale. Better for "best-effort" discovery.
Eureka's reasoning: it's better to have some stale results than NO results. A stale instance address might still work; an empty result definitely doesn't.
In practice: most modern stacks use CP (Kubernetes uses etcd; Consul is CP). The trade-off: deploy carefully so you never lose quorum.
Caching: clients cache last-known good results. Survive registry outages.
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…