A very common approach when using microservices is to use a event-based architecture to enable your application to scale better.
In this repository, I include some resources to show how easy is to jump from a small problem to a microservice approach.
In the basic example, there are two files:
- publish.js
- subscribe.js
These examples were taken from the official documentation of RabbitMQ.
The publish.js
file will act as a producer and the subscribe.js
file will act as a consumer.
Click here to see more details.
In the microservices approach, I include a basic folder structure that has a simple architecture including an API layer and a Service layer.
Each of those services include the proper docker configuration to deploy the services.
Click here to see more details.