u/ployedai

▲ 7 r/replit

Lessons from moving a production app from Replit to GCP

We recently moved a production app (Vite frontend, Hono backend, Postgres) from Replit to Google Cloud. It works great now, but a few things bit us on the way that I wish someone had written down, so here they are.

1. You inherit a lot of invisible work. Replit quietly handles HTTPS, port binding, process restarts, and keeping the thing awake. None of that is in your code, so none of it moves with you. Make a list of everything Replit does for you before you start, because on GCP every item on that list becomes your job (load balancer or Cloud Run config, health checks, a process manager or container runtime).

2. Audit your secrets before you migrate, not after. Replit's secrets tab makes it easy to forget what your app actually depends on. We found API keys hardcoded in source that had been added "temporarily" months earlier. Moving platforms is the one moment you will actually look, so scan for hardcoded secrets first (even a dumb grep for api_key and token gets you far) and move everything into Secret Manager in one pass.

3. The database will hurt you in ways Replit never did. This was our biggest outage source. We started on the smallest Cloud SQL tier (db-f1-micro) which allows only 25 connections. The backend opened a connection per request under load, everything worked in testing, then production traffic hit the ceiling and the app went down twice before we understood why. Two fixes: connection pooling (PgBouncer or your driver's built-in pool) and knowing that the cheap Cloud SQL tiers have limits Replit's managed Postgres never surfaced to you.

4. Decide early: Cloud Run or a VM. Cloud Run is the natural Replit replacement (deploy a container, it scales, you mostly don't think about it) but cold starts are real if your traffic is spiky, and anything that assumes a persistent local filesystem breaks, because the filesystem is ephemeral. If your app writes files to disk, that's a rewrite to Cloud Storage, not a config change.

5. Costs are itemized now, and egress is the ambush. Replit is one flat number. GCP is forty small numbers, and the one that surprises people is network egress. Set a budget alert on day one, even a generous one. The first month's bill is your real baseline, not the pricing calculator.

6. You need a deploy pipeline, even a tiny one. On Replit, editing is deploying. On GCP nothing deploys itself, and "I'll just gcloud deploy from my laptop" lasts until the first time two people do it in the same hour. Even a ten line GitHub Action that builds the container and deploys on push to main saves you from yourself.

The migration is not hard because GCP is hard, it's hard because Replit hides how much production actually involves, and it all lands on you at once.

Curious what pushed others off Replit (or convinced you to stay). For us it was needing a real database and predictable uptime.

reddit.com
u/ployedai — 14 hours ago