Skip to content

14. Naming What I Actually Run, Before Changing It

No new infrastructure in this one — the deliverable is written analysis, using vendor-neutral vocabulary (IaaS VM, managed containers, managed data, functions) to reason about what Pretzel Shop’s current setup actually is and what changing it would actually cost. The trap the lesson explicitly names: treating “Kubernetes” or “serverless” as automatic upgrades rather than trade-offs with real operational consequences.

pretzel-vm-micro runs four containers behind one Docker Compose project. The backend and frontend are stateless between requests — kill either and recreating it loses nothing. Postgres and Redis are the opposite: they exist specifically to retain bytes across redeploys, bound to named volumes on that one VM’s disk. Most architecture arguments are really arguments about that second category, not the first. Moving Postgres to a managed database doesn’t touch a single Express route — it changes connection strings, security boundaries, backup ownership, and who gets paged when storage misbehaves.

The lesson’s framework scores any candidate architecture on: on-call surface, RPO/RTO, traffic shape, compliance/residency, egress/coupling, and portability. Applied to the current setup —

On-call surface: one host, one failure domain. A kernel panic takes backend, frontend, Postgres, and Redis down together, simultaneously, not in some correlated-but-separate way.

Traffic shape: already tuned for the constraint that actually matters here — a 1GB instance with swap and explicit memory caps on Postgres and Redis, not steady e-commerce traffic volume.

Egress/coupling: currently zero, since everything talks over one Docker network with no cross-service data transfer to bill for. That number changes the moment any piece leaves the VM.

Portability: fully portable today — Compose plus GHCR runs identically on Oracle, AWS, or a spare machine under a desk. A managed database with vendor-specific IAM auth is powerful and also a one-way door partway toward that vendor.

Compliance/residency: not applicable at this scale — worth naming as “N/A for now” rather than skipping the question entirely, since it’s the kind of thing that gets forgotten until it suddenly isn’t optional.

RPO/RTO — the one this exercise actually exposed: this is where the framework stopped being academic. The honest answer, checked against everything covered in Lessons 12-13, is that a Postgres restore has never actually been tested on this deployment. The tuning work (swapfile, shared_buffers, connection caps) proves the stack runs well under memory pressure — it says nothing about whether a snapshot restore actually works when needed. That gap is the real output of this lesson, not a diagram.

The lesson names three concrete targets: A — everything as shipped in Lessons 12-13, one VM, one blast radius. B — same VM, Postgres and Redis moved to managed equivalents. C — managed compute too (Fargate/Cloud Run), nothing left to SSH into for routine patches.

For a single-operator learning project, Target A stays correct for now — cheap, transparent, and entirely explainable in one sitting, which matters when the entire on-call rotation is one person. The lesson’s own guidance is direct on this: pick B before C while one person still knows where the VM lives, and don’t let embarrassment about “still running on a VM” be the trigger for a migration that traffic or compliance hasn’t actually justified yet. The concrete next action isn’t a managed database migration — it’s proving the restore path works on what’s already running, since an unverified backup is functionally the same as no backup at all.

Staff engineers watch billing anomalies after architecture changes land — NAT gateways, cross-AZ traffic, and egress fees showing up as “spend doubled and nobody shipped twice as much.” They run scheduled game days: restore a database to a scratch instance, replay a cache-loss scenario, confirm the runbook still matches reality. The expensive mistake isn’t the technology choice — it’s running production Postgres in a container for years without a tested restore, or migrating to a more complex platform while SSH keys are still shared and nobody updated the security groups from the tutorial defaults.


Next: Lesson 15, Cloud Networks.