问题
I was reading this blog post. It make me wonder how data replication and fail overs handled in case of regional and multi-regional database projects. Article mentions that things are over-simplified a bit. But I hope there is certain truth to the point made in the article about data replication.
So my question is:
Lets say user is writing a social media app, where user in NY wants to look the profile of the user in Sydney.
Case 1: If I am using regional databases for this app (only regional database in every region)
Case 2: If I am using multi-regional databases for US and EU and regional database for others (Asia, Australia)
Is it possible for NY user to view the profile of the Sydney user in case 1, case 2? Is data replicated over continents in regional databases case?
Even if you use multi region databases which only available for US and EU for now. As I understood muti-region only replicated data within the regions of the same continent(NA, EU), not between continents. So how to build social media app to global market using Firestore?
回答1:
When you create a Firestore database in a project, you get to choose whether to:
Store the data in a single regional location.
In this case the data is stored in multiple data centers in a single geographical region. For example:
us-east4, which are data centers in Northern Virginia.Store the data in multi-region locations.
In this case the data is stored in multiple data centers across multiple geographical regions. For example:
nam5/us-central, which are data centers across the entire US.
For more on this, see the documentation on location types.
You will have to pick one of these options when you create the database. So you can't select a mix of of multi-region and single region locations.
All users of your app access the same data. When data is written, it is automatically replicated across all data centers in the region(s).
回答2:
Cloud Firestore data can be stored using a multi-region location or a regional location. Using "multi-region locations" simply means storing data at multiple regions, located on the same continent. EU and US are the two only choices. This means you cannot have data close to all users, globally.
来源:https://stackoverflow.com/questions/55389149/is-cloud-firestore-data-replicated-over-continents