All case studies
The CloudFordge exam platform: a practice test with a question, answer options, progress ring and question navigator

Case study / CloudFordge

Building CloudFordge was the easy part. Keeping it running was the project.

CloudFordge is an exam platform for cloud certifications. This is how it runs on AWS, what happens when parts of it fail, and how I find out before a student does.

  • AWS
  • Terraform
  • CloudFormation
  • ECS Fargate
  • RDS (MySQL)
  • Grafana

The problem

Writing the code was never the hard part

These days, a platform like CloudFordge, with accounts, timed mock exams and a question bank, is quick to put together. With AI-assisted coding you can have it running in a short time, and I will not pretend otherwise. The code was not what made this project difficult.

The hard part is the thinking that code does not give you. Where should each piece live, and what happens when it fails? What should the system do when the database restarts halfway through a timed exam, a container runs out of memory, or a hundred students start a test at once? And once it is live, how do you keep it healthy week after week, with releases, patches and alarms, while real people depend on it?

Those questions are system design and operations, and a prompt does not answer them for you. So I treated CloudFordge as a reliability problem first. I wrote down the failures I expected, decided what the system should do about each one without a person stepping in, and then built the infrastructure to match. The rest of this page is that work: how it runs, how it fails safely, and how I keep it running.

Interactive

Watch a visit, a release, and what breaks

It plays on its own, one scenario after another: a visit, a release, an admin adding a course, a bad release, a database failure, a crashed task and a traffic spike. Click a tab to jump to one. The diagram is the real topology, simplified.

VPC 10.0.0.0/16 · ap-south-1Availability Zone a · private subnetsAvailability Zone b · private subnetssynchronousreplicationGitHubaws branchCodeBuildbuilds imageECRimage registryBrowserstudentclick meRoute 53DNSALBHTTPS · 2 AZsECS taskFargateECS taskscales outECS taskFargateECS taskscales outRDS MySQLprimaryRDS MySQLstandbyEFSSecrets ManagerS3ACMCloudWatch + SNScloudfordge.com?

Follow one visit from the browser to the database and back

1. The browser asks Route 53

Before any request, the browser resolves cloudfordge.com. Route 53 hosts the DNS zone, and an alias record points the name at the load balancer.

Scenario 1 of 7 · step 1 of 6
▸DNS lookup for cloudfordge.com
·Route 53 returns the ALB address
·TLS handshake, certificate from ACM
·ALB forwards to a healthy ECS task
·Task queries RDS primary
·200 OK returned to the browser
What the user sees: Only DNS and the load balancer are public. Tasks and the database have no public address.

Design

Decisions that keep it up

Two Availability Zones

The load balancer, the subnets and the database standby span two AZs, so the loss of one data centre is a failover, not an outage.

Private by default

Only the ALB is public. Tasks and the database sit in private subnets, and database subnets have no route to the internet. Security groups reference each other, so only the ALB can reach the app and only the app can reach MySQL.

Managed failover

Multi-AZ RDS replicates synchronously and flips the endpoint on failure. I chose it over a self-managed replica because recovery should not depend on someone being awake.

Safe releases

A push builds a new image in CodeBuild and stores it in ECR. ECS starts the new tasks before stopping the old ones, the ALB waits for health checks, and the circuit breaker rolls back a release that never turns healthy.

Self-healing tasks

ECS keeps the desired count, the ALB health check removes bad targets, and a deployment circuit breaker rolls back a release that never becomes healthy.

Scale on a signal

Target tracking on 60% CPU between one and three tasks. The cap is deliberate: it bounds the bill during a spike.

Secrets out of the code

Database credentials and the auth secret are generated and stored in Secrets Manager, then injected at start-up. Nothing sensitive is in the image, the repo or the state file's inputs.

Everything is code

The same stack exists as Terraform and as a CloudFormation template. I can destroy it and rebuild it from the repository, which is the only honest test of a runbook.

Operations

How I know before a student does

Six CloudWatch alarms publish to an SNS topic that emails me. Each one maps to a failure I have a plan for, and none of them exists just to make a dashboard look busy.

Unhealthy hostsALB UnHealthyHostCount ≥ 1A task has stopped passing /api/health
Target 5xxHTTPCode_Target_5XX_Count > 10The app is erroring, not just slow
ECS CPUCPUUtilization > 80%Scaling is not keeping up
RDS CPUCPUUtilization > 80%A query or load problem on the database
RDS storageFreeStorageSpace < 3 GBDisk will fill before anyone notices
RDS connectionsDatabaseConnections > 40A leak or a runaway pool

Dashboards

On the live site I watch four Grafana dashboards. They are built to be read in order: first what a student would feel, then the app, the database and the host that explain it. Click one to see it full size.

Grafana Application health dashboard for CloudFordge
Application healthRead top to bottom: what users feel (site up, failed checks, response time), then the container, the database and the host. The same crosshair runs across every panel, so a spike lines up with its cause.
Grafana APM: traces, database, logs dashboard for CloudFordge
APM: traces, database, logsRequests, 5xx rate, p95 latency, database p95 and failed sign-ins, then the slowest routes and queries, the Node.js event loop and open problems.
Grafana Infrastructure dashboard for CloudFordge
InfrastructureAgent status, uptime, CPU, memory, disk, network and system limits for the host, the app and the database, plus the containers running on them.
Grafana MySQL dashboard for CloudFordge
MySQLUptime, connections and aborted clients, query load, buffer pool efficiency and InnoDB locks. A restart shows up as a marker on the uptime panel.

Infrastructure as code

The whole stack is a repository

The same architecture is written twice, as Terraform and as a single CloudFormation template, so the design does not depend on one tool. I deployed the Terraform version end to end: plan, apply, image build, database migration and a healthy service, then destroyed it and confirmed nothing was left behind.

The first version I built by hand in the Console, to understand each service. Rewriting it as code is what exposed the mistakes below.

Read the code on GitHub ↗

Lessons

What went wrong on the way

The database port

The RDS security group allowed 3006 instead of 3306. The app waited forever. In code the port is a single value and the rule references the app's security group.

A grace period of zero

ECS killed tasks before the app finished booting. The service now allows 90 seconds before health checks count.

A secret that drifted

An IAM policy named a different secret than the real one. Now it references the resource itself, so the two cannot drift apart.

Bootstrap order

The service cannot start before an image exists and the schema is migrated, so it is created with zero tasks and scaled up afterwards.

Want infrastructure that fails gracefully?

I design, build and operate reliable platforms on AWS.

Get in touch
Kartik Patel
Let's Connect

Ahmedabad, India · Open to Remote & Global Opportunities
© 2026 Kartik Patel · Built with intention, not just code.