Library βΊ System Design
π§© System Design
Monolithic vs Microservices, Explained With Moving Pictures
Almost every app you use, from shopping sites to banking apps, is built in one of two ways: as one big program (a monolith) or as many small programs that work together (microservices). In this guide you'll watch both styles in action: how they handle a new update, a huge sale and a crash, and which one you should pick.
1. A restaurant vs a food court
Picture two ways to feed a crowd:
- π½οΈ One big restaurant (monolith): one kitchen cooks everything (starters, mains, desserts) and all the cooks share the same fridge. Simple to run, but if the kitchen catches fire, nobody eats.
- π¬ A food court (microservices): separate stalls for pizza, noodles and ice cream, each with its own cooks and its own fridge. A host at the entrance sends you to the right stall. If the noodle stall closes, you can still get pizza.
Software works the same way. Here are both, running. Watch the little glowing dots: each one is a request, like a tap on "Buy now".
2. What is a monolith?
A monolithic application is built and deployed as one single unit. The code for users, orders, payments and the product catalog all lives in one project, runs in one program, and usually stores everything in one database.
- One codebase: everything is in one place, so it's easy to find and change.
- One deploy: you build it once and ship it as one package.
- One database: every part can read any data directly.
"Monolith" sounds old-fashioned, but it isn't a bad word. Most successful products, from small startups to some very large companies, started as a monolith, and many still are.
3. What are microservices?
With microservices, the app is split into small, independent services, each doing one business job: a Users service, an Orders service, a Payments service and so on.
- Each service runs as its own program and can be updated on its own.
- Each service owns its data. Others must ask it, rather than reading its database directly.
- Services talk to each other over the network, using web APIs or message queues.
- An API gateway (the "host" of the food court) receives requests from your phone and routes them to the right service.
4. Shipping an update
Say there's a small bug in the payment page. Watch what has to be released in each style:
This is the biggest reason large companies move to microservices. When hundreds of developers share one monolith, every release has to bundle everyone's changes together, and one team's bug can delay everyone. With microservices, each team can release its own service whenever it's ready, sometimes many times a day.
5. Handling a big sale
It's sale day and ten times more people are placing orders. Browsing and payments are only a little busier. How does each style cope?
Both can handle the sale. The difference is efficiency: copying the whole monolith also copies parts that weren't busy, which costs more servers and memory. Microservices let you scale exactly the part under pressure.
6. When something breaks
Now imagine a bug in one part goes badly wrong, for example it uses up all the memory and crashes the program:
That red β is a circuit breaker: when a service keeps failing, the others stop calling it for a while instead of waiting and piling up. The shop simply hides the "Recommended for you" section until it recovers. This idea of failing in a small, contained way is called fault isolation.
Fair warning: microservices don't stop failures by magic. If a critical service like Payments goes down, checkout still breaks. They just make it possible to keep the damage small, if the system is designed for it.
7. The hidden cost: talking over the network
So far microservices look like the winner. But splitting an app has a price, and it's paid every time two services talk:
That network gap brings a list of new problems you don't have in a monolith:
- Slower calls: one page might need answers from five services, and every hop adds delay.
- Partial failures: you need timeouts, retries and circuit breakers everywhere.
- Data spread out: an order and its payment live in different databases, so keeping them in sync is harder.
- Harder debugging: one request may travel through ten services. You need tools like distributed tracing and central logs to follow it.
- More to run: dozens of services to deploy, monitor, secure and pay for.
8. Side by side
| Monolith | Microservices | |
|---|---|---|
| Built as | One app, one codebase | Many small apps |
| Database | Usually one shared database | Each service owns its own data |
| Releasing | Whole app at once | Each service on its own |
| Scaling | Copy the whole app | Copy only the busy service |
| A crash | Can take down everything | Can be contained to one service |
| Speed inside | Instant function calls | Slower network calls |
| Getting started | Fast and simple | Slow, needs lots of setup |
| Best for | Small teams, new products | Many teams, large systems |
9. The middle path: a modular monolith
There's a popular in-between option. A modular monolith is still one app with one deploy, but its inside is divided into strict modules (Users, Orders, Payments) that only talk through clear, well-defined doors. You keep the simplicity of one app, and if one module ever needs to become its own service, it's already cleanly separated. Shopify, one of the largest online shopping platforms, is well known for taking this route with its main app.
10. Real-world stories
- Amazon started as one big program. In the early 2000s it broke the site into many small services owned by small teams, so they could move faster. This shift later helped shape Amazon Web Services.
- Netflix suffered a major database corruption in 2008 that stopped DVD shipments for days. That pushed it to move to the cloud and rebuild as hundreds of microservices, a move it completed around 2016.
- Amazon Prime Video showed it can go the other way too. In 2023 its engineers wrote that they merged a video-quality monitoring tool from many separate distributed parts into a single application, and cut that tool's infrastructure cost by about 90%.
The lesson: neither style is "better". Each is a tool, and good teams pick the one that fits their problem today.
11. Which one should you pick?
Tick everything that's true for your project and watch the needle move:
A good rule of thumb many experienced engineers follow: start with a well-organised monolith, and split out a service only when you feel real pain that microservices would fix.
Key takeaways
- A monolith is one app, one deploy and usually one database. It's simple and fast to build.
- Microservices split the app into small services that are released, scaled and failed independently.
- Microservices trade simplicity for flexibility, and add network delays, partial failures and much more to operate.
- A modular monolith gives you clean boundaries without the network cost.
- Choose based on your team size and real problems, not on what's trendy.
Quiz: test yourself
1. A shop needs 10Γ capacity for orders only. Which style lets it scale just that part?
Microservices. You add copies of the Orders service only. A monolith has to copy the whole app.
2. What does an API gateway do?
It's the front door: it receives requests from apps and browsers and routes each one to the right service.
3. Why are calls between microservices slower than inside a monolith?
They travel over the network instead of being a direct function call in the same memory.
4. A 3-person startup is building its first app. What's usually the best start?
A (modular) monolith. It's quicker to build and far easier to run. Split later if you need to.
5. What is a circuit breaker?
A safety switch: when a service keeps failing, callers stop calling it for a while so the failure doesn't spread.
Two new visual guides every week
Plus animated tech explainers on YouTube and Facebook.
More from the Library

Why CORS Errors Happen
The 'blocked by CORS policy' error explained with moving pictures: what an origin is, why browsers block, preflight requests and the server fixes that work.
Read with pictures β
What Is an API?
APIs explained like a restaurant waiter: see requests and responses travel, learn GET, POST, status codes and JSON, then make a real API call yourself.
Read with pictures β
How DNS Works
How does typing a name like resinfo.in find the right computer? Watch a DNS lookup travel from your browser to the root, .in and name servers, then try a live lookup yourself.
Read with pictures β