- Published on
Identify Monoliths, microservices and serverless
- Authors
- Name
- Khánh
Introduction
Technology terminology evolves over time. There are concepts that get stuck in the past, not everyone keeps up with what you interpret, or sometimes concepts get carried away by misconceptions.
Monoliths
In addition to scaling vertically, a monolith can also scale horizontally.
If multiple applications must be redeployed simultaneously whenever one component changes, it's not microservices but rather distributed monolith.
A simple web app is a multi-component system. Even the simplest monolith consists of UI → Web server → Application → SQL/NoSQL.
What defines it as a monolith?
- Not the number of repositories it has.
- Not the number of containers it has.
- Not the number of lambdas it has.
- Not the number of teams it has.
Microservices
Running a database per service can be costly and challenging to maintain in a microservice system.
If multiple applications share the same data, they are not microservices. Each microservice manages its own type of data.
There are various ways to logically separate data in databases, including logical databases, namespaces, and tables.
What defines it as a microservice?
- Not the number of repositories it has.
- Not the number of databases it has.
- Not the number of lambdas it has.
- Not the number of teams it has. Loose coupling and high cohesion define it as a microservice.
Serverless
Serverless is not about using AWS Lambda or Google Cloud Functions for on-demand built or FaaS.
The key aspects of serverless are:
- No need to manage a specific server
- Scaling based on demand, where charges apply only when there are requests
- Focus primarily on product development
- S3 is serverless storage
- Monoliths, microservices, databases, storage, API gateways, event buses, and even complex software like machine learning models can be serverless.
What defines it as serverless?
- Not where it's built.
- Not if it uses functions.
- Not if it uses containers.
- Not how many APIs it exposes. The abstraction of infrastructure management defines it as serverless.