If you remember, SEO Score API started as my OpenClaw experiment on a single EC2 instance. Nine months later it’s still on one box, and honestly that’s on purpose.
Here’s the whole stack:
- FastAPI, as plain modules: one file for the app and one per job (audits, keys, billing, email).
- SQLite in WAL mode for keys and usage, backed up off the box.
- One EC2 instance behind nginx, in its own AWS account.
- Blue-green deploys with systemd, run by GitHub Actions.
- Amazon SES for email, Stripe for billing, Terraform for the infrastructure.
That’s it. No Postgres, no containers, no orchestration platform.
Why so boring? Because I work on this in the evenings. When something breaks at 11pm I want one box, one database file and one log. I know exactly where to look.
SQLite surprises people the most. An API key lookup is a single indexed read, and I’ll move to Postgres the day it hurts, not before. The one setting that matters is write-ahead logging, so readers keep going while a write happens:
conn.execute("PRAGMA journal_mode=WAL;")
The catch is that the database is a file on one server, so backups aren’t optional. If the instance disappeared tomorrow I’d rebuild it with Terraform and restore the file.
Blue-green is the part I’d recommend to anyone. Two systemd services run the same app on two ports. GitHub Actions puts the new code in the idle slot, a health check hits it, and only if it passes does nginx switch over. A bad build never takes traffic. Before this, a bad deploy meant downtime. Now deploys are boring too, which is exactly what I want.
To be clear, EC2 is the right call for this product specifically. Audits can run long and some drive a headless browser, which suits a server that’s always on. Everywhere else my default is serverless.
If I did it again, I’d put it in its own AWS account from day one. Moving it in October took longer than building most features!
If you’re building an API side project and want to compare notes, feel free to reach out. The API docs are here if you want to poke at the result.
