Skip to main content
System Design Interview
CHAPTER 20 Beginner

Final Projects and Real-World Applications

Updated: May 18, 2026
5 min read

# CHAPTER 20

Final Projects and Real-World Applications

1. Chapter Introduction

You have reached the summit. You understand Load Balancers, Distributed Caching, Polyglot Databases, Message Queues, and Microservices. However, system design is a holistic discipline. The true test of a senior engineer is combining all these isolated concepts into a single, cohesive, production-ready architecture. This final chapter serves as your master thesis: we will architect a massive, globally scalable E-Commerce platform from the ground up.

2. The Final Project: Designing "GlobalShop" (An Amazon Clone)

Requirements:
  • Users can browse millions of products globally with ultra-low latency.
  • Users can add items to a fast, reliable shopping cart.
  • Users can check out and process payments with strict data integrity (No lost money).
  • The system must handle "Black Friday" traffic spikes (100x normal load) without crashing.

3. Step 1: The Edge and Network Layer

We must protect our internal servers and serve traffic globally.
  1. 1. DNS (Route53): Routes users to the closest AWS Region using Geo-DNS.
  1. 2. CDN (CloudFront): All product images, CSS, and React frontend bundles are cached at the edge. Users download heavy assets from a local node, bypassing our servers entirely.
  1. 3. API Gateway: Acts as the single entry point. It handles Rate Limiting (to prevent DDoS attacks) and JWT Validation (to verify authentication statelessly).

4. Step 2: The Microservices Architecture

We break the massive monolithic E-Commerce app into independent services, allowing them to scale based on their specific bottlenecks.
  • Product Catalog Service: Read-heavy. Scales horizontally to hundreds of nodes during Black Friday browsing.
  • Shopping Cart Service: Write-heavy, ephemeral data. Must be lightning fast.
  • Order/Payment Service: Low throughput, but requires absolute perfection and security.
  • Notification Service: Asynchronous worker service.

5. Step 3: Polyglot Database Selection

*We select the perfect database for each microservice based on the CAP Theorem and Tradeoffs.*
  1. 1. Product Catalog DB: Uses MongoDB (NoSQL Document Store). Products have flexible, unstructured attributes (TVs have screen sizes, Shoes have sizes).
  1. 2. Catalog Cache: Uses a massive Redis Cluster. 99% of users are just browsing. The Catalog Service reads directly from Redis. The MongoDB is rarely touched during Read operations.
  1. 3. Shopping Cart DB: Uses DynamoDB or Redis (Key-Value Store). The cart data is ephemeral and needs sub-millisecond read/write speed.
  1. 4. Order & Billing DB: Uses PostgreSQL (Relational SQL). When money is involved, we demand strict ACID properties, relational consistency, and transactions.

6. Step 4: Asynchronous Processing (Handling Checkout)

Synchronous checkout is dangerous. If the Payment API takes 5 seconds, the user is stuck waiting. We use Event-Driven Architecture.
  1. 1. User clicks "Pay".
  1. 2. The Order Service validates the request, updates PostgreSQL to "Order Pending," and drops an event {"order_id": 123, "amount": 50} into an Apache Kafka Message Queue.
  1. 3. The API immediately responds to the user: "Order Processing!" (Latency: 50ms).
  1. 4. Background Worker Services (Payment Processor, Inventory Deductor, Email Sender) all consume the Kafka event simultaneously and do their heavy lifting asynchronously.

7. Step 5: High Availability and Disaster Recovery

We eliminate all Single Points of Failure (SPOFs).
  • Load Balancers: Configured in Active-Passive redundant pairs.
  • Microservices: Managed by Kubernetes, spread across 3 different Availability Zones (AZs). If one data center loses power, the other two keep the services running.
  • Databases: PostgreSQL uses Master-Slave replication. If the Master dies, a Slave is automatically promoted.
  • Observability: All services ship JSON structured logs to an ELK Stack (Elasticsearch, Logstash, Kibana) and metrics to Prometheus/Grafana so we can monitor Black Friday health in real-time.

8. The Final Whiteboard Diagram (Mental Map)

Visualize this flow: User -> CDN -> API Gateway -> Load Balancer -> [Catalog Service (Node) -> Redis -> MongoDB] User -> API Gateway -> [Cart Service (Go) -> DynamoDB] User -> API Gateway -> [Order Service (Java) -> PostgreSQL] -> (Kafka Queue) -> [Worker Nodes -> Email API]

9. The Mindset of a Senior Architect

As you leave this course, carry these architectural philosophies with you:
  1. 1. Complexity is a Cost: Never introduce Kafka, Kubernetes, or Sharding unless you can explicitly identify the bottleneck that makes them absolutely necessary.
  1. 2. Embrace Failure: Everything fails. Servers crash, networks drop, hard drives burn. Design systems that assume failure is inevitable (Redundancy, Retry logic, Dead Letter Queues).
  1. 3. There are No Perfect Solutions, Only Tradeoffs: A senior engineer never says "MongoDB is the best database." They say, "MongoDB is the best database for this specific microservice because we value flexible schemas over ACID consistency."

10. MCQs

Question 1

In the GlobalShop architecture, why are Product Images served via a CDN rather than directly from the Product Catalog Microservice?

Question 2

Why is the E-Commerce platform split into distinct Microservices (Catalog, Cart, Order)?

Question 3

Why does the Order & Billing Service explicitly use PostgreSQL (Relational SQL), while the Catalog uses MongoDB (NoSQL)?

Question 4

What is the role of the API Gateway in this final architecture?

Question 5

How does the architecture handle a massive "Black Friday" spike in users clicking the "Pay" button without crashing?

Question 6

What happens if the primary PostgreSQL Master Database crashes during checkout?

Question 7

Why are the Microservices deployed across 3 different Availability Zones (AZs)?

Question 8

How do the engineers monitor the health of this massive distributed system during Black Friday?

Question 9

What is the overarching philosophy of a Senior System Architect?

Question 10

What is the ultimate goal of the System Design Interview?

11. Interview Questions

  • Q: "You designed the GlobalShop architecture perfectly. Tomorrow, the CEO asks you to add a 'Live Flash Sale Countdown Timer' to the homepage. How do you adapt the architecture?" (Hint: Think WebSockets and Server-Sent Events).

12. Summary

You have built a FAANG-grade E-Commerce platform. You utilized CDNs and API Gateways at the edge. You decoupled logic using Microservices and Kafka. You implemented Polyglot Persistence with PostgreSQL, MongoDB, and Redis. You ensured High Availability across multiple Availability Zones, and you established full Observability using ELK and Prometheus. You are now a fully prepared System Architect.

Congratulations on completing the System Design Interview Bootcamp! You are ready to ace the whiteboard.

Finish this Chapter

Save your progress on your learning path and prepare for coding interview challenges.

Discussion

Join the discussion

Log in or create a free account to participate.

Sort: ·