Enterprise-Scale 100k+ TPS Order Tracking System Architecture

CK CK 3788 
Created at  
211 0 0

System Architecture Overview

To handle 100,000+ Transactions Per Second (TPS) for order inquiries, the system must decouple write operations from read operations. A traditional relational database (RDBMS) cannot handle this scale of read traffic directly.

This architecture adopts the CQRS (Command Query Responsibility Segregation) pattern, separating the Write Database (OLTP) from the Read Database (OLAP/Cache), and utilizes multi-level caching and asynchronous event-driven synchronization.

Enterprise-Scale 100k+ TPS Order Tracking System Architecture

 

 

1. Resolving Database Bottlenecks

To handle 100k TPS without degrading database performance, read traffic must be diverted away from the primary transactional database.

Enterprise-Scale 100k+ TPS Order Tracking System Architecture

Multi-Tier Caching Strategy

  • L1 Cache (In-Memory JVM Cache): Use local caches like Caffeine Cache within the application instances for extremely hot data (e.g., popular merchant orders, system-wide configurations). This reduces network latency to 0ms.
  • L2 Cache (Distributed Cache): Deploy a Redis Enterprise Cluster with sharding.
    • Sizing: Scale Redis to handle 90%+ of simple order status inquiries.
    • Data Structure: Use Redis Hashes to store serialized order JSONs.
    • High Availability: Use Redis Sentinel or Cluster with master-replica replication across Multiple Availability Zones (Multi-AZ).

Read-Optimized NoSQL & Search Engine

  • Elasticsearch Cluster: For complex, multi-conditional inquiries (e.g., searching orders by date range, item name, and status), sync RDBMS data to Elasticsearch. Elasticsearch shards can scale horizontally to handle high-throughput search queries.
  • DynamoDB / Cassandra: For historical order lookups, migrate orders older than 30 days to a highly scalable NoSQL database optimized for key-value reads.

Database Sharding and Read Replicas

  • RDBMS (PostgreSQL/MySQL): Maintain write-heavy data here.
  • Read Replicas: Deploy multiple read replicas behind a load balancer (e.g., AWS Aurora Reader Endpoints) to handle fallback read traffic that misses the cache.
  • Database Sharding: Shard the database horizontally by User_ID or Order_Date to prevent any single database instance from becoming a bottleneck during peak write periods, which indirectly improves read replication lag.

 

 

2. Concurrency Control & Traffic Management

Handling 100k concurrent requests requires robust traffic shaping and non-blocking I/O architectures.

Enterprise-Scale 100k+ TPS Order Tracking System Architecture

Asynchronous, Non-Blocking Edge Layer

  • Reactive Frameworks: Implement the API layer using non-blocking, event-driven frameworks like Spring WebFlux (Project Reactor) or Go (Goroutines). Traditional thread-per-request models (like Tomcat) will experience thread pool exhaustion at 100k TPS.
  • Connection Pooling: Optimize connection pools (e.g., HikariCP for SQL, LetTuce for Redis) to handle high-frequency recycling of connections.

Traffic Throttling and Rate Limiting

  • API Gateway (Kong / AWS API Gateway): Implement rate limiting using the Token Bucket or Leaky Bucket algorithm at the user/IP level.
  • Load Shedding: When system load exceeds a critical threshold (CPU > 85%), automatically reject low-priority requests (e.g., historical order searches) with an HTTP 429 (Too Many Requests) to protect core inquiry paths.

 

 

3. Transactional Integrity & Data Consistency

Because read and write paths are separated (CQRS), maintaining data consistency between the transactional database and the read stores (Redis/Elasticsearch) is critical.

Enterprise-Scale 100k+ TPS Order Tracking System Architecture

 

Event-Driven Synchronization (CDC)

To prevent write-path latency, do not update caches synchronously during the write transaction. Use Change Data Capture (CDC).

  1. Debezium + Apache Kafka: Captures row-level changes (Insert/Update) from the RDBMS transaction logs (e.g., MySQL binlog) in real-time.
  2. Kafka Message Broker: Publishes change events to an order-events topic partitioned by Order_ID to guarantee sequential processing.
  3. Cache Sync Consumers: Lightweight consumer applications read from Kafka and update Redis and Elasticsearch. This keeps the data sync lag under 100 milliseconds.
