DuoKart. flask · alb/asg · rds · sqs/lambda · us-east-2

DUOKART · AWS/DEVOPS · TWO BUILDERS

Bills never lost. Site stays up in festival rush.

A small shop app on AWS: Flask behind a load balancer, private servers, a database, file uploads, and a mail queue. Built by two friends learning DevOps. We broke every part on purpose, then fixed it.

DuoKart architecture diagram
fig.01: traffic: browser → ALB → ASG → RDS; orders: SQS → Lambda → DynamoDB → SNS
status · stacks deleted 2026-09-26 per destroy-checklist · destroy order 02-compute → 05-queue → 03-data → 01-vpc → 04-storage · ~$3.01/day when up · nothing below is live

The control room

One dashboard watched the whole shop. Each panel answers one question: are we losing money, or is the site down?

CloudWatch dashboard
fig.02: duokart-dev dashboard: requests, health, RDS, SQS age, DLQ, Lambda, DynamoDB

Eight alarms, one mailbox

Each alarm mails us before buyers notice a problem. Three of them show “insufficient data” when healthy. That means zero errors, not a broken alarm.

AlarmFires whenWhy this number
alb-5xx5xx > 10 / 5 minFlask 500s only on real crashes
alb-unhealthyunhealthy > 0, 2 minDead counter before ASG replace finishes
rds-cpuCPU > 80% ×3db.t3.micro is bursty; sustained 80% = leak
rds-storagefree < 5 GBEarly warning on 20 GB gp2
sqs-ageoldest > 300 sOrder sits 5 min unserved
dlq-depthvisible ≥ 1Any poison order pages us
worker-errorserrors > 0Packer crashed: bad payload, SNS deny, DDB fail
ddb-throttlethrottles > 0Hot orderId spike

Receipts, not claims

We broke each part by hand and fixed it by hand. Scroll sideways. Each frame is a real screenshot from the build.

Stacks complete
all stacks green
Alarms list
8 alarms, one mail thread
Trail logs
trail: who built what
Self-heal drill
kill-1-EC2 → ASG heals, still 200
Budget
$20 limit

Day logs live in docs/days/ (day-0 to day-7). Run git shortlog -sn --no-merges. Our two names take turns. That is the receipt.

Keeping it cheap

$3.01/day when up

Biggest costs: the database, the load balancer, and the network gateway. Rule: shut down the compute, data, and queue stacks every night; keep network and storage. A $20 monthly budget mails us at 60% spent and at 100% forecast. Total spent building this: about $20 to $25.

Budget console
fig.03: the $20 limit

Try the order flow

The AWS behind this is deleted, so the demo below runs the same checks in your browser. Totals must add up. Reused ids get rejected. Packing follows receiving after a short wait.

$ POST /orders (demo: Neem Soap × 3 @ 99)

202 {"orderId":"ord-000050","status":"RECEIVED"}