Switching to microservice architecture will solve all of your software architecture problems.
Right? Okay, it won't. But there is value to be found in the journey.
Hüseyin Babal recently made the point the a microservices based architecture would not solve all problems. However, it is a solid move to modernize your infrastructure. We all know the challenges of sustaining a monolithic architecture over many years, so we seek new alternatives to sustainability, flexibility, and ease of integration. Implementing microservices architecture with a foundation of best practices can drastically improve your software architecture.
Hüseyin is a Chief Software Architect at Aurea and consults for Kloia. His recent talk, Ultimate Guide to Microservice Architecture, covers much of the experiences he works through each day and presents best practices to implement microservice architectures.
In his talk, he uses Spring Boot for application development, Consul for service discovery, Elasticsearch & Kibana for Monitoring, and Docker & Jenkins for Continuous Delivery. He covers each, including numerous code examples, with ten best practices.
Realize the benefits (nay, the glory) of REST APIs. Looking at Leonard Richardson’s Maturity Model, there are four levels of using REST. You can start a level 0, which is soft resources, using one endpoint; then Level 1, which has different resources, but has the same HTTP method; Level 2, which uses different HTTP methods, such as POST, PUT, DELETE, etc.; finally, Level 3 - you have navigational resources on your API responses. Behold, the glory!
Using Spring HATEOAS. This helps you use navigable, restful APIs.
Use distributed configuration so you aren't configuring 50 different configurations one at a time. Consul can be used to keep config at Key/Value.
Client code generation. Hüseyin suggests, "either using Swagger to generate your client code on any supported language or use feign client with a little annotation and client side load balancing with Ribbon."
Continuous Delivery. Hüseyin walks through some examples using Jenkins and Docker.
Monitor. In fact, monitor everything.
Logging. Hüseyin points out there are numerous Docker log drivers. He walks through examples with GELF (Graylog Extended Log Format).
APM - Application performance management. This collects extra details to help you troubleshoot issues. Zipkin is an open source option Hüseyin walks through.
API gateways to aggregate data to specific clients.
Event sourcing and CQRS (Command and Query Responsibility Segregation). A Command alters the state of an object, but does not return data. A Query returns data, but does not alter the state of the object.