How I Cut My Hosting Costs by Over 80% Without Sacrificing Performance
A breakdown of how I migrated from Heroku to a more cost-effective stack using Supabase, Railway while maintaining performance for calcont.in.
Running a personal project like calcont.in that receives 30k+ monthly visitors can come with hidden infrastructure costs, especially if you’re using platforms with limited free tiers like Heroku. In this post, I’ll walk you through how I reduced my deployment costs by $10/month (that’s $120/year), while improving reliability and performance.
💸 Previous Setup: Heroku + PostgreSQL
Until recently, I was using Heroku’s hobby plan setup:
- $7/month: Heroku Dyno (limited RAM, not ideal for traffic spikes)
- $5/month: Heroku Postgres Hobby Dev
Total: $12/month
While Heroku is beginner-friendly, the hobby dynos provide low memory and have limitations under heavy traffic. Performance wasn’t consistent during peak hours, and there’s not much clarity about how compute resources are allocated behind the scenes.
🚀 Step 1: Migrated PostgreSQL to Supabase
Supabase offers a generous free tier for PostgreSQL databases, and since calcont.in only uses the DB for:
- User sign-ups (~10/month)
- Contact form submissions (~50 in total)
It made perfect sense to migrate to Supabase. Minimal usage, no cost, and easy setup.
🔄 Step 2: Deployment Experiment - Google Cloud Serverless
Next, I explored Google Cloud’s serverless options by estimating CPU and request costs. While it looked affordable on paper, real-world deployment revealed unexpectedly high costs.
I quickly moved on.
💡 Step 3: Found the Sweet Spot with Railway
I discovered Railway and tried their $5/month hobby plan, which includes:
- 8 GB RAM
- 8 vCPUs
- Supports Dockerfile-based deployment
- Pay-as-you-go pricing model
Actual cost for my usage? Just $2.50–$3/month!
That’s ~$10/month saved, and the platform offers:
- Better resource allocation
- Fewer crashes or slowdowns
- Predictable pricing with usage caps to avoid surprise bills
Note: While testing Railway, I kept my Heroku setup running in parallel as a fallback. This gave me confidence to monitor traffic, analyze real-world pricing, and make the switch only when I was sure it worked smoothly.
🔐 Bonus: Securing the Admin Panel with Cloudflare One
To protect sensitive parts of my app (like /admin
), I set up Cloudflare One Access, which:
- Prevents public exposure of admin endpoints
- Offers Zero Trust protection for free (up to 50 users)
No need to write middleware or complex auth layers!
🧠 Optimization: Removed External Cache Layer
In the Heroku setup, I was using memcachier
for caching some operation. But in the new setup:
- As, only one feature uses caching. So, Maintaining an external cache service didn’t make sense
- So I switched to Django’s in-memory RAM caching, which is enough and free
📊 Final Comparison
Feature | Heroku (Before) | Railway + Supabase (After) |
---|---|---|
Cost | $12/month | $2.50–$3/month |
RAM | 512MB | up to 8 GB |
CPU | limited | 8 vCpus |
Database | Heroku PG ($5) | Supabase (Free tier) |
📦 GitHub Reference
You can check the actual PR here that contains the migration and deployment updates:
🔗 calcont.in/pull/115
🧾 TL;DR
- Migrated DB to Supabase (free)
- Moved hosting to Railway ($2.5–$3/month)
- Secured admin route with Cloudflare One
- Removed unnecessary caching layer
- Saved $120/year while improving reliability
If you’re hosting a personal project and not doing heavy DB operations, you can save a lot by evaluating these alternatives. Don’t pay for what you don’t need.
Have questions or want to share your own infra cost-cutting tips? Drop a comment or reach out via GitHub!