There is no universal answer to the question How small does a microservice have to be? The general consensus aligns itself with the following characteristics of a microservice (in no particular order):
- The size of the source code should be smaller than that of the service in SOA architecture.
- One development team should be able to support several microservices, and the size of the team should be such that two pizzas are enough to provide lunch for the whole team.
- It has to be deployable and independent of other microservices, assuming there is no change in the contract (that is, the API).
- Each microservice has to have its own database (or schema, or set of tables, at least) – although, this is a subject of debate, especially in cases where several microservices are able to modify the same dataset; if the same team maintains all of them, it is...