When I started research on building microservice architecture with completely opensource software, I established the following as key guiding principles:
- Opensource technology stack, which is proven & battle-tested for production systems
- Applying API Gateway pattern for Microservices
- Wider developer community support with active support (in case there are issues or troubleshooting needed)
- Good documentation with easily accessible learning material
These principles helped me to choose the technology stack, which has been outlined in the next section.
|Spring Cloud Gateway
|As API Gateway with support for handing cross-cutting concerns such as security, monitoring/metrics, and resiliency
|For microservices development
|For observability with dashboard and visualizing monitoring metrics like system CPU, memory, disk and I/O utilization, etc.
Datasource added for visualization:
Prometheus, Jaeger, Loki
|For capturing data metrics & alerts with time-series data
|For identity and access management (opensource)
|For end-to-end distributed tracing
|For fault-tolerance management (similar to Netflix Hystrix but lightweight)
|For Logs Management built at Grafana Lab.
Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheuss.
|For container orchestration, deployment, scaling and container management
This led me to create a simple microservices oriented application implementing the following use-cases:
- 3 or more microservices as per business domain (applying domain-driven design – didn’t name microservices to keep it open)
- Authenticated application secured with Login flow (with token generation & validation)
- Service routing to the intended microservice
- Managing non-functional aspects such as caching, monitoring, distributed tracing, logging, etc.
- Deployment steps followed in detail available by clicking here.
- Kubernetes YAML configuration files are available by clicking here.
- Microservices are referred as: ms-1, ms-2, ms-3
To conclude, it was an interesting journey with a great learning curve putting these technologies together to build a completely opensource based microservices architecture. Feel free to share your comments.