Enterprise-Scale 100k+ TPS Order Tracking System Architecture

 

Addressing Distributed Transaction Issues

  • Transactional Outbox Pattern: To guarantee that an order creation/update is both saved to the DB and published to Kafka without distributed transactions (2PC), write the event to an outbox table within the same local RDBMS transaction. A relay process then reads the outbox table and publishes to Kafka.
  • Idempotency: Consumers updating the read stores must inspect the version or updated_at timestamp of the incoming message. If a message with an older or equal version than what is currently in Redis/Elasticsearch arrives, it is discarded to prevent out-of-order updates.

 

Cache Consistency Patterns

  • Cache-Aside with TTL: For standard orders, read from cache; on miss, read from replica DB and write to cache with a Time-To-Live (TTL) (e.g., 10 minutes).
  • Write-Through via CDC: For active, high-frequency orders (e.g., newly placed orders), the CDC pipeline immediately pushes updates to Redis, ensuring the cache is populated before the first inquiry request arrives.

 

 

4. Disaster Recovery & High Availability

At 100k TPS, even a few seconds of downtime affects thousands of users. The infrastructure must be self-healing.

Enterprise-Scale 100k+ TPS Order Tracking System Architecture

Circuit Breakers and Fallbacks

  • Resilience4j Integration: Implement circuit breakers on the cache layers.
  • Fallback Path: If the Redis Cluster fails, the system must degrade gracefully. Instead of crashing the RDBMS with 100k TPS, the API layer should:
    1. Direct a throttled percentage of reads to RDBMS Read Replicas.
    2. Serve slightly stale data from a backup static CDN or Elasticsearch.
    3. Return a user-friendly error message asking the user to retry, protecting the master database.

 

Multi-Region Active-Active Deployments

  • Global Load Balancing (GSLB): Use AWS Route 53 or Cloudflare to route user traffic to the geographically nearest Data Center/Region.
  • Cross-Region Replication: Deploy the system in an Active-Active setup across two regions. Use globally replicated databases (e.g., AWS Aurora Global Database) and cross-region Redis replication to ensure instant failover capability.
Tags CDC Cache Consistency Caching Strategies Change Data Capture Concurrency Control Database Bottleneck Solutions Database Scaling Disaster Recovery Distributed Systems Event-Driven Synchronization High Availability High Availability Infrastructure High Throughput Systems Query Performance Optimization System Architecture Design Transaction Integrity 쇼핑몰 Facebook X
Comments 0
Similar posts
  1. Real-Time Inventory & WMS System Design
    250
  2. Enterprise-Scale 100k+ TPS Order Processing System Architecture
    183
  3. Designing Resilient Infrastructure to Prevent Order Data Loss During Kafka Failures
    161
  4. How to Design Redis Caching in Infrastructure Architecture
    161
  5. Is AWS API Gateway Disaster-Proof? DR, Benefits, and Multi-AZ Architecture Explained
    146
  6. Architecting for Resilience: AWS High Availability Components Including API Gateway
    144
  7. Architecture Design - Database Partitioning vs. Sharding
    159
  8. Large-Scale Concurrency Control: Solving the DB Bottleneck from a Flood of “Likes”
    276
  9. System Design: High-Traffic Time-Deal Promotion System
    181
  10. Fault Tolerance & High Availability based on multi Availability zones in AWS
    10,821
  11. Cadence Programming Model - A Distributed, Fault-Tolerant, Stateful Workflow Orchestration Framework
    301
  12. Optimize the performance of a search results page that experiences high traffic
    147
  13. Temporal Programming Model - Robust, Long-Running, Fault-Tolerant Applications as WorkFlows
    362
  14. Ad Indexing at Hyperscale: 100,000 Campaigns in Under 5ms
    295
  15. Predictable Ad Spend: Architecting Pacing at Hyperscale
    428
  16. Ad Tech Idempotency: Engineering for Reliability and Scale
    369
  17. AWS Ad Exchange Disaster Recovery: Active-Active, Active-Passive, and Cell Strategies - Disaster Recovery
    1,361
  18. Amagi CLOUDPORT Architecture based on AWS for FAST for channel playout on AWS
    1,330
  19. Key Metrics Track to Ensure the Health and Performance of a Distributed System
    181
  20. Building my own ChatGPT based on SageMaker and Milvus that is specialized to Shopping Mall
    281
  21. Messaging Platform with Limited TPS based on the vendor
    204
  22. Collecting Proof-of-Play from 100,000 Screens
    154
  1. The Blueprint of Success: Why System Design and Architecture Matter?
    409
  2. Software Design Patterns Cheat Sheet
    3,350
  3. Various naming for the Software Architecture - I can't find Component-based Architecture, Functional Architecture
    3,342
  4. Builder Pattern - offering pre-defined Interfaces to set Individual Parts
    1,438
  5. Abstract Factory Pattern - Commonly Used for UI Themes or Objects
    1,470
  6. Software Design Patterns
    1,445
  7. Observer Pattern
    2,401
  8. Factory Method Pattern allows overriding to return different concrete object types
    1,532
  9. Architecting Dynamic Scale-Out and Scale-In with Docker Containers
    136
