AI Hints
Home›System Design Tutorial›Services and Timeouts
System Design · Lesson 76 of 120

Monolith vs Microservices

One or many.

⏱ 2 min read▶ Video at 1:31:29🎓 Free
Watch this lesson in the System Design courseWatch on YouTube ↗Full System Design course

Shoply began as one application, a monolith. All the code, products, orders, and payments, lived in one program. Many big companies have split their monoliths into microservices. Should Shoply?

Monolith vs Microservices
From the video: Monolith vs Microservices
  • One program: a monolith
  • Many companies split
  • Should Shoply?

Two architectures

A monolith is one program, deployed as one unit. It's simple to build, test, and run, and calls between parts are fast. Microservices split the system into small services, each owning its data, and talking over the network. Teams can work and deploy independently, but every network call can fail.

Monolith

  • One deployable unitSimple, fast callsHarder for big teams

Microservices

  • Many small servicesIndependent teamsNetwork calls can fail

A sensible path

Most experienced engineers suggest a path. Start with a well organised monolith, with clear modules inside. Split out a service only when there's a real reason, like a part that needs to scale differently, or a team that keeps blocking another. Microservices solve team problems more than technical ones.

keyvalue
Starta modular monolith
Split whena real reason appears
Good reasonsscale, team independence
Remembernetwork calls fail

Summary

A monolith is simple, and microservices let teams move independently, at the cost of network complexity. Start with a modular monolith. Next, how services find each other.

Key takeaways
  • Monolith: simple
  • Microservices: independent
  • Split with a reason
Next up: Service Discovery — finding each other