Essentials tools for Microservices Architecture

Muneeb Ahmed
4 min readApr 15, 2019

--

Microservices are one of the latest architecture in software development and hot topic in the industry. Since microservices are purely based on a distributed architecture. With the distribution of the business domain using domain driven design Microservices can evolve quickly in a short period of time. For that, we need to consider some useful tools that can save our time in production and give us clear visibility of the system.

Containerization

Containerizing a service is essential to Microservice architecture as it saves the time of deployment and improves release lifecycle. An engineer is responsible to write container related scripts that boost deployment lifecycle. Kubernetes are one of the best ways to containerize your application in production. They are mature and will give you the ease of deployments with bare minimum efforts.

Monitoring and Alerting

Without proper monitoring, we will suffer in finding the root cause of the problem in the large distributed system. If we have proper monitoring we can use them to create alerts for the system. In critical flows, we can even generate a phone call to the stakeholder of that service. There are several tools in the market are mature and we can use them based on your needs. e.g Graphana, Newrelic e.t.c

Example Graphana stats

Distributed Tracking

To fulfill 1 request Microservices communicate with each other. Since this communication happens within certain nodes via rest protocol or Kafka depends on the need. It's essential to keep track of where the request fails and which helps in debugging. There are few tools which we can use to observe traffic, control flow using a circuit breaker and use them as a service mesh. My personal favorites are istio and Kiali. Combining them we can observe our system request flow and monitor where is the actual fix or improvement needed in a system e.g throughput enhancements, Bad Gateway, Bad request, contract mismatch e.t.c

Sample Dashboard

Application Logging

One of the key factors we suffer while debugging something is lack of logging. Especially in a big distributed system, we should define the right mechanism of logging. In our company, we build a common object of logging and everyone uses that to log in their application. These logs are then pushed in logging system e.g Elastic Search, logz.io e.t.c with a separate index of each application name. If needed infrastructure related logs can be streamed to index as well.

Sample app logging

Deployment Pipeline

If you have containers but no deployment pipeline you will suffer in the delivery lifecycle of the project. Make sure to have a deployment pipeline set for your staging, development and production branch from version control. Deployment pipeline should have tests scripts inside it that make sure the new version is stable. In our current system, we use Jenkins for deployment purpose. We also use infrastructure as code which is super helpful in deployment pipeline and managing infrastructure as code.

Jenkins sample builds

Communication

Microservice communicate via Rest protocol. Rest is not a good approach when your system started to scale and need to communicate more over the network. Then comes a need of data pipeline and messaging system. A simple publisher-subscriber model that fulfills our need data to send and read asynchronously without thread blocked on network calls. Based on company-wide skillsets, needs and requirements we can use Kafka, Rabbitmq e.t.c. We are using Kafka because we want horizontal scaling and multi consumption of messages by multiple services.

Kafka architecture helps you understand messaging

Above are the tools which I believe are essentials for Microservices architecture.

--

--

Muneeb Ahmed

Software Engineering Lead. Flying between leadership, self development, fitness and technology.