Designing a Multi-Tenant, Globally Scalable Tagging System
Goal: Build a multi-tenant tagging platform that prevents duplicate tags globally, serves product discovery in under 25ms, and tracks tag usage across millions of clicks with zero data loss. Scale: 10K tenants, 200K concurrent users across three regions.
Tagging systems get complex fast when they need to work across multiple tenants and regions.
This post breaks down the design into three consistency tiers, because not everything needs the same guarantees: strong consistency for tag operations, smart caching for discovery, and eventual consistency for analytics.
🎯 Functional Requirements
| Requirement | Details |
|---|---|
| Multi-tenancy | Each tenant independently manages its tags and content |
| Global availability | Low latency access for users worldwide |
| Tag lifecycle | Create, update, delete tags |
| Content tagging | Associate and dissociate tags from content |
| Popular tags dashboard | Show most-used tags by lifetime view counts |
| Scale | Handle up to 10K concurrent global users |
⚡ Non-Functional Requirements
| Requirement | Target | Priority |
|---|---|---|
| Users distributed across multiple regions | US, EU, Asia | P0 |
| Tag creation latency for all users | ~100ms regardless of location | P0 |
| Prevent duplicate tag creation globally | Same tag name = same tag ID | P0 |
| All users see same tag state after creation | Strong consistency | P0 |
| Tag creation and content-tag mapping consistency | ACID across regions | P0 |
| View count metrics consistency | Eventual (~2 min delay acceptable) | P1 |
| Resilience to infrastructure failures | Auto-failover, zero data loss | P1 |
📊 Back-of-the-Envelope Calculations
🔒 Premium section
🗄️ Database Design
🔒 Premium section
📚 RESTful API Design
🔒 Premium section
🏗️ System Architecture
🔒 Premium section
🚧 Core Challenges
🔒 Premium section
🔧 Solution 1: Tag Creation with Strong Consistency
🔒 Premium section
🔧 Solution 2: Product Discovery with Smart Caching
🔒 Premium section
🔧 Solution 3: Tag Usage Counting with Zero Data Loss
🔒 Premium section
🔄 Data Flow & Consistency Model
🔒 Premium section
🔍 Identify Bottlenecks
🔒 Premium section
📈 Performance Characteristics
🔒 Premium section
🛡️ Resilience & Failure Handling
🔒 Premium section
🚀 Deployment Strategy
🔒 Premium section
📡 Observability
🔒 Premium section
🔐 Security
🔒 Premium section
🎯 Key Design Decisions & Trade-offs
🔒 Premium section
🏁 Conclusion
🔒 Premium section
Explore the Technologies
🔒 Premium section