Improve performance and reduce chances of request failures with this one simple trick! Avoid cross-region calls. 🫠
While the idea is simple, designing a system around this concept is anything but.
🤔 Why it’s Effective:
The core idea is straightforward:
Keeping traffic local is better for performance and resilience.
🚄 Performance:
Performance is easy to understand:
-
In-region traffic (including cross availability zone) usually sees single-digit millisecond latency (or less)
-
Cross-region traffic introduces latency, double-digit milliseconds or more, depending on the region
Latency adds up fast when you cross-regions multiple times in a microservices architecture.
🚀 Resilience:
Resilience is a bit more nuanced.
Every cross-region call passes through more network hops, such as firewalls, routers, switches, load balancers, etc.
More hops == More failure points
Keeping traffic local means fewer packet loss chances and less impact when things break.
🧙♂️ Complexities:
Designing for regional isolation (core concept of cell-based architecture) means:
1️⃣ Having active instances of critical services in each region (active-passive doesn't work with this approach)
2️⃣ Figuring out data replication and consistency across regions
3️⃣ Building robust routing and failover capabilities
4️⃣ Establishing management processes and capabilities that let you manage each region independently
Yes, the design is much more complex, and the operational overhead is much higher, but the blast radius of failure is smaller.
A failure with a critical service in one region only impacts that region.
🧠 Final Thoughts:
Perfect isolation isn't always possible; you might need to cross-region for data consistency or as a fallback.
When you need to cross-region:
✅ Reduce the number of cross-region hops as much as possible
✅ Do it up front, ideally before the request lands in your system.
The more cross-region routing you perform at the edge, the more you can avoid regional isolation complexities in the underlying systems.