Back to Knowledge

Building with Google Cloud

Already using Google Cloud Platform? Here's how to build modern web apps with GCP services - and when it makes sense over simpler alternatives.

1GCP vs Vibe Stack: When to Choose What

Google Cloud is powerful and often more intuitive than AWS, but it's still a full cloud platform with complexity.

Choose GCP If...

  • Your company uses Google Workspace
  • You need Kubernetes (GKE is excellent)
  • You want ML/AI capabilities (Vertex AI)
  • You prefer Google's UX over AWS
  • You need Firebase integration
  • You want better pricing transparency

Choose Vibe Stack If...

  • You want to ship fast with zero config
  • You're building a standard web app
  • You don't need cloud-specific features
  • You're a solo developer or small team
  • You want the simplest possible setup
  • You prefer specialized tools over platforms

Our take: GCP is generally easier to use than AWS and has better documentation. But even "easier" is still complex compared to the Vibe Stack. Choose GCP if you need platform features; choose Vibe Stack if you just want to ship.

2Recommended GCP Stack for Web Apps

Cloud Run (App Hosting)

Deploy containerized apps with automatic scaling to zero

Why Use It

  • • True serverless containers
  • • Scales to zero (no idle costs)
  • • Supports any language/framework
  • • Built-in HTTPS with custom domains
  • • Fast cold starts (~100-300ms)

Gotchas

  • • Requires Docker knowledge
  • • No built-in preview deployments
  • • CI/CD setup required
  • • Stateless only (ephemeral filesystem)

Comparable to: AWS Lambda + API Gateway, but with full HTTP server capabilities and better cold starts

Cloud SQL (Database)

Managed PostgreSQL, MySQL, or SQL Server

Why Use It

  • • Automatic backups and replication
  • • High availability with failover
  • • Integrated with Cloud Run
  • • Automatic storage scaling
  • • Private IP with VPC peering

Gotchas

  • • Always running = always paying ($10-50+/month)
  • • No scale-to-zero option
  • • Connection limits require pooling
  • • Setup is more complex than Neon

Comparable to: AWS RDS - but no database branching like Neon or easy dev environments

Firebase Authentication

Easy user authentication with social logins

Why Use It

  • • Drop-in UI components
  • • Email/password + social logins
  • • Phone authentication
  • • Free tier is generous
  • • Great documentation

Gotchas

  • • Limited customization
  • • Vendor lock-in to Firebase
  • • User migration can be tricky
  • • Token refresh handling needed

Comparable to: Clerk, Auth0 - but tightly coupled with Firebase ecosystem

Cloud Functions (2nd gen)

Serverless functions for background tasks and webhooks

Why Use It

  • • Event-driven functions
  • • Integrates with GCP services
  • • 2nd gen built on Cloud Run
  • • Better performance than 1st gen
  • • Free tier includes 2M invocations

Gotchas

  • • Cold starts (though better in 2nd gen)
  • • 60-minute timeout limit
  • • 1st gen is legacy (avoid it)
  • • Debugging can be annoying

Pro tip: Use Cloud Run for HTTP APIs, Cloud Functions for event-driven tasks (pub/sub, storage triggers, etc.)

3Cost Breakdown & Free Tier

GCP pricing is generally more transparent than AWS, but costs still add up for managed services.

Cloud Run

Container hosting + requests

$0-10/mo

2M requests free, scales to zero

Cloud SQL (db-f1-micro)

PostgreSQL or MySQL

~$10-20/mo

Smallest instance, always running

Firebase Authentication

User authentication

FREE

Unlimited users on Spark plan

Cloud Functions

Background tasks + webhooks

$0-5/mo

2M invocations free

Monthly Total (Small App)

Low traffic, single region

~$10-35/mo

Cloud SQL is main cost

Vibe Stack (Comparison)

Vercel + Neon

$0-20/mo

Scale-to-zero everywhere

Good news: GCP's free tier is permanent (not 12-month like AWS). Cloud Run and Functions scale to zero, so you only pay for actual usage. Main cost is Cloud SQL if you use it.

4Building GCP Apps with AI

Claude Code (Recommended)

Claude Code understands GCP well! It can help with Cloud Run deployments, Dockerfile creation, Firebase integration, and navigating GCP's services.

Tip: Claude knows Cloud Run is usually better than Cloud Functions for HTTP APIs. Ask it to explain trade-offs!

Gemini + Antigravity

Google's own AI (Gemini) powers Antigravity, an AI coding environment. Deep GCP knowledge and integration, though less mature than Claude Code or Cursor.

• Native GCP service understanding

• Can generate gcloud CLI commands

• Understands Firebase patterns

• Integrated with Google Workspace

ChatGPT & GitHub Copilot

Both understand GCP basics, but Claude and Gemini tend to have more up-to-date knowledge of GCP services and best practices.

5Quick Start: Deploy to Cloud Run

1

Create GCP Account

Sign up at cloud.google.com. Get $300 free credits for 90 days. Credit card required.

2

Install gcloud CLI

Download from cloud.google.com/sdk. Then authenticate:

gcloud auth login

3

Create a Dockerfile

For Next.js:

# Use official Node.js image

FROM node:18-alpine

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build

EXPOSE 3000

CMD ["npm", "start"]

4

Deploy to Cloud Run

One command deploys everything:

gcloud run deploy my-app --source .

Answer prompts: region, allow unauthenticated (yes for public).

5

Your App is Live

Cloud Run gives you a .run.app URL. Add custom domain in console if needed.

That's it! Cloud Run automatically builds your container, deploys it, and gives you HTTPS. Future deploys: just run the same command.

6Common GCP Gotchas

IAM Permissions

Like AWS, GCP uses IAM for permissions. Service accounts, roles, and policies can be confusing. "Permission denied" errors are common.

Fix: Use GCP's predefined roles (Editor, Viewer) early on. Lock down later. Check Cloud Logging for permission errors.

Cloud SQL Connection Limits

Cloud Run can spin up many instances. Each needs a database connection. You'll hit Cloud SQL connection limits fast without pooling.

Fix: Use Cloud SQL Proxy or connection pooling (pg-bouncer). Or use Neon/Supabase which handle this better.

Cold Starts (Still a Thing)

Cloud Run cold starts are better than Lambda (~100-300ms), but still noticeable for large containers or slow frameworks.

Fix: Keep container images small. Use minimum instances (costs money) or accept cold starts. Consider Alpine base images.

Egress Data Costs

Data leaving GCP (egress) is expensive - $0.12/GB. Serving large files, videos, or high-traffic APIs can rack up bills.

Fix: Use Cloud CDN for static assets. Compress responses. Consider Cloudflare in front of GCP for caching.

Ready to build on GCP?

Google Cloud is solid - especially if you value better UX than AWS.