Defining the internal architecture of our microservice
Imagine that after carefully analyzing, we decided to have a special microservice that’s responsible for working with account information and we called it the account microservice. Our account consists of an ID, account name, account type, account status, and account number. To track changes, we’re going to add createdAt
and updatedAt
fields.
The microservice approach has been applied to our whole project and now we have multiple services. However, the internal design of our concrete microservice depends on the requirements and it’s up to the team regarding which architectural pattern to apply. One of the most popular and classical architectural patterns in software development is Model-View-Controller (MVC). To make things simple and understandable, we will apply it to our microservice design.
MVC architectural pattern
The MVC architectural pattern is a popular choice for structuring Node.js APIs...