Along with their pros and cons, microservices are gaining popularity these days. With more and more people using this concept, there can be new problems, new patterns to implement microservices, and new demands from microservices on the table. Those demands and common problems will give the direction or lead the future of microservices.
Increasing the number of microservices in the organization also increases the DevOps work. DevOps has to deal with problems such as lots of deployment pipelines, log handling in a centralized place, monitoring service and server attributes, self-healing script, and so on. With a DevOps mindset, developers have lots to do other than only developing business logic. With an increase in DevOps effort, microservices could lead us in two directions:
- Serverless architecture
- Microservices as PaaS
Serverless architecture, with certain offerings from different cloud providers, doesn't seem too far. For instance, AWS has an incredible feature named Lambda function. Typically how it works is a bunch of code stays in your S3 environment as a ZIP file. Whenever a specific event is triggered, a new instance is created with predefined parameters. This particular piece of code is copied from a specified location to the new instance, and this code starts running. After finishing its job, the instance will be shut down again. With service discovery pattern, this whole concept becomes very interesting. In this type of environment, services will be coming up and down as per demand. Each new upcoming service will be registering itself and deregistering itself on going down, and it uses discovery protocol to find the service with which it needs to communicate.
The above mentioned architecture doesn't give the whole solution for serverless architecture, for instance it doesn't explain the versioning of services, how to deal with latency time, which new on demand services take to coming up for a new HTTP request and so on. The boot up time of the instance and services will be crucial in this scenario. Evolving of these type of component like Lambda from cloud providers, can lead future to server less components. Developer will be focusing on the development of business component. DevOps work will be lesser in this case.
Microservice as PaaS can be another future direction. Microservices will be delivered as Platform as a service (PaaS). With containers such as packer or Docker in place, this also seems to be feasible. In this scenario, microservice will be shipping with frameworks that do most of the monitoring, logging, and registering a service mechanism, common library, load balancing, versioning, and similar kind of features in itself. Containers are in place leading microservices in somewhat of the same direction. They can be seen as a framework, coming with all the monitoring, logging and so on already in themselves. Developers have to worry less about for all that stuff.
As containers become more mature and cloud components evolve, we can see the merging of both directions into one in the long run.