Migrating Applications to a Container-Managed Microservices Architecture
This is the second article in a four-part series that discusses the benefits of adopting a microservices architecture (MSA) for new applications. Here we focus on the use of containers for microservices and the orchestration tools to manage the containers.
Orchestration of services across platform domains
Modeling is done independently of the container platform and independently of how the service is orchestrated.
Orchestration tools manage how multiple containers are created, upgraded and made highly available. Orchestration also controls how containers are connected to build sophisticated applications from multiple microservice containers.
Benefits of container orchestration in a microservices architecture
Container orchestration is all about managing the lifecycle of containers, especially in large, dynamic environments. The orchestration engine is a set of programs to create, run, execute and manage containerized applications.
Software teams use container orchestration to control and automate many tasks, including:
- Provisioning and deploying containers
- Managing the redundancy and availability of containers
- Scaling containers up or down so the application loads evenly across the host infrastructure
- Maintaining a consistent deployment environment across the cloud or on-premise
- Allocating resources between containers
- Managing external exposure of services running in a container with the outside world
- Service discovery, container networking and load balancing
- Container health monitoring and reporting
- Managing the container lifecycle
Microservices architecture shortfalls
There are many challenges companies must be prepared to address as they transition to an MSA. Here are nine:
- Microservices are complex.
- Microservices are expensive because they require more hardware.
- Microservices need to communicate with each other, which results in a high volume of remote calls. This can increase network latency and processing costs beyond what you might expect to pay when using traditional architectures.
- Managing microservices can be stressful, given the transactional management model and the need to use multiple databases.
- Deploying microservices can be complicated.
- Microservices can pose security challenges.
- Spinning up the environments is costly and complex due to the increased number of resources required.
- Large numbers of microservices are challenging to secure.
- Message flow increases with the number of microservices, which hinders performance.
Alternatives to container orchestration
Kubernetes may be the de facto leader in container orchestration, but it’s worth exploring alternatives before taking the plunge. Kubernetes has a steep learning curve, which means it could be costly. (See Figure 1.) Here are two Kubernetes competitors to consider:
- Docker Swarm. A hardy bit player, Docker includes a swarm mode for natively managing a cluster of Docker engines. Docker CLI can be used to create a swarm, then deploy application services to a swarm and manage swarm behavior. The main features of Docker Swarm include:
- Cluster management integrated with Docker Engine
- Decentralized design
- Declarative service model
- Desired-state reconciliation
- Multi-host networking
- Service discovery
- Load balancing
- Secure by default
- Rolling updates
- Apache Mesos and Marathon. Apache Mesos is an open-source cluster manager that allows effective resource sharing between applications. Marathon is a Mesos framework for container orchestration.Complex but flexible, Mesos is the opposite of virtualization because, in virtualization, one physical resource is divided into multiple virtual resources. Instead, Mesos includes numerous physical resources in a single virtual resource.Mesos is suited for the deployment and management of applications in large-scale clustered environments. It brings together the existing resources of the machines or nodes in the cluster into a single pool from which various workloads can access. Also known as node abstraction, this process removes the need to allocate specific machines to different workloads.Companies such as Airbnb, MediaCrossing, Xogito, Netflix and Categorize use Mesos to manage their significant data infrastructure.The main features of Mesos include:
- Web UI to monitor the cluster state
- Multi-resource scheduling
- Fault-tolerant replicated master using ZooKeeper
- Scalability to thousands of nodes
- Isolation between tasks with Linux containers
Figure 1. Strengths and Weaknesses of Three Open-Source Container Cloud Orchestration Solutions
Source: DZone and Kubernetes
Cloud-based container orchestration platforms
There are three leading cloud-based platforms to consider for container orchestration: Amazon Web Services (AWS), Microsoft Azure and Google Cloud Platform (GCP).
Here is a brief comparison of the three platforms. (See Figure 2.)
- Amazon Web Services Elastic Container Service for Kubernetes (Amazon EKS) is a managed service that makes it easier to use than Kubernetes. EKS integrates with open-source Kubernetes tooling and AWS tools, including Route 53, AWS Application Load Balancer and Auto Scaling. Team members that manage Amazon EKS are regular contributors to the Kubernetes project.
- Azure Kubernetes Service (AKS) is a management solution used to deploy and manage containerized applications. It offers serverless Kubernetes, a continuous integration and continuous delivery (CI/CD) experience and enterprise-grade security and governance. AKS helps to build applications more extensible.
- Google Cloud Kubernetes Engine (GKE) is a managed, production-ready environment for deploying containerized applications. Like Amazon EKS, GKE is an easy to use cloud-based Kubernetes service that provides an efficient and reliable environment for applications.
Figure 2. Cloud-Based Orchestration Comparisons
Source: Sumo Logic
Altran’s top four best practices for optimizing container orchestration
- Create a clear plan from development to productionAltran suggests implementing a DevOps practice, which will help build monitoring and gives all developers access to pre-production environments and running automation tests in build environments.
- Institute robust monitoring and automated issue reportingAltran suggests using APM/IT monitoring tools with good reporting capabilities, which will allow you to automate the creation and sending of reports.
- Ensure data is backed up automatically to enable swift disaster recovery and business continuityThe backup processes copy data and then store it on different media or in a separate storage system that allows easy access in a recovery situation. Altran provides the expertise to build the solution.
- Create a roadmap for long-term expansion of production capacityAltran guides its customers to build strategies for their solutions.
Connect with a Container-Managed Microservices Architecture expert today.
- Part 1: How to Migrate Applications to a Container-Managed Microservices Architecture
- Are you ready for the microservices shift?
- Understanding microservices architecture nature’s way
- Is cloud native architecture the best fit for 5G?
List of website sources:
- Swarm Mode Overview, Docker, https://docs.docker.com/engine/swarm/
- Docker 1.12 and Swarm, SlideShare, https://www.slideshare.net/WesleyCharlesBlake/docker-112-and-swarm-mode
- Mesosphere/Marathon, GitHub, https://github.com/mesosphere/marathon
- Docker Datacenter, Webopedia, https://www.webopedia.com/TERM/D/docker-datacenter.html
- Introduction to Apache Mesos, DZone, https://dzone.com/articles/introduction-to-apache-mesos
- Mesos Architecture Overview, Pinterest, https://www.pinterest.com/pin/326511041725215841/
- Kubernetes Components, Kubernetes, https://kubernetes.io/docs/concepts/overview/components/
- DevOps: Container Based Software Deployment and Orchestration, Teknofage, https://medium.com/@teknofage/devops-container-based-software-deployment-and-orchestration-3e84003dff2d
- Open Source Datacenter Computing with Apache Mesos, Opensource.com, https://opensource.com/business/14/9/open-source-datacenter-computing-apache-mesos
- Managed Kubernetes Clusters, AWS EKS Features, https://aws.amazon.com/eks/features/
- What is Kubernetes?, Microsoft Azure, https://azure.microsoft.com/en-us/topic/what-is-kubernetes/#beyond-kubernetes