Cloud & DevOps

Scaling a Node.js API on GCP Without Over-Engineering

From a single Cloud Run service to a resilient, observable backend — what to add at each stage of growth, and what to skip until you need it.

Habib Ur RehmanBy Senior Full Stack Engineer & MVP Partner
  • Published
  • Updated
  • 8 min read
A large data centre hall with server cabinets and blue network cables overhead

Key takeaways

  • Start with one containerised service on Cloud Run and a managed Postgres database.
  • Move emails, reports and third-party calls into a Pub/Sub queue with idempotent workers.
  • Add Redis caching and structured logging, dashboards and alerts before splitting services.
  • Split into services only when a clear boundary and scaling or ownership reason exists.

Teams often reach for Kubernetes and a dozen microservices long before they have the traffic to justify them. Here's the staged approach I use instead.

Rows of black server racks in a bright data centre
Managed cloud services run on racks like these, so you don't have to.

Stage 1: One service, one database

A containerised Node API on Cloud Run with managed Postgres will carry you surprisingly far. Autoscaling is built in, deploys are one command, and there's almost nothing to operate.

Four stages of scaling a Node API: Cloud Run with Postgres, a queue with workers, caching and observability, then splitting services.
Add infrastructure only when the current stage stops being enough.

Stage 2: Move slow work off the request path

Emails, report generation and third-party calls belong in a queue. Pub/Sub plus a worker service keeps response times low and makes retries safe and idempotent.

A close-up of a network switch with fibre cables plugged into its ports
Observability starts with knowing exactly what each connection is doing.

Stage 3: Add caching and observability

  • Redis for hot reads and rate limiting.
  • Structured logs with a request ID on every line.
  • Dashboards and alerts on latency, error rate and queue depth.

Only then: split services

Extract a service when a clear boundary and a clear scaling or team-ownership reason exist, not because it sounds modern. A well-structured monolith is easier to ship, debug and reason about. The SaaS architecture guide shows how I would structure one.

FAQs

Answers on hosting, queues, databases and monitoring as an API grows.

Usually not. Cloud Run autoscaling plus a managed database handles a large amount of traffic, and it removes most operational work. Consider Kubernetes only when you have needs it uniquely satisfies.

References

  1. What is Cloud Run — Google Cloud
  2. Pub/Sub overview — Google Cloud
  • #Node.js
  • #GCP
  • #DevOps
  • Architecture diagram of a SaaS application: Next.js frontend, NestJS API, PostgreSQL database, Redis queue and background workers

    SaaS & MVP

    Building Scalable SaaS Applications with Next.js and NestJS

    A practical architecture guide to building a multi-tenant SaaS with Next.js and NestJS: how the two fit together, how to handle auth, databases, tenancy and background jobs, and what to avoid.

    • Published
    • 11 min read
    Read article
  • A code editor with dark theme showing JavaScript test code on a monitor

    Next.js & React

    Next.js App Router: Patterns I Reach for on Every Project

    Server Components, route groups, streaming and server actions — the handful of patterns that keep my Next.js codebases fast and easy to reason about.

    • Published
    • Updated
    • 8 min read
    Read article
  • A product team placing colourful sticky notes on a glass wall while planning an MVP

    SaaS & MVP

    How I Ship a Production-Ready MVP in Six Weeks

    A practical playbook for founders: what to cut, what to keep, and how to sequence the work so you launch fast without building a house of cards.

    • Published
    • Updated
    • 7 min read
    Read article