Scalability and cost optimization with Container Services

by Walter Dal Mut, Solution Architect @ Corley.it

Walter Dal Mut

github.com/wdalmut

twitter.com/walterdalmut


https://corley.it

Monolith

Easy to manage and easy deployments

Hard to handle workloads, hard maintenance, hard life for development team

The technical debt increase quickly over the time (big legacy)

(auto) scalable environment

KPI scalable systems

Easy deployment strategy.

Cost Saving on resources

The technical debt increase quickly over the time (big legacy)

Hard maintenance, hard life for development team

The application scale out completely and we cannot achieve the "scale per feature" goal

Distributed System in classical environments

KPI (distributed) scalable systems

Easy deployment cycles

cost-per-feature (scale out per service)

scale out also the development team

So many different environment and so many infrastructure devices (balancers, etc)

Related costs for high availability increases quickly

Technical debt and legacy managment remains an issue

Cluster for web applications

KPI Cluster

  • We can scale the development team
  • Easy and stable deployments
  • Reduced infrastructure costs
  • Costs for high availability under control
  • Few infrastructure parts

  • We have to manage the cluster
  • Legacy and technical debt (reduced for microservices)

Power resources

Power resources

Power resources

Power resources

Power resources

Power resources

Container

Lightweight, isolated environment for our application

Dedicated networking for our applications

CAP - limits for resources (CPU, RAM)


docker run \
    --cpu-shares 48 \
    --memory 32M \
    --network app1 \
    ubuntu:16.04 \
    ls -las
                        

Infrastructure challenges

  • add more microservices easily
  • (auto)scale microservices
  • handle constaints for microservices
  • release microservice updates easily

AWS ECS

Elastic Container Service (orchestrator)

create a playground for microservices with ECS clusters

  • Create an Application Load Balancer that proxy all microservices
  • AWS Certifcate Manager to support HTTPs for microservices
  • Prepare an autoscaling group that wrap an ECS cluster
  • Every microservice is an ECS Service (Docker containers)
  • Autoscaling group per service that scales inside the cluster
  • Other interesting things...
    • Create batch jobs
    • Create scheduled jobs

Playground for microservices

Microservice Entrypoint on ALB

  • Create a Target Group in the Application Load Balancer
    • Rule on: Path
    • Rule on: Domain Name

Docker label/constraints for microservices

  • Dedicated resources for microservices
  • Different autoscaling groups

Docker Constraints

Release microservice updates easily

  • Docker Images on ECR (Elastic Container Registry)
  • Deployment options with ECS Deployments
    • Minimum active tasks during deployments
    • Maximum active tasks during deployments

Min: 100% -> Max: 200%

How to deploy and manage so many services?

Continuous Delivery

Achievements

  • Service oriented architecture
  • Small applications (simple replacements) - microservices
  • Small development teams (engage different suppliers)
    • Working In Parallel
  • Dedicated languages per microservices
  • Resources optimization per services
  • Speed-up deployments
  • Managed infrastructure with ECS (focus on app development)

walter.dalmut @ corley.it