This post will focus on what Microservices are, why is it so famous these days, what are the positive and negative aspects of these services and what all area we will try to cover in future posts.
In addition, will share few youtube links, which are quite helpful to understand this concept. As a developer, I will say it is just one of the way how well we are packaging or modularizing code.
First of all, I would like to tell you, that I am inclined toward MicroServices, so most the things you find here will kind be in favor of these.But I will discuss all the challenges which you might face when you try to follow the awesome journey of MicroServices.
What is Micro Service?
Rather than going for a definition we will try to find the what are the common characteristics of Mirco Services.
In simple terms, you can think of a very small independent project capable of performing all the task.So If in a monolith you have various responsibilities, let each of this responsibility as a separate service.What responsibility does not have any concrete boundary. So this lets to the rise of the new question, how big or how small the micro services should be.Some people says it should be small enough to be handled by one developer, some say it should not be more than then few hundred line of code.To solve this, we will term service as a micro service if they have few of the properties/characteristics mention below.
Characteristics of MicroServices
- Can be upgraded or rewrite independently.
- Have fault tolerance and monitoring mechanism.
- Each service is a complete Product.
- Should have their own Data Management.
- Should be easily replacable.
- Should only expose the endpoint to dependendant services.
What a fuss is this, and Why is it becoming so popular these days?
As we all know that it is simple to solve number of small problems and then join all of them to solve the bigger problem.What we call is devide and conqure. Only problem in this approch is we need a very good merger technique to have a successful solution.With Devops of today(Docker,Kubernets,Mesos) it have been made possible to developer to manage large number of services and there deployment.Even it has helped to increase the resource utilization , which have further decreased the cost of maitaining multiple services.
- It break the problem into smaller problem, helping developer to solve it more accuratley and in most optimized manner.
- Partial Deployment and Partial Upgradation of Application is possible.
- Help to reduce the develoment time.
- We can easily rewite any service .
- Services can be written in any programming languages , and we can easily try new progamming language.
- Easier to find and fix bottleneck in the system.
- Maintainance and Bug fix can be simper.
- Test scope increases as we have to test smaller units independently.
- CI/CD can be implemented easily.
- Preserve modularity.
- It increases the Devops activities.
- Organization have to monotor and handle large number of sevices.
- Service Discovery and trackng of request can be tidious task.
- Need change in Oraganization culture.
- Developer have to work more closely with devops , in order to make the development more stream line.
- Need advance Devops.
- Since it is kinda a new, not every one have clear idea what is a baoundary of MiroService.
Some Great Videos to give more insight.
Topics to be cover in upcoming blogs
- Modules vs Microservices
- How to share domain between different micro services
- Should we have a common DAO[Database ] layer for every service or each service should have their own DAO layer?
- All micro services in single Git Repo or they should have separate Git Repo
- How to do monitoring of Micro Services.
- How to track the flow of any particular request in real time between services.
- Containerization of micro services.
- Creating an environment of Containerization service, which is self-deployed.
- When to go for Micro Services.
- How to shift from Monolith to Microservices.
- How to perform Integration testing involving couple of Microservices as dependencies.
- Distributed logging for Services.