Authors: Sasikumar Arjunan – Senior Developer @ Cloud Kinetics, Vidyashankar V – Systems Engineer Trainee @ Cloud Kinetics & Kaliyappan P – Systems Engineer @ Cloud Kinetics
MICROSERVICES is the most popular buzz word in the field of software architecture these days. Microservices architecture is an approach of breaking single large monolithic applications into individual components running its own process with light weight mechanisms. Micro service architectural pattern is appreciated due to its special features including loosely coupled architecture, light weight and the resilience from failure.
Building applications in micro service pattern have gained quite some popularity among developers right now. Containerizing application is the greatest tool that adopts Microservice architecture. It is a lightweight contrasting option to full machine virtualization that involves epitomizing an application in a container with its own operating environment. The main purpose of containerized applications is to improve the efficiency of software teams, making it easier for people to work together while lowering the communications overhead.
Docker being the leader in containerizing applications have attracted many microservice based applications to make use of their technology for building, running, and shipping applications.
Though there are many providers of Container Management service, AWS ECS (EC2 Container Service) is the top player in this category. ECS is a highly scalable container management service which supports Docker and allows us to run applications in a cluster of Amazon EC2’s.
Deploying Micro Service Application in ECS:
Several components available in ECS are Clusters, Task definitions and Services.
1. Clusters are logical grouping of Ec2’s, where containers are placed.
2. We can configure our application in task definition (Memory, CPU units, Docker image to be used etc.) Task definitions are used for defining configurations and environment for the containers.
3. Services are used for deploying, running and scaling containers in ECS.
LOAD BALANCING IN ECS:
ECS supports both ELB (Elastic Load Balancing) and ALB (Application Load Balancer) features for load balancing traffic to application components. ALB is a new item in the plate for AWS which supports path based routing, a handy feature that helps load balancing across multiple services in ECS. In this approach, only one ALB is used to route traffic to multiple application components. By using ALB in ECS dynamic port (Automatic host port assigning) mapping can be used. In case of ELB users have to manually assign a host port to the container.
In ECS, application has an option to scale, based on the load that acts as bottle neck to it and underlying resource can scale based on the availability to provision the scaling application.
Two vital components to be considered:
Service Auto scaling: Used for scaling Application services.
Cluster Auto scaling: Used for Scaling Underlying Resource (EC2 Instances).
The usage of containers in implementing microservices architecture is an evolution driven by the need to make better use of compute resources and to maintain increasingly complex web based applications.