Reduced Backend Cost and Improved Scalability Using Google Cloud Run – Anandhu V S

Reduced Backend Cost and Improved Scalability Using Google Cloud Run

Anandhu V S migrated a production Node.js + TypeScript backend from a traditional always-on virtual machine to Google Cloud Run (serverless) to reduce backend cost and improve scalability.

This real-world migration focused on building a cloud-native backend that scales automatically, eliminates idle infrastructure cost, and simplifies DevOps operations.

Why I Migrated from VM to Cloud Run

Traditional VM-based backends run 24/7, even when there is no traffic. This results in unnecessary billing and manual scaling challenges.

With Cloud Run, services scale to zero and charge only per request, making it ideal for production APIs and modern applications.

Key Findings from the Migration

  • VM-based backends consume resources even during zero traffic
  • Cloud Run scales automatically based on incoming requests
  • Serverless billing removes idle infrastructure cost
  • Container-based deployment improves environment consistency

Real Production Issues I Faced

  • Docker build failures due to Windows to Linux permission differences
  • tsc: Permission denied during Google Cloud Build
  • Large Docker build context caused by missing .dockerignore
  • Environment variables behaving differently in serverless vs VM environments

How I Solved These Issues

  • Used clean Docker builds with a proper .dockerignore
  • Switched to npx tsc for reliable TypeScript builds
  • Moved secrets from .env files to Cloud Run environment variables
  • Verified APIs using curl and Cloud Run logs

Architecture Improvements

  • Vercel frontend connected to Cloud Run backend
  • HTTPS enabled by default
  • No server maintenance or manual scaling

Final Results

  • Lower infrastructure cost with no idle VM billing
  • Auto-scaling backend with production-grade reliability
  • Cleaner and more maintainable backend architecture

What This Project Demonstrates

This project strengthened my hands-on experience in:

  • Cloud-native backend design
  • Cost optimization and serverless architecture
  • Docker containerization
  • Production debugging and DevOps workflows

About Anandhu V S

Anandhu V S is a Web Developer and Cloud Engineer focused on building scalable, cost-efficient backend systems and SEO-optimized web platforms.

🔗 Portfolio Website:
https://portfolio-anandhu-v-s.vercel.app/

🔗 MenuSent Project:
https://menusent.com

Comments

Popular posts from this blog

CloudDrive App – Secure Cloud File Management System by Anandhu V S (Phase 1)