r/googlecloud • u/Melodic_Tower_482 • 8d ago
Solo technical founder running a startup, looking for an optimal tech setup
I run a booking marketplace for SMB. The public website is being rewritten from Laravel to Next.js 16 (App Router, server-rendered). Two things matter most:
- Fast pages. Business and service pages should load
- Custom domains. Each business can have its own site on its own domain, served through a Cloudflare Worker proxy to our origin
How I got here:
- Started on Cloud Functions, then moved the services to Cloud Run.
- Cloud Run with min instance quickly became expensive and being billed by cpu/memory make it volatile
- Moved to one GCE VM to put everything in one place: the API gateway, website and business portal together, close to Firestore, at a fixed cost.
Current setup:
- GCE e2-medium: API gateway (Node), the public website (Next.js), the business portal (Next.js), Typesense. Everything in Docker behind nginx.
- VPS: data sync jobs, marketing and analytics, staging, others.
- Cloud Run jobs and Cloud Functions: data jobs and Firestore triggers.
- Firestore i: about 5M document reads/day, already behind a fair amount of caching in the gateway.
- Cloudflare in front of everything
Traffic:
- About 2k users/day, normally about 1 page/s. I expect about 5× that soon.
Options we're weighing:
- A. A bigger GCE VM. Everything stays on one box near Firestore. Simple and predictable, but GCE is pricey per vCPU, and the API and website still compete for CPU during spikes. And even tough it is fast, it is not full reliable to have
- B. Back to Cloud Run for the website and portal (min 1 instance), with the gateway on the VM. It scales with bursts, but our last experience was that cost climbed quickly. Was that bad configuration on our side (always-on CPU, too many min instances, no caching), or is it normal?
- C. Move compute to VPS. About 30-40/month for 4 dedicated vCPUs and 16 GB, so far cheaper per vCPU. But the gateway makes many Firestore calls per page, and Germany → europe-west1 adds about 10–15 ms per call. And egress has been expensive.
Questions:
- Gateway/Backend and database in the same place: required or overrated? Our gateway makes several Firestore calls per page, some of them one after another. Is keeping it in the same region as the database a hard rule, or does good caching make 10–15 ms per call a non-issue?
- With 5× traffic coming, which option would you pick (A, B, or C), and what would make you switch later?
- When is it time to leave Firestore? At 5M reads/day it works and the bill is manageable so far, but I really eager to move to postgres, but Cloud SQL is really expensive. What made you move to Postgres (Supabase, Neon, Cloud SQL, self-hosted)? Was it cost, query limits, reporting, or team speed? And how painful was the migration with live writes and reads
- How are you handling GCP egrees ?
0
Upvotes
3
u/treksis 8d ago edited 8d ago
we use glb, cloud armor, clodrun, cloudsql. full gcp managed stack in prod.
for my side proejct, i use ovh vm and cf orange dns. so far zero issue. all vibe coded with opus 5.5.
2
u/Sorry_Cheesecake_382 8d ago
Use cloudflare workers and workflows it will save so much money and time over GCP
1
u/thecrius 7d ago
get out of the vm approach, set up a cheap GKE with properly sized nodes.
Your cost will never be the compute but the networking. It's always networking.
Keep all parts in the same region. Use a dbaas and set up proper backups. Test them.
If business start to grow and it's stable, invest in a failover in another region, far, it will increase your latency only momentarily when you have to switch over, then the edge network kicks in.
3
u/GlebOtochkin Googler 8d ago
I would try to keep the frontend, backend and database close to each other - on the same platform, the same region, ideally the same zone and connected through private IP. It is doable for Cloud Run or if you choose to keep using GCE VM. In general it is more secure, better performance-wise, and has no egress cost for database calls.
Speaking about the choice between Firestore and PostgreSQL solutions - it really depends on the number of calls (5M is about $60 per month) and your data structure. In the field I see people want to do more with data (reporting etc) than just read documents and move to relation schemas in PostgreSQL solutions.
If you want to manage PostgreSQL - sure you can install it on a VM or in GKE. It will work, the question is how much time you are ready to invest in the management, patching security updates etc. VM-based HA solution will be probably 2x cheaper compared to Cloud SQL or GKE but you will need to monitor and manage it by yourself.
Supabase or Neon - feasible solutions as well but you will do your math about the price. I am not sure it is going to be cheaper than Cloud SQL with comparable configuration. Don't forget to add SLA, backups, etc., to your calculation. And of course egress - that might dictate your final architecture if your traffic grows 5x.
1
u/Broad_Pair3440 8d ago
Depends how much latency actually matters for your users, but 10, 15ms per call adds up fast if the gateway chains 5, 6 reads before sending a response.
1
u/Sfdprod 8d ago
First thing, since you already use cloudflare, depending on if the 2 next instances actualty require a full node runtime or not, i would consider moving the nextjs instances onto workers.
As for the db, im not sure if i want to just blanket say "yes go for pg!!" because its faster, but is the current latency of the queries alone an actual issue today?
What i would NOT do is to use any of the neons or supabases out there. I recently migrated a client from just such a setup, and reduced latency by aprox 90%.
I would either use self managed or cloud sql.
1
u/AstronomerNo8500 Googler 6h ago
Can you tell me more about your previous Cloud Run configuration, where you saw the cost climb quickly? You said "Was that bad configuration on our side (always-on CPU, too many min instances, no caching), or is it normal?" My first thought is have you investigated whether you can minimize your cold starts? I'm sure you probably have. I'm assuming that's why you're using always-on CPU and min instances (since it doesn't sound like you're using GPUs here).