0
0
Microservicessystem_design~10 mins

Why microservices exist - Scalability Evidence

Choose your learning style9 modes available
Scalability Analysis - Why microservices exist
Growth Table: Why Microservices Exist
Users / ScaleSystem CharacteristicsChallengesWhy Microservices Help
100 usersSimple app, few features, single codebaseLow complexity, easy to manageMonolith works fine, microservices overhead not justified
10,000 usersGrowing features, more developers, some performance needsCodebase grows, deployments slow, teams overlapMicroservices start to help by splitting features, enabling parallel work
1,000,000 usersHigh traffic, many features, multiple teams, complex deploymentsMonolith too big, slow to deploy, hard to scale parts independentlyMicroservices enable independent scaling, faster deployments, fault isolation
100,000,000 usersMassive scale, global users, continuous delivery, many teamsMonolith impossible to manage, scaling bottlenecks, deployment risksMicroservices essential for scalability, team autonomy, resilience
First Bottleneck: Monolithic Architecture Limits

As user count and features grow, a single large codebase becomes hard to manage.

Deployments take longer because all code must be tested and released together.

Scaling the whole app wastes resources; some parts need more power than others.

Teams block each other due to shared code and dependencies.

This slows innovation and increases risk of failures affecting entire system.

Scaling Solutions Enabled by Microservices
  • Horizontal scaling: Scale individual services independently based on load.
  • Team autonomy: Small teams own specific services, speeding development.
  • Fault isolation: Failures in one service don't crash the whole app.
  • Technology diversity: Use best tools per service without affecting others.
  • Continuous deployment: Deploy services independently for faster releases.
  • Data isolation: Each service manages its own data, reducing conflicts.
Back-of-Envelope Cost Analysis

At 1 million users, assume 10 requests per user per day = 10 million requests/day (~115 QPS).

Monolith must handle all requests; scaling entire app is costly and inefficient.

Microservices let you scale only busy parts, saving CPU and memory.

Storage is split per service, reducing contention and improving performance.

Network overhead increases due to inter-service calls but is manageable with good design.

Interview Tip: Structuring Your Scalability Discussion
  1. Start by describing the current system and its scale.
  2. Identify bottlenecks as user count grows (codebase size, deployment speed, scaling limits).
  3. Explain why a monolith struggles at larger scale.
  4. Introduce microservices as a solution to these problems.
  5. Discuss benefits: independent scaling, team autonomy, fault isolation.
  6. Mention trade-offs like increased complexity and network overhead.
  7. Conclude with how microservices enable sustainable growth.
Self-Check Question

Your monolithic app's database handles 1000 queries per second (QPS). Traffic grows 10x to 10,000 QPS. What do you do first and why?

Answer: The database is the first bottleneck. To handle 10x traffic, first add read replicas and caching to reduce load. Then consider splitting the monolith into microservices to scale parts independently and reduce database contention.

Key Result
Microservices exist to solve scaling and management challenges of large, complex applications by enabling independent scaling, faster deployments, and team autonomy.