Recently updated
  1. Google OAuth Token Expiration: Causes and Solutions
    31
  2. Why 100% SEO Guarantees Better User Engagement and How to Achieve It in Your Service
    57
  3. Why SPF and DKIM Are Essential for Linux Email Servers?
    51
  4. How do I create animated background for Google Meet?
    23,256
  5. MaxMind GeoLite2 vs. DB-IP Lite vs. ip-api.com: Choosing the Right Free IP Geolocation Solution
    273
  6. Meet Valkey: Why Redis Changed Its License, Why Valkey is Better, and How to Use It as a Drop-in Replacement
    105
  7. How Rogue Web Scrapers Are Stealing My Content and Destroying My Server
    170
  8. Array of arguments passed to script in PHP
    99
  9. Invalid Auction Storms in Ad Tech
    108
  10. Building MRC-Compliant Instrumentation in Ad Tech: Implementation Steps and Key Challenges
    209
  11. The Two Clocks of Ad Server Architecture
    78
  12. Frequency Cap Architecture Overview
    527
  13. Vector Search in Relational Databases (RDBs): Trends & Usage Environments
    303
  14. What is RedisVL?
    117
  15. Designing a Skill Registry Architecture: Minimize Token Usage and Maximize AI Performance
    247
  16. TPU & GPU Cluster Management Tools
    258
  17. The Concept of Scaffolding in AI Agents
    245
  18. Beyond Static Pipelines: Architecting LLM Multi-Agent Systems for Autonomous Workflow Orchestration
    599
  19. AI-DLC vs. AI-SDLC: Model-Centric vs. System-Centric AI Development
    269
  20. Fine-Tuning Open-Weight LLMs: Training, Licensing, and Deploying Custom Models with Ollama
    355
  21. Inside the Next-Generation Streaming Architecture: Ultra-Low Latency, SGAI, and AI Codecs
    207
  22. Machine Learning: Training vs. Ranking
    231
  23. The Continuous Learning Machine: Designing a Loop That Actually Turns
    229
  24. The Next-Gen Low-Latency Standards: LL-HLS & MoQ
    204
  25. Designing a Data Curation System Around a Vector Database
    230
  26. Extracting Context from Live Video: The Architecture Got Simpler When We Stopped Building Features
    264
  27. The New Ad Stack Behind Live Sports Streaming: Inside SGAI, EABN, and the Standards Race to Fix Live Monetization
    674
  28. Designing MLOps Architectures to Handle Seasonal Data Drift in EV Fleet Models
    201
  29. From 15 to 40+ FPS: Accelerating PyTorch Object Detection on Automotive ECUs
    233
  30. Understanding Data Lineage
    272