System Design

Ok, we want to build a software product, but where should we start?

Well, let's first think about what features do we want to support and what is the expected scale. This gives us a long list of questions to answer.

Scope

Scale

Layout

After clarifying the scope and scale of the system, we move on to sketching out the system layout.

An intuitive and straightforward way is to create one single application that handles the end-to-end workflow. This tightly coupled structure leads us to the monolithic architecture.

Monolithic

A monolithic system is built as a single, indivisible unit. All components of the system are tightly coupled.

Because the components reside in the same place, it has several benefits:

This architecture well fits use cases like building a prototype. However, as time goes by and the application grows bigger in terms of number of features and users, certain drawbacks gradually emerge:

These downsides bring us to another architecture, microservice.

Microservice

A microservice architecture breaks down the application into small, loosely coupled and independently deployable services. Each service is responsible for a specific business functionality and communicates with other services through APIs. This is also known as a distributed system.

The microservice architecture addresses some of the pain points of the monolithic architecture:

However, just like a coin has two sides, the microservice architecture overcomes the monolithic architecture's shortcomings, but struggles to match the monolithic architecture's strengths:

Hybrid

We can also use a mixture of both. Imagine these two architectures are the two ends of a spectrum, and we can choose somewhere in between. We can apply the microservice architecture to components that need availability, scalability, or flexibility, while grouping others into a monolithic system.

Comparison

When choosing the architecture for our system, it all comes down to the question: which set of metrics matters to us?

If our product needs high availability, scalability, or flexibility, we probably want something closer to the microservice architecture, otherwise, something similar to the monolithic architecture is probably a better choice.

Next step

Once we have decided how we structure the application, we can go ahead with the development cycle.

See also

←Previous Next→