Skip to content
HookDeploy
← All posts

Infrastructure5 min read

Multi-Region from Day One: What It Actually Costs

How HookDeploy built real data residency from day one: four fully separate regional databases (US, EU, APAC, AU), Cloudflare's global edge for fast ingestion, and a CI pipeline that keeps identical code running everywhere so customer data never leaves its region.

Michael Bernstein

Founder, HookDeploy

A webhook doesn’t care where your company is headquartered. A payment event fires in Frankfurt, a Shopify order comes in from Singapore, a Slack notification triggers from Sydney. What should care is where your customer actually is, and where their data is allowed to live. A company in Australia shouldn’t have its data sitting in Frankfurt. A company in France shouldn’t have its data sitting in the US. That’s the part most “global” infrastructure gets wrong, and it’s the part we built HookDeploy around from day one.

Global ingestion is not the same thing as global data residency

Cloudflare’s network gives us edge PoPs everywhere, so the moment a webhook hits us, it’s landing close to wherever it actually originated, regardless of region. That part is table stakes now. Any modern platform can put a CDN in front of a single backend and call itself global.

The part that’s actually hard, and the part most companies skip, is what happens after the edge. If every one of those globally-ingested requests ultimately writes to one database in one region, you haven’t built global infrastructure. You’ve built a global front door on a single-country house. The webhook may travel fast, but the customer’s data still ends up wherever your one database happens to be, whether that customer is in Sydney, Singapore, or Paris.

We treat those as two separate problems on purpose: fast global ingestion at the edge, and strict regional data placement once that data needs to be stored.

Distinctly separated regional databases, not replicas

We run four fully separate Supabase projects: US, EU, APAC, and AU. Not read replicas of one primary, not a single database with region tags on the rows. Separate auth.users tables, separate JWT issuers, separate service-role keys, per region. An Australian customer’s account and data live in the AU project. A French customer’s account and data live in the EU project. There is no path by which an EU customer’s data quietly ends up at rest in a US database, because the US database was never in the chain to begin with.

That distinction matters more than it sounds. A single database with regional labels is still one blast radius, one jurisdiction, one point of failure for residency guarantees. Four genuinely separate databases means a customer’s data residency claim is actually true, not just true until someone reads the fine print.

The hard part: knowing which region before you have a session

The tricky engineering problem isn’t storing data in four places. It’s every flow that runs before a session exists, deciding which of four completely separate backends a person belongs to, before there’s any session to tell you.

We resolve this with a route lookup: a SHA-256 hash of the email, mapped to a region, defaulting to US only when there’s no match. Deliberately no “exists” flag in that response, because leaking whether an email is registered anywhere is an enumeration vulnerability we’re not willing to trade for convenience. Every login, signup, and password-reset flow pays this lookup before doing anything else, because getting this wrong means routing someone to the wrong region’s database at the one moment it matters most.

Identical code, real regional differences

Our CI pipeline is what makes this whole architecture trustworthy: the same code deploys to all four regions, so there’s no drift between them, no US-only fix that quietly never made it to APAC. That parity is enforced, not hoped for.

What still surfaces, even with identical code everywhere, are the real differences in how each region’s regulatory and provider environment behaves. Supabase’s own Auth defaults differ by region, for instance OTP codes are 6 digits in the Americas and 8 digits in EU/APAC/AU, a legitimate platform-level difference we had to design our schemas and UI around, not a bug. Finding differences like that requires actually exercising every region with a real flow, because they only show up when you run the thing, not when you read the code.

Verifying identical code across four real environments

Because our pipeline cascades automatically on merge (staging, then Americas, then EU, then APAC, then AU, with no pause between them) speed is built in, but so is the risk of one bad migration reaching all four regions before anyone notices. So we don’t treat “the code is identical” as the same thing as “the behavior is verified.” Any change touching auth or data flow gets tested end to end across all four regions before we call it done. That discipline is what catches the interaction-level issues that only show up when identical code meets four genuinely different environments.

Why this is the correct shape for webhook infrastructure

Webhooks are inherently global. The services firing them (Stripe, Shopify, Meta, whoever) don’t route through a single continent, and neither do your customers’ customers. But global delivery and global data residency are different guarantees, and a platform that quietly collapses them into one database pretending to be worldwide is optimizing for a demo, not for the customer in Sydney who needs to know, factually, that their data never left Australia.

Building four real, separated regions from day one meant slower initial development and more infrastructure to reason about than a single database with a CDN in front of it. It also means that when a customer asks where their data lives, the answer is specific and true, not a shrug and a diagram of edge locations. That’s the same principle behind fail-closed encryption and break-glass access: the more expensive, more honest version of the architecture is the one actually worth trusting.