There are thousands of definitions out there about what are microservices, but the one I like best is that of the great master Martin Fowler
In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies.
James Lewis and Martin Fowler
This is a whole environment of a Microservices Architecture. Here you can find the implementation of a lot of "fancy" patterns like CQRS, Distributed Lock, Domain Events, etc.
git clone git@github.com:juliofalbo/complete-microservices-env.git
./build.sh
./start.sh
Note: If you want to build and run just call ./start.sh --build
./stop.sh
./stop.sh --remove-volumes
Application | Port |
---|---|
Booking Microservice | 8100, 8101, 8102 |
Searching Microservice | 8200, 8201 |
Financial Microservice | 8300 |
Frontend Microservice | 8400 |
RabbitMQ | 5672, 5673 |
RabbitMQ Admin UI | 15672, 15673 |
Booking Postgres Master | 5432 |
Booking Postgres ReadOnly Replica | 5433 |
Financial Postgres | 5434 |
Grafana | 3000 |
Prometheus | 9090 |
Splunk | 8000 |
Netflix Eureka | 8761 |
Zipkin | 9411 |
In the root folder we have a file called CreateBookingConcurrencyTest.jmx
. So, this is a JMeter that can be easily imported and the only thing that you should do is change the room id
for the tests.
With this test it is possible to see that the booking service is queuing the requests based on the distributed lock on Redis and treating the concurrency issue.
By default, we already have 6 dashboards showing the metrics from Spring Boot Apps, Postgres, RabbitMQ, Redis and Zipikin.
The dashboards are:
When you try to access Grafana it will ask you to log in and the credentials are:
If you want to change it, just change the value of the env vars GF_SECURITY_ADMIN_USER
and GF_SECURITY_ADMIN_PASSWORD
in the Grafana's Service on docker-compose-infra.yml
.