Microservice Architecture
Microservice Architecture
application to — be it
public cloud or private data center. Application designed in this way can best make use of offers provided by the cloud.
The first step in that direction is building micro-service based applications and run them in containerized and orchestrated
platforms like Kubernetes.
Following are the design principals one should consider while creating Cloud applications.
Microservices
Applications are created as micro-service so one can make use of best language, frameworks and tools suitable for
different applications. Let’s say we can build real-time applications using Nodejs, REST applications using Spring-Boot or
Dropwizard and ML applications using python.
Tools
Service mesh
API gateway
Serverless architecture
Monitoring tools: with microservices spread across your on-premises and cloud infrastructure, being able to predict,
detect, and notify issues related to the health of the system is critical. There are several monitoring tools available, such as
New Relic, CloudWatch, Datadog, Prometheus, and Grafana.
Log consolidation tools: microservices can easily increase the number of deployment units by an order of magnitude. We
need tools to consolidate the log output from these components, with the ability to search, analyze, and generate alerts.
Popular tools in this space are Fluentd, Graylog, Splunk, and ELK (Elasticsearch, Logstash, Kibana).
Tracing tools: these tools can be used to instrument your microservices, and then produce, collect, and visualize runtime
tracing data that shows the calls across services. They help you to spot performance issues (and sometimes even help you
to understand the architecture). Examples of tracing tools are Zipkin, Jaeger, and AWS X-Ray.
DevOps: microservices work better when devs and ops teams communicate and collaborate more closely, from
infrastructure configuration to incident handling.
Blue-green deployment and canary releasing: these deployment strategies allow zero or near-zero downtime when
releasing a new version of a microservice, with a quick switchback in case of problems.
Infrastructure as Code (IaC): this practice enables minimal human interaction in the build-deploy cycle, which becomes
faster, less error-prone, and more auditable.
Continuous delivery: this is a required practice to shorten the commit-to-deploy interval yet keeping the quality of the
solutions. Traditional CI/CD tools include Jenkins, GitLab CI/CD, Bamboo, GoCD, CircleCI, and Spinnaker. More recently,
GitOps tools such as Weaveworks and Flux have been added to the landscape, combining CD and IaC.
Externalized configuration: this mechanism allows configuration properties to be stored outside the microservice
deployment unit and easily managed.
Consider resources as immutable infrastructure where once application is deployed, it never gets updated instead new
resources are provisioned for each deployment which can greatly improves consistency of application
deployment/rollback.
It’s trade off between operation cost of managing it and using managed services. You can always use many open source
managed services offered by cloud and for others you have to decide based on operational costs.
Elasticity is the ability to use resource dynamically and all cloud providers offer it as pay as you go model. It solves
problem of over-provisioning of resources for applications deployed in traditional data center.
Stateless
Stateless applications maintain states outside of application in database or other external entity so nodes can be
added/removed dynamically and applications can be deployed without worrying about state. Application components also
should be stateless as stateless components can be easily scaled, repaired, rolled-back and load balanced. Scalability can
be achieved easily by designing stateless applications.
Loose Coupling
Loosely Coupled architecture reduces inter dependency between application components so one failed component does
not impact the whole application.
Service Discovery
Asynchronous Communication
Resiliency should be at the core of any architecture and you should practice it from the start when designing any
application.
Resilient applications offer High Availability and Disaster recovery using load balanced clusters, multi-region deployments,
replication, continuous monitoring.
Security
Application component should communicate with each other using well defined authentication method without thinking
whether it’s internal service or external service to avoid any security vulnerability
Automation
Last but very very important is we should strive for automation in every part of application development, build,
deployment, monitoring, etc …
Infrastructure Automation
Infrastructure automation can be achieved by provisioning infrastructure using tools like Terraform, Serverless,
Cloudformation etc..
CI/CD Automation
CI/CD pipeline greatly reduces manual efforts and help in automating everything from build, test, package and
deployment. There are various tools like Jenkins, Spinnaker, Code pipeline, etc…
Auto Scaling
Automating scale up helps application availability during peak load and scale down reduces cost when application are not
used heavily. Sometimes you can scale down to 0 for internal applications which are used rarely to further reduce costs.
Monitoring
Centralized logging and monitoring greatly helps in maintaining services in healthy condition and it should be automated
using different tooling so if any issues can be detected quickly and fixed.
Backup
Have Automated backup solution in place so data can be recovered quickly without much loss of data.