Section 16
Railway Low-Cost System
Hosted Postgres + a small worker + cron. Costs ~$5–20/mo to run.
Stack
- Railway Postgres (managed).
- One Python service running scheduled jobs.
- Railway cron triggers.
- Object storage on Cloudflare R2 (free egress).
Project layout
text
app/
├── pipelines/
├── sql/
├── Procfile
├── railway.json
└── pyproject.tomlrailway.json
{
"deploy": {
"startCommand": "python -m pipelines.scheduler",
"restartPolicyType": "ON_FAILURE"
}
}Cron-triggered job
pipelines/scheduler.py
import schedule, time
from pipelines import ingest_claims, transform, build_gold
schedule.every().day.at("02:00").do(ingest_claims.run)
schedule.every().day.at("02:30").do(transform.run)
schedule.every().day.at("03:00").do(build_gold.run)
while True:
schedule.run_pending()
time.sleep(30)Why Railway
Zero-config deploys, postgres + worker live next to each other, and the bill is predictable. Great middle ground between laptop and AWS.