Recommended resources
The freely available resources this lesson will direct you to.
- AWS re:Invent 2022 - Multi-Region design patterns and best practices (ARC306)www.youtube.com
- AWS re:Invent 2024 - Best practices for creating multi-Region architectures on AWS (ARC323)www.youtube.com
- Understanding Architectures for Multi-Region Data ...www.infoq.com
- Global Identity and Data Hosting: A Practical Frameworkguptadeepak.com
Hello! Welcome to the final lesson in our module on architecting advanced capabilities for identity platforms.
In our previous lesson, we designed a sophisticated anomaly detection system to identify suspicious activities like "impossible travel" by analyzing audit logs. That system operated on the data produced by our identity platform. Today, we shift our focus to the fundamental architecture of the global identity platform itself.
This lesson's outcome is to architect a cross-region federation model for a global identity platform to handle data residency and latency. We will explore how to design a system that serves users worldwide with fast authentication, while strictly adhering to complex and varied data sovereignty laws. This is a classic large-scale distributed systems design challenge that requires a deep, first-principles approach.
The Core Challenges: Juggling Compliance, Latency, and Availability
Building a global identity platform forces us to confront three competing requirements:
- Data Residency: Laws like GDPR in Europe, PIPL in China, and others mandate that citizens' personal data must be stored within their geographic region. This is a hard, non-negotiable compliance constraint.
- Low Latency: Users expect near-instantaneous authentication. A user in Sydney authenticating against a server in Ireland will experience significant network lag, leading to a poor user experience. This is a critical performance requirement.
- High Availability: The identity platform is a Tier-0 service; if it's down, no one can log in to anything. The system must be resilient to failures, including the failure of an entire cloud region.
To start, let's establish the fundamentals of multi-region design.
AWS re:Invent 2024 - Best practices for creating multi-Region architectures on AWS (ARC323)
This video from AWS re:Invent provides an excellent foundation for multi-region architecture. It clearly outlines the motivations and the core technical challenges we need to solve.
Please watch the introduction (00:00 - 06:58). Focus on the three primary motivations for a multi-region architecture: improved performance (latency), regulatory requirements (data residency), and increased availability. These are the three pillars our design must be built upon.
As you saw, these three drivers are often in tension. Our job as architects is to design a system that finds the optimal balance between them. The most critical and difficult part of this is managing the data.
AWS re:Invent 2022 - Multi-Region design patterns and best practices (ARC306)
Let's continue with another foundational video that dives into the most challenging aspect: the data itself. Understanding the trade-offs in data replication is key to any multi-region design.
Watch the section on 'Multi-region fundamentals' (01:16 - 10:00). Pay close attention to the explanation of asynchronous versus synchronous replication. This is a classic distributed systems trade-off between consistency and availability/performance, which is central to our design.
A Strategic Framework for Global Identity Federation
To tackle this complexity, we need a structured approach. Simply replicating all data everywhere is not an option due to data residency laws. We will use a strategic framework that breaks the problem down into manageable tiers.
Global Identity and Data Hosting: A Practical Framework
This article provides a superb, practical framework specifically for global identity data. It moves beyond generic advice and offers concrete patterns that directly address our learning outcome.
Please read the section 'A Strategic Framework for Identity Data Distribution,' focusing on 'Tier 1: Data Classification' and 'Tier 2: Architecture Patterns.' This is the most critical part of our lesson. Absorb the concepts of the three data tiers and the three architectural patterns.
Let's dissect this framework. It provides a two-step process: first classify your data, then choose an architectural pattern that fits your classification.
Step 1: Data Classification
Not all identity data is created equal. By classifying data based on sensitivity and legal requirements, we can apply different storage and replication strategies.
- Tier A (Highly Sensitive PII): Authentication credentials (password hashes, biometric templates), government IDs.
- Strategy: Strict region-based isolation. This data never leaves the user's home jurisdiction.
- Tier B (Operational PII): Name, email, user profile attributes, session information.
- Strategy: Can be more flexible. For example, a primary copy in the home region with read-only caches in other regions for performance, if regulations permit.
- Tier C (Anonymized/Pseudonymized Data): Login timestamps, device types, aggregated usage metrics.
- Strategy: Centralized storage. This data has been stripped of direct identifiers, so it can be aggregated globally for analytics and fraud detection without violating residency laws.
This classification allows us to be surgical in our design, applying the strictest controls only where necessary.
Step 2: Architectural Patterns
Based on our data classification, we can now evaluate three primary architectural patterns for our global identity platform.
Pattern 1: Region-Based Isolation (The "Silo" Model)
This is the simplest and most compliant model. Each region is a completely self-contained deployment, or "silo," with its own user database, application servers, and other infrastructure. There is no sharing of user data between regions.

