GCP Architecture for SaaS Startups: What to Get Right from Day One
Practical guide to designing a scalable, cost-efficient GCP architecture for SaaS startups. Cloud Run, GKE, Cloud SQL, IAM and networking decisions explained.
The most expensive GCP architecture mistakes early-stage startups make
Most early GCP setups are not wrong because the team lacked skill. They are wrong because they were built for the demo, not for the second year. The mistakes I see most often when reviewing SaaS startups on Google Cloud:
- Everything in one project. Dev, staging and production share a single GCP project, so IAM is all-or-nothing, quotas are shared and a test script can delete production data.
- No organisation or folder hierarchy. Projects created from personal Gmail accounts, with billing and ownership tied to one founder.
- Over-engineering the compute layer. A three-node GKE cluster for an API serving a few hundred requests per minute.
- Public everything. Cloud SQL with a public IP and
0.0.0.0/0in authorised networks, service account keys committed to repositories. - No budget alerts. The first sign of a runaway BigQuery query or a forgotten GPU VM is the invoice.
None of these are hard to fix early. All of them are painful to fix once you have customers and a compliance questionnaire on your desk.
Cloud Run vs GKE: choosing the right execution layer
For most SaaS startups, Cloud Run should be the default. You deploy a container, Google handles scaling (including to zero), TLS, revisions and traffic splitting. You pay per request-time, and there is no cluster to patch or upgrade. It handles HTTP APIs, background workers via Cloud Run jobs, and event-driven processing through Pub/Sub or Eventarc.
GKE makes sense when you need what Cloud Run does not give you:
- Long-running stateful workloads, custom networking or service mesh requirements.
- Many services with shared platform tooling (operators, admission policies, GitOps with Argo CD or Flux).
- Specialised hardware or fine-grained control over node pools, such as GPUs.
- A platform team that will actually own the cluster lifecycle.
If you do choose GKE, start with Autopilot: you pay for pod resources rather than nodes, and Google manages node provisioning, upgrades and much of the security hardening. Standard mode is worth it only when you need node-level control.
A pragmatic path many teams follow: start on Cloud Run, keep services stateless and containerised, and move specific workloads to GKE when a concrete requirement appears. Because both run standard containers, the migration is incremental rather than a rewrite.
Data layer: Cloud SQL, Firestore or BigQuery?
These three solve different problems, and confusing them is a common source of cost and complexity:
- Cloud SQL (PostgreSQL) is the right default for transactional SaaS data: relational model, strong consistency, mature tooling. Enable automated backups and point-in-time recovery, use the high-availability (regional) configuration for production, and connect privately via private IP or the Cloud SQL Auth Proxy. If you outgrow it, AlloyDB is a PostgreSQL-compatible step up.
- Firestore fits document-shaped data with simple access patterns and real-time sync to clients. It scales without capacity planning, but complex queries, joins and reporting become awkward quickly.
- BigQuery is your analytics warehouse, not your application database. Use it for product analytics, billing exports and reporting. Partition and cluster large tables, and set per-user or per-project query quotas so a single unfiltered query cannot scan terabytes.
A typical early-stage SaaS stack: Cloud SQL for the product, BigQuery for analytics, Memorystore if you genuinely need a cache.
IAM and network security from day one
Security decisions are cheapest before the first enterprise customer asks about them:
- Resource hierarchy: create a Google Cloud organisation tied to your company domain, with folders for production and non-production and one project per environment.
- Least privilege: grant roles to Google Groups, not individuals. Avoid basic roles like Owner and Editor; use predefined roles scoped to the project or resource.
- No service account keys: use attached service accounts for Cloud Run and GKE (Workload Identity), and Workload Identity Federation for CI/CD from GitHub Actions or GitLab. Enforce it with the
iam.disableServiceAccountKeyCreationorganisation policy. - Private by default: a custom-mode VPC, Cloud SQL on private IP, Cloud NAT for egress, and a global external Application Load Balancer with Cloud Armor in front of public services.
- Audit logs: keep Cloud Audit Logs and route them to a dedicated logging project or bucket with restricted access.
Define all of this in Terraform so it is reviewable and reproducible.
Cost management: what to monitor from the start
GCP cost surprises are almost always preventable:
- Budgets and alerts per project at 50%, 90% and 100% of expected spend, sent to a channel someone actually reads.
- Billing export to BigQuery from the first month, so you can break down cost by service, project and label.
- Labels on every resource (
env,team,service) so the breakdown means something. - Right-sizing: Cloud Run minimum instances and CPU allocation, Cloud SQL tier, and idle GKE capacity are the usual suspects.
- Committed use discounts only once your baseline is stable; committing too early locks in waste.
Get your GCP architecture reviewed
If you are building a SaaS product on Google Cloud and want to be sure the foundations will hold as you scale, I can help. As a GCP consultant, I review existing setups and design landing zones, Cloud Run and GKE platforms, data layers and IAM models for startups and scale-ups across Europe. The first call is free.
¿Necesitas ayuda?
Contacta para una auditoría gratis sobre tu infraestructura cloud.