Files
system-design-101/data/guides/is-microservice-architecture-the-silver-bullet.md
Kamran Ahmed ee4b7305a2 Adds ByteByteGo guides and links (#106)
This PR adds all the guides from [Visual
Guides](https://bytebytego.com/guides/) section on bytebytego to the
repository with proper links.

- [x] Markdown files for guides and categories are placed inside
`data/guides` and `data/categories`
- [x] Guide links in readme are auto-generated using
`scripts/readme.ts`. Everytime you run the script `npm run
update-readme`, it reads the categories and guides from the above
mentioned folders, generate production links for guides and categories
and populate the table of content in the readme. This ensures that any
future guides and categories will automatically get added to the readme.
- [x] Sorting inside the readme matches the actual category and guides
sorting on production
2025-03-31 22:16:44 -07:00

27 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Is Microservice Architecture the Silver Bullet?"
description: "Explore when microservices aren't the best choice for your architecture."
image: "https://assets.bytebytego.com/diagrams/0278-monolithic-arch-use-cases.jpg"
createdAt: "2024-02-24"
draft: false
categories:
- software-architecture
tags:
- "microservices"
- "architecture patterns"
---
The diagram above shows why **real-time gaming** and **low-latency trading** applications should not use microservice architecture.
![](https://assets.bytebytego.com/diagrams/0278-monolithic-arch-use-cases.jpg)
There are some common features of these applications, which make them choose monolithic architecture:
* These applications are very **latency-sensitive**. For real-time gaming, the latency should be at the milli-second level; for low-latency trading, the latency should be at the micro-second level. We cannot separate the services into different processes because the network latency is unbearable.
* Microservice architecture is usually **stateless**, and the states are persisted in the database. Real-time gaming and low-latency trading need to **store the states in memory** for quick updates. For example, when a character is injured in a game, we dont want to see the update 3 seconds later. This kind of user experience can kill a game.
* Real-time gaming and low-latency trading need to talk to the server in high frequency, and the requests need to go to the same running instance. So **web socket** connections and **sticky routing** are needed.
So microservice architecture is designed to solve problems for certain domains. We need to think about “why” when designing applications.