#How to do multi regions Architecture for Data Residency

16 messages · Page 1 of 1 (latest)

umbral orchid
#

Hi,
I recently built a B2B SaaS application. Some our our clients are now asking for Data Residency. Right now all of our servers, storage and database are stored in the US. To be able to provide another location (e.g. EU), how will it works ?

Database
My guess is that I'll need a database manager where we use some of the same logic as a Multi-Tenants architecture. But then, how do you handle relationship between 2 regions and finding a user based on his email/username ?

Will I need to create a global table to find region based on id, email or username ?
If a user is in EU and the other in US, how can relationships works ? Since SQL JOIN will no longer works, do I need to add custom logic everywhere ?

I didn't even started with Auth, Hosting, Storage, DevOps, Vendors Region, ...

cursive wren
#

That's too much of an annoyance honestly, you should just use a managed service such as Amazon Aurora for SQL Databases or Amazon DynamoDB (for AWS)

umbral orchid
#

That's what I was thinking.

cursive wren
#

A cheaper solution would be to have a read replica in the EU, and do the writes in the US. That solution can work if your app doesn't require a lof of inserts

#

Well I'm thinking Postgres when I talk so this might not be accurage

umbral orchid
#

It wouldn't work since they want their data stored & process only in one region.

cursive wren
#

yup my bad

#

mhh that's a thoughie, I'm not sure that's how Amazon Aurora and DynamoDB works

umbral orchid
#

That's my issue a lot of services I found, their sharding are identical to the master/parent node.

cursive wren
#

Well you could technically do this with any database but you'd need a DBA or someone very knowledgeable with that technology to do.

This might be a solution.

Most managed solutions will just replicate the data accross regions.

#

It looks like cockroachdb allows you to do that easily

#

Nevermind, apparently AWS offers data residency for their solutions

#

You could dig that

#

Just try to keep all the data consistent and easily accessible, reducing the complexity is major

glad lynx
#

@umbral orchid What would be those cross region relationships?