Should I start with a monolithic or microservices architecture?

Christopher Mcclure
Christopher Mcclure
Seasoned entrepreneur with 15 years in tech startups.

This is an excellent question, one that many nascent teams grapple with. Let me explain it to you with a simple analogy, and it will become clear.

A monolithic service is like running a small restaurant. You are the owner, chef, and waiter all rolled into one. Everything happens within this single establishment: buying ingredients, washing vegetables, cooking, serving, and collecting payments.

  • Pros: You can open quickly! With just yourself or one or two helpers, you can rent a space and get started right away. Communication costs are zero; if you want to add a new dish, you figure it out yourself, and it's on the menu the next day. Management is very simple because it's just one shop.
  • Cons: It gets troublesome when you scale up. More and more customers come in, and you can't handle it alone. The kitchen is too small, there aren't enough woks for cooking, and the serving aisle gets crowded. If you want to renovate the kitchen, the entire restaurant has to close for several days.

Microservices are like running a large food court. You're not opening your own restaurant; instead, you're the landlord, dividing the space into individual stalls. There's a stall specializing in Malatang, one for bubble tea, and another for teppanyaki. Each stall manages its own business.

  • Pros: Specialization! Each stall focuses only on its own task, doing it quickly and well. If the bubble tea stall becomes incredibly popular, you can immediately add another stall next to it without affecting other businesses. If any stall wants to renovate or upgrade, the others can continue operating as usual. You can have the bubble tea stall use the latest smart tea machines, while the teppanyaki stall uses traditional griddles; their technologies don't interfere with each other.
  • Cons: Huge upfront investment! You first have to spend a lot of money to build the entire food court, installing water, electricity, and gas, and also establish a set of management rules, such as how to centralize payment collection, how to handle waste, and so on. Management becomes very complex; you have to coordinate dozens of stall owners, and the costs are high.

My Advice to You:

In 99% of cases, don't hesitate to start with a monolithic service!

For a startup, the most important thing is to "survive," and the key to survival is "speed." You need to build your product as quickly as possible, launch it to the market, and see if people are willing to use it and pay for it. At this stage, you might only have dozens or hundreds of users, so the "disadvantages" of a monolithic service are simply not an issue.

If you jump straight into microservices, it's like spending a year building a food court capable of accommodating a million people before your product even has a clear direction. By the time it's built, the market will have changed, or you'll have run out of money. This is called "premature optimization," a major taboo for startups.

So, when should you consider microservices?

When your "small restaurant" genuinely becomes incredibly popular:

  1. Your team has grown: You've hired twenty or thirty chefs, they're all crammed into one kitchen, you can't manage them effectively, and they're getting in each other's way. At this point, you can split into several independent "sub-kitchens," such as a "cold dishes department," a "hot dishes department," and a "pastry department."
  2. Business scale has increased: Thousands of customers daily, and cooking becomes a bottleneck, dragging down the efficiency of the entire restaurant. At this point, you can separate the "cooking" process, add 10 stoves, and dedicate them to handling massive orders.
  3. A specific feature is particularly complex: For example, your "delivery order receiving" system has rapidly changing requirements, and every modification requires shutting down the entire restaurant, which isn't cost-effective. In that case, isolate it and have a dedicated team maintain it.

To sum up with some practical advice from experience:

Start with a monolithic service, get your business running, make money, and survive. While building your monolith, pay attention to keeping your code structure clear (just like separating the kitchen, dining area, and storage room in a small restaurant); this will make it easier to refactor into microservices if you truly need to in the future.

Don't think too far ahead; solve the immediate problems first. When you genuinely encounter the pain points that a monolith can't solve, then consider microservices. By then, you'll have the people, the money, and the experience, and everything will fall into place naturally.