- How it works: A smart routing layer (which we'll discuss later) directs a user to their designated home region. An EU user's authentication request is always handled end-to-end within the EU region.
- Pros:
- Maximum compliance and easy to audit.
- Excellent performance, as users are always served from their local region.
- Strong fault isolation; a failure in one region does not directly impact others.
- Cons:
- Higher cost and operational complexity due to duplicated infrastructure.
- Cross-region analytics become difficult.
- Handling "traveling users" (e.g., an EU citizen logging in from the US) requires careful design. The authentication still needs to be routed back to their home region, introducing latency for that specific session.
Pattern 2: Hybrid Approach (The "Hub-and-Spoke" Model)
This is a more sophisticated model that applies different strategies to different data tiers, offering a balance of compliance, performance, and cost. It's a common pattern for mature, large-scale systems. A great real-world example is a "read-local, write-global" (or more accurately, "write-to-primary") pattern.
- How it works: Let's imagine a "follow-the-sun" model for a global team of traders.
- The designated primary region for writes shifts throughout the day (e.g., Sydney -> London -> New York).
- All regions have a local replica of the data for fast reads.
- When a user in a secondary region needs to write data, the request is forwarded from their local application instance to the current primary region.
- The write is committed in the primary region and then asynchronously replicated to all other regions.
AWS re:Invent 2022 - Multi-Region design patterns and best practices (ARC306)
The Vanguard case study in this video provides a masterclass in implementing a hybrid model. They use 'Hub and Spoke' and 'Follow the Sun' patterns, which are perfect examples of this advanced architecture.
Watch the detailed case study from Vanguard (21:15 - 37:27). Pay close attention to how they differentiate read and write paths, forward writes to a primary region to avoid data conflicts, and use a central orchestration tool ('GOaST') to manage the global state. This is a deep dive into the engineering of a federated system.
- Pros:
- Balances cost, performance, and compliance effectively.
- Enables global use cases while keeping sensitive data controlled.
- Cons:
- Much more complex architecture.
- Requires careful management of data consistency due to replication lag.
Pattern 3: Data Sovereignty with Privacy-Enhancing Technologies (PETs)
This is a cutting-edge approach for highly regulated industries. It involves using advanced cryptography to allow computation on data without exposing the raw data itself.
- Examples: Homomorphic encryption (computing on encrypted data), federated learning (training ML models without moving data).
- Status: While powerful, these technologies are still maturing and often come with significant performance overhead. For our purposes, we'll acknowledge this as an emerging pattern but focus on the more established Patterns 1 and 2.
Implementation Details: Making Federation Work
Choosing a pattern is the first step. Now, let's architect the key components that enable it.
1. Smart Routing Layer
How does a user in Germany get routed to the EU silo, and a user in Japan to the APAC silo? This is the job of the routing layer.

The routing logic is typically multi-layered:
- DNS-Level Routing: Use Geo-IP capabilities in services like AWS Route 53 to direct users to the nearest regional endpoint. This is the first line of routing.
- Application-Level Routing: Once a user is identified (e.g., during login), the application can look up their home region from a central mapping and route them internally if needed. This handles cases where a user is traveling. For example, a login attempt at a US endpoint by a known EU user would be internally proxied to the EU region for credential validation.
Understanding Architectures for Multi-Region Data Residency
This article provides a great breakdown of different routing designs in a cell-based architecture.
Read the section 'Designs: Where to draw the Circles' and its subsections ('Client Routing', 'Gateway Routing', 'Application Routing'). This will give you a clear understanding of the different architectural choices for directing traffic.
2. Cross-Region Trust: The "Federation" in the Model
If each region is a silo, how do we establish trust between them? We don't want to share user credentials, but we might need a service in the US to trust a decision made by the EU identity platform.
This is where JSON Web Tokens (JWTs) become essential.
- Each regional identity platform has its own key pair for signing JWTs.
- The public keys of all regions are published to a globally accessible endpoint (a
/.well-known/jwks.jsonfile). - When the EU platform authenticates a user, it issues a signed JWT.
- That user can then present this JWT to a service in the US.
- The US service fetches the public keys from the global JWKS endpoint, finds the correct key (using the
kidheader in the JWT), and cryptographically verifies the token's signature.
The token is successfully validated without the US service ever needing to access the EU user database or see the user's password. Trust is federated, but the data remains resident.
3. Data Synchronization
In hybrid models, data synchronization is critical. As we saw in the AWS videos, this primarily comes down to asynchronous replication.
A fantastic, concrete example is how Samsung solved this for their global account system.
AWS re:Invent 2024 - Best practices for creating multi-Region architectures on AWS (ARC323)
To see these concepts put into practice, let's examine the architecture of the Samsung Account service, a massive-scale global identity platform.
Watch the Samsung case study (32:30 - 54:58). As you watch, identify how they solved the key challenges we've discussed: Why they went multi-region: What were their drivers? Data Synchronization: How do they sync data between their Aurora and DynamoDB databases across regions? Routing & Failover: How do they use DNS, CloudFront, and AWS Application Recovery Controller (ARC) to manage traffic routing and ensure high availability?
The Samsung case study is a perfect real-world blueprint. They built a global active-active architecture, implemented their own data synchronization pipelines, and engineered a highly resilient routing layer to achieve the trifecta of low latency, data residency, and high availability.
Conclusion
In this lesson, we have architected a cross-region federation model for a global identity platform. We moved from foundational principles to concrete architectural patterns and implementation details, grounded in real-world case studies.
Key Takeaways:
- Tension is Inevitable: Architecting a global system is a balancing act between the legal requirement of data residency, the performance need for low latency, and the reliability demand for high availability.
- Classify First: A strategic approach begins with classifying identity data into tiers based on sensitivity (e.g., credentials, PII, anonymized metrics).
- Choose a Pattern:
- Region-Based Isolation is the simplest, most compliant pattern, creating self-contained regional silos.
- Hybrid (Hub-and-Spoke) models offer a more cost-effective and flexible balance for large-scale systems but introduce complexity in data synchronization.
- Federate Trust, Not Data: Use standards like JWTs and shared public keys (JWKS) to allow services in one region to trust authentication decisions made in another, without sharing the underlying sensitive user data.
- Routing is Key: A multi-layered routing strategy using DNS, CDNs, and application-level logic is crucial for directing users to the correct region efficiently and reliably.
Preview of the Next Lesson:
With a robust, globally federated identity platform capable of verifying a user's identity anywhere in the world, we are now perfectly positioned to build services that consume this identity information to make fine-grained access decisions.
This brings us to our next module: Zero Trust Architecture. In the upcoming lesson, we will tackle the outcome: Design the end-to-end connection flow for a ZTNA service, contrasting the data and control planes with a traditional VPN architecture. We'll see how the principles of strong identity and "never trust, always verify" are replacing the old castle-and-moat security model.