EngineeringReliabilityOperationsLessons

Deploys Are Production: What I Learned Running a RAG Service With No Staging

Every push to master ships to users. Here is what that cost us, what we changed, what we still have not fixed, and the outage my monitoring could not see.

3arif founder·25 November 2026·7 min read

I run 3arif.ai, a retrieval-augmented assistant for Islamic scholarship. For most of its life it has had one environment: production. A push to master deploys the backend to Railway and the frontend to Vercel. There is no staging. This post is an honest account of what that means in practice.

What it cost

In an architecture review we ranked this as the top risk. Every push to master redeployed the backend, and each redeploy produced roughly 30 to 60 seconds of 502 errors while the old instance went away. That included pushes that only touched documentation. The first real traffic any change saw was real users.

We also found that the production image had been started with the auto-reload flag meant for development. It was fixed, but it is a good example of what a missing staging environment hides: nobody ever ran the production configuration under production conditions except production.

What we changed

The backend now has a Railway configuration file in the repository. It sets a lightweight liveness endpoint as the health check, so a new instance only takes traffic once it answers, gives the old one a draining period, and uses watch patterns so that test-only and Markdown-only changes do not trigger a backend deploy.

I will be straight about its status: the file is in the repo, but a Railway service only reads it if its config path points there, and I have that on my list of owner tasks rather than ticked off. Until I confirm it in the Railway settings, I treat the restart-per-push problem as reduced in code, not proven in production.

What guards the rest

Without staging, tests and monitoring carry more weight:

  • Unit tests run in CI on every push, with integration tests that need real infrastructure kept out of CI.
  • A guard test fails the build if a streaming endpoint touches a request-scoped database session, a mistake that caused two earlier outages.
  • A frontend type error fails the build, and Vercel keeps serving the previous version.
  • A scheduled uptime workflow calls the live health endpoint and opens an issue when it fails.
  • Quality changes are judged against a retrieval evaluation, not by eye.

The outage my monitoring could not see

In November the domain registration lapsed and the registrar parked the domain. The site itself, the backend and the DNS records were all fine. Visitors whose resolvers had cached the parked answer saw a registrar landing page instead of 3arif.

My uptime check stayed green the whole time, because it runs from GitHub's network, whose resolvers had the correct address. The monitor was healthy and the experience was broken, because the check and the user did not share a vantage point.

The fix is not more of the same check. It is checking the things the check cannot see: registration expiry, and resolution from more than one place.

What I would do next

  1. Confirm the Railway config path so the health check and watch patterns actually apply.
  2. Add a staging service with its own database branch and run a smoke test before promotion.
  3. Add a domain-expiry check to the uptime workflow.

Takeaway

A solo or small team can run without staging for a long time, but only if it is deliberate about what replaces it: guard tests for the incidents that already happened, health checks that tell the truth, and monitoring that sits where users sit. And it has to write down the gaps it has not closed yet.