10 steps · ~40 min · intermediate · free

Deploy a resilient three-tier app

You are the first engineer at Nimbus Books. Build the app on real Docker containers, put two web servers behind a load balancer, restrict PostgreSQL access, then stop a server and keep traffic moving.

Run this architecture yourself

Start the lab locally with real Docker containers.

Torollo runs locally on desktop with Docker.

npx torollo start

Run the command in a terminal on your computer, then open Deploy a resilient three-tier app in Torollo.

Docker requiredlocal onlyMIT licensed

Execution plan

10 graded steps against one system as you build it.

Build

Assemble the web, data and traffic tiers.

01-04
  1. Your first server

    Start the first web server in a container.

    • check: container "web-1" is running
  2. The data tier

    Create PostgreSQL and the first reader record.

    • check: container "db" is running
    • check: table "users" exists in "db"
  3. Wire the app to its database

    Allow the web server to reach PostgreSQL on port 5432.

    • check: web-1 → db is reachable on :5432
  4. Ship the bookstore

    Serve the bookstore from the live database.

    • check: GET :80/ on "web-1" contains "Nimbus Books"
    • check: GET :80/ on "web-1" contains "ada@nimbus.dev"

Harden

Add redundancy and restrict database access.

05-07
  1. Two of everything

    Build a second web server with the same application.

    • check: container "web-2" is running
    • check: GET :80/ on "web-2" contains "Nimbus Books"
    • check: GET :80/ on "web-2" contains "ada@nimbus.dev"
  2. One front door

    Put one load balancer in front of both web servers.

    • check: "lb" is balancing across ≥ 2 upstreams
    • check: GET :80/ on "lb" contains "Nimbus Books"
  3. Lock the vault

    Limit database access to the two application servers.

    • check: lb → db is blocked on :5432
    • check: web-1 → db is reachable on :5432
    • check: web-2 → db is reachable on :5432

Survive

Run failures, replace servers and grow the fleet.

08-10
  1. Pull the plug

    Stop one web server while the load balancer keeps serving traffic.

    • check: GET :80/ on "lb" contains "Nimbus Books"
  2. The clone factory

    Clone the application into a two-replica auto-scaling group.

    • check: "web-asg" keeps 2 replicas running
    • check: container "web-1" is running
  3. Launch day

    Grow the fleet to four replicas and move live traffic to it.

    • check: "web-asg" keeps 4 replicas running
    • check: "lb" is balancing across ≥ 4 upstreams
    • check: GET :80/ on "lb" contains "Nimbus Books"

Run locally

Start the roadmap on your machine

Torollo runs the lab in local Docker containers. The roadmap and its validators ship with the MIT-licensed app.

Inspect the source on GitHub

Before you start

  • Docker installed and running
  • A Torollo project created and open on the canvas
  • Comfortable running basic commands in a Linux terminal