Course contentsShow
← System Design
Lesson 1791 of 1,91943. Real-World System: Rate Limiter ServiceFree lesson

Single Data Center vs Distributed Setup

Starting with single data center for simplicity; understanding distributed coordination costs for global deployment.

Single Data Center vs Distributed Setup

What you'll learn: How starting with a single data center simplifies rate limiter implementation and when distributed coordination becomes necessary for global deployments.

Starting Simple: Single Data Center

When building a rate limiter, the simplest architecture deploys everything in one data center. All rate limit counters, configuration, and logic live in a single location. This means every request hits the same backend, making state management straightforward—no need to synchronize counters across geography.

Think of it like a single restaurant with one host tracking reservations. The host knows exactly how many tables are available because they're looking at one book.

Benefits:

  • Simple consistency: One source of truth for counters
  • Low latency: No cross-region network hops
  • Easy debugging: All logs and metrics in one place
  • No synchronization overhead: Direct in-memory counter updates

Limitations:

  • Geographic latency: Users far from the data center experience delays
  • Single point of failure: Outage takes down rate limiting globally
  • Limited scale: One data center's capacity is your ceiling

Moving to Distributed Setup

As your service grows globally, you need rate limiters closer to users. Now you deploy to multiple data centers or edge locations. But here's the challenge: if a user has a limit of 100 requests/minute, and they make 60 requests via the US data center and 50 via the EU data center, how do you enforce the limit?

Coordination costs:

  • Synchronization delay: Propagating counter updates takes milliseconds to seconds
  • Consistency trade-offs: You might over-allow requests during sync windows
  • Network overhead: Cross-region communication adds latency and failure modes
  • Complexity: Conflict resolution, eventual consistency, partition handling

Key Takeaway: Single data center rate limiting is simple and consistent but geographically limited; distributed setups reduce user latency and improve availability at the cost of coordination complexity and eventual consistency challenges.