RousselTMLEARNING

TP · Cloud Computing: From Discovery to Expertise

Lab: Elasticity and high availability with Docker Compose

What you will learn in this TP
  • Vary the number of instances
  • See load distribution
  • Check fault tolerance

Horizontal scaling #

What you will learn in this section
  • Vary the number of instances
  • See load distribution
  • Check fault tolerance

Context. The site must withstand a traffic spike then return to an economical size afterwards. That is elasticity: you simulate it by adding then removing instances behind a load balancer, and by causing an outage.

Prerequisites: Docker Compose  ·  Estimated time: 35 min

An nginx spreads load across replicas.
  1. 1. Deploy the service and the load balancer

    Why? A load balancer in front of the service makes instances interchangeable: clients know a single address.

    A whoami service and an nginx using Docker DNS.
  2. 2. Go from 1 to 5 instances

    Why? Going from 1 to 5 instances with one command shows horizontal scaling: capacity adjusts to demand without touching code.

    Increase the number of instances without downtime and observe the distribution.
  3. 3. Simulate losing instances

    Why? Losing instances with no visible error demonstrates high availability: redundancy absorbs the failure.

    Stop two instances: does the service stay available?
  4. 4. Scale back in

    Why? Scaling back when load drops is half of elasticity: that is what really reduces the bill.

    Scale in to 2 instances: how does that relate to pay-per-use?

Difficulty level : ●●○○○ (2/5)

My progress

  • ⏱ Estimated time : ≈ 35 min

Sign in to track your progress and take notes. Sign in

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

Elasticity vs scalability: the keys to performance

Understand how the cloud automatically adapts to your users' load.

Cloud best practices: security, resilience, costs and operations

Cloud computing best practices: pillars of a well-architected design, IAM and least privilege, mu...

Traefik: overview, architecture and first deployment

Discover Traefik: a cloud-native reverse proxy and load balancer, entrypoints, routers, services,...

HAProxy in Kubernetes: the high-performance Ingress Controller

Discover in depth how HAProxy integrates with Kubernetes: direct-to-pod architecture, hot update ...

Cloud deployment models: public, private, hybrid, community and multi-cloud

Understand cloud computing deployment models according to NIST: public, private, community and hy...

Azure networking: VNet, NSG, peering, load balancing and hybrid connectivity

Design networking on Azure: virtual networks and subnets, network security groups (NSG), peering ...

Databases on Azure: Azure SQL, Cosmos DB, PostgreSQL and cache

Choose a managed database on Azure: Azure SQL Database and Managed Instance, Azure Database for P...

Compute on AWS: EC2, Auto Scaling, Lambda and containers

Choose and use AWS compute services: EC2 instances (types, AMIs, EBS, user data, purchasing model...

ActiveGate and network zones: architecture, routing and high availability

Understand and deploy ActiveGate in Dynatrace: roles (routing, API, cloud integrations, extension...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!