Nano , Micro and Monolith services in Serverless world
Introduction of Serverless architecture has made the integration and microservice application developers to look the design of their applications through a different perspective. Some of the design patterns that were considered in monolith and traditional microservice world are now by default tackled when your application is designed and developed using any Serverless provider and Kumologica runtime(API Gateway pattern , Distributed tracing etc).
Based on the feedbacks received from our users and lab works conducted, we have classified the applications under 3 major patterns. In this article we will be defining the 3 patterns, its pros & cons and how they are designed in Kumologica.
For those who are new to Kumologica I would recommend to go through our articles and youtube videos to get an insight.
Training & Certification
For a limited time, Kumologica offers free online certification for developers on https://training.kumologica.com/
Following are the 3 application definition patterns.
- Nano pattern
- Micro pattern
- Assort pattern
Design consideration of a serverless solution for integration and microservice is primarily around :
- Cold start
- Speed of provisioning and deployment
- Agile development capability
- Code maintenance
The above factors will in turn decides the overall performance and cost of the solution. The patterns are applicable for AWS lambda , Azure function and Google function.
Nano pattern
In Nano pattern each integration or microservice functionalities are isolated as seperate functions (AWS, AZure,Google). Each function deployed will have a single entry point which can be an HTTP based or any other trigger. . For our ease of understanding lets consider the endpoint as HTTP.
Pros
- Separate unit of function deployment. This achieves perfect separation of concern.
- Modify the application without impacting the whole solution.
- A perfect pattern for agile development model.
- The model of deployment is apt for independent teams allowing them to push the features independently.
- Single functions are easy to debug during development.
Cons
- Higher probability of cold start for functions as they are handling only single functionality. This will lead to drop in performance.
- Operational overhead due to large number of functions to manage.
- One full stack of the solution will have number of deployments which will lead to slower overall deployment of the solution. This is due to the time taken for the provisioning of each function and multiple deployment has to be done.
- The pattern requires strong support of naming conventions to be followed in order to have trouble free code maintenance.
Implementation
In order to implement this pattern in Kumologica you need to create multiple Kumologica projects with each project having single EventListener and EventListener End node.
Micro pattern
In Micro pattern, each integration or microservice functionalities are classified based on the data model associated with the service or based on the system that is shared. Each function deployed will have multiple entry point.
Pros
- Separate unit of function deployment but not with the level of granularity provided by Nano pattern. This is because in this pattern the service will mostly contain CRUD operation associated with a data model or set of operation associated with a particular system that will be re-used by other services.
- Better performance when compared to Nano pattern since multiple endpoints are clubbed together into single function. This makes the service to be invoked more often and hence the probability of cold start will be less.
- Operational overhead is very less compared to Nano pattern as the number of functions deployed are less to manage.
- Separation of concern is still achieved but not as same as provided Nano pattern.
- As the number of functions deployed are less, the speed of deployment of overall solution will be faster.
- Collaborative as well as independent development team model is possible in this pattern.
Cons
- Size of the function will be larger when compared to Nano patter as the the application included multiple endpoints clubbed together.
- Difficult in debugging since the there are multiple endpoints involved.
- Not offering the agile development flexibility as compared to Nano pattern
Implementation
In order to implement this pattern in Kumologica you need to create multiple Kumologica projects with each project having multiple EventListener and EventListener End node.
Assort pattern
In Assort pattern, the integration or microservice functionalities are not segregated or classified in any manner. The function will have endpoints with different set of functionalities with no relation to each other. The whole backend solution or part of the solution will grouped together into a single function. This application can be considered more or less like a traditional monolith service. This pattern is not recommended for microservice architecture. The function deployed will have multiple entry point.
Pros
- Better performance when compared to Nano and Micro pattern since multiple endpoints are clubbed together into single function. This makes the service to be invoked more often and hence the probability of cold start will be less.
- This pattern provides faster deployment when compared to Micro and Nano pattern as the number of functions deployed are less.
Note : The speed of deployment will also depend on the size of the application deployed.
Cons
- Separation of concern is not achieved in this pattern.
- Independent deployment is not possible as achieved in Nano and Micro pattern as multiple functionality is clubbed together in a single function.
- Identifying the performance bottle neck would be difficult when compared to Nano and Micro pattern.
- Not a good pattern for agile development when compared to Nano and Micro pattern.
Implementation
In order to implement this pattern in Kumologica you need to one or more Kumologica projects with each project having multiple EventListener and EventListener End node.
Conclusion
This article has shown different patterns considered in Serverless microservice and integration world. For Kumologica serverless developers, this will be a handy framework for design decisions.
Remember Kumologica is totally free to download and use. Go ahead and give it a try, we would love to hear your feedback