Setup your architecture for the future with microservices
In order to build a microservices architecture, one needs to have microservices first. But what are microservices? In its essence, microservices are small, autonom software applications that focus on doing one thing well. From a software application development perspective, they are nothing special. It is the school of thought that defines microservices - shaping their resulting scope and characteristics.
Thinking in microservices fights against the challenges and problems experienced by many organizations when developing monolithic applications. Even with good development practices in place, large monolithic codebases can make it extremely difficult to actively drive further development, incorporate new features and adapt to changes. Where do new features have to be implemented? Does similar functionality already exist? Which parts of the application are coupled and need changes? Development might become increasingly difficult and complex that large monolithic applications stagnate or even freeze in progress.
Microservices are small independent services that have service boundaries aligned with respect to business boundaries. These explicit boundaries keep them from growing out of their scope. Microservices are autonomous services which can be seen as independent entities. They can be developed and deployed independently from each other. This results in many and diverse benefits, which have their foundation in distributed systems. Key benefits include:
Every microservices can potentially use a different technology. Thus, it is possible to pick the right tool for each job, adopt or try technologies more quickly, or optimize services as required.
Performance issues can more easily be identified and resolved, faults are better isolated and the risk of application downtime is reduced.
Services can be scaled independently, which makes it possible to respond to changes in demand specific to certain parts of your application.
Microservices are focused on one specific task within the application. This makes it easier for developers to familiarize themselves with services, understand them more quickly and contribute with code changes. Furthermore, tasks can be divided among development teams. Both decrease the time needed for changes, features or bug fixes to reach your customers.
Now we have seen and understood the benefits of microservices and are keen to get started. But how do we structure software applications into small, autonomous services? What do we have to consider? Two key aspects of what makes a good microservice are loose coupling and high cohesion - two aspects which are highly related to the overall architecture we are aiming for.
Loose coupling means that changes within one service do not require other services to be changed, too. Thus a service should know as little as possible about services it communicates with, or only as much as required. We do not want to have chatty communication between services as it increases their coupling. High cohesion allows us to condense behavior within one service - and one service only. Changed application behavior should result in changes in one microservice. Again we do not want to be forced to change more than one service at a time to deliver changes in application behavior.
To achieve loose coupling and high cohesion, it is important to get the service boundaries right. Easier said than done. Service boundaries are dependent on the overall structure, service offering and goal of an organization. Boundaries of a microservice have to respect and consider existing services. Moreover, boundaries will shift, services will be replaced, splitted or completely removed. Change is inevitable. Not every microservice boundary will turn out to be perfect. With microservices, however, you have the flexibility to react and adopt. We at Blueshoe can support you with our knowledge and experience on getting started with microservices.
Setting up our customer projects according to the cloud-native approach helps us to develop complex systems quickly and efficiently and to implement short, efficient release cycles. The following projects are a small excerpt from our past cloudnative projects.