Can I disable data replication in Datastore multi region location? - google-cloud-datastore

I want to use Datastore (Firestore in Datastore mode) in europe-west1. Since Datastore is not available as a regional location in europe-west1 I will go with the multi-region location (which consists of europe-west1 and europe-west4 according to this doc).
Do I understand data replication correctly in that if I store data in Datastore, Google automatically stores all the data in both regions europe-west1, europe-west4?
Can I disable data replication in europe-west4 since I just want to use Datastore in europe-west1?
Also just for my understanding: If multi-regional means there is a Data Center in each region why are both not available as single regional location?
Any help is appreciated.

The multi-region in GCP makes all the data replication automatically and this is by design, so that you have higher availability, performance, and resource efficiency and this is out of your control, so you can't disable data replication in a multi-region environment.
To your second question there is nothing that justifies this in the documentation, so I assume unofficially that this happens because Google simply does not allow for individual regions for that particular reason because it's not the focus of that particular region and acts just as a replicated location for that particular product when set to multi-region.

Related

Firebase limits me to set my database to one region permanently, how do I serve people from other regions with low latency?

So I have set the location of my Firestore database to asia-south-1, let suppose now I start getting users from the US as well as from India, how will I serve both the groups with lower latency?
You can't change the properties of your project once it's set up, nor even simply pay more for better service. If you want improved service in different regions, you will need to buy computing resources in each of those regions. This requires setting up multiple projects, with each Firestore product configured for the region you want improved service. Note that not all Firebase and GCP products are available in all regions.
If you want all users in all regions to be using the same set of data with improved latency, that's not possible to configure. You will have to build a way to mirror data between the different projects. There is nothing terribly easy about that, nor are there any existing solutions offered by Firebase or GCP to do this for you.
Doug nailed it for Firestore. So 👍
Note that Firebase's Realtime Database (unlike Firestore) can have multiple databases per project, which means you can set up a database instances in each region (it support three right now) and redirect your user's traffic to the region closest to them. You may still have to replicate data between the database instances, similar to Doug's answer, but (unlike in Doug's answer) with Realtime Database this can happen within a single project.

Change Firebase Firestore Server location [duplicate]

I'm working on a product which for legal reasons needs to store user data in a specific region.
I'm using Firebase so I created a project selecting the region it needs to be in however looking at firestore where the user data is kept I can't find anything pinpointing the region the data actually is. The thing which makes me worry the most is the Cloud Functions endpoints start with us-central1 but obviously that could just be that cloud functions don't exist in the specified region.
Given this is an important matter is there a way to confirm the location of data and even force it to be in a specific region?
Update
Cloud Firestore supports the following regional GCP resource locations, in addition to the 2 multi-region (nam5, eur3) locations:
See the documentation for an up-to-date list of locations.
Original Answer
Cloud Firestore is currently only available in our US multi-region (Iowa, Oklahoma, South Carolina). As we approach GA we plan to roll it out to multiple locations across the globe and you'll be able to select which one at creation time. Not something you can do today though.

Firebase Scalability - More than 100k user at the same time and across multiple region

I know scalability is not an issue in Firebase and supports up to 100k Simultaneous connections(in general).
Based on pricing documentation:
You can create multiple database instances to go beyond the 100K
concurrent limit. See Pricing FAQ for more information.
Question 1: What if there is more than 200k users using simultaneously on the same database? The other half of the users could not query, connect or the request will be placed in queue?
(As a Firebase plan subscriber, I would like to know how Firebase deals with the problem to ensure the quality of the services provided to our customers are always in top-notch)
Since, App globalisation is common nowadays and many companies' practices are to have servers across multiple regions to provide better and stable performance. Online game for example which required low latency.
As for now, the firebase user is required to set the default location when creating the project which is non-editable afterward. Some issues even rises where the users realised they deployed their app to the wrong regions and do not have clues on how to change the regions.
This represents the country/region of your organisation/company. Your
selection also sets the appropriate currency for your revenue
reporting. The selected country does not determine the location of
your data for Firebase features. Google may process and store Customer
Data anywhere Google or its agents maintain facilities.
Question 2: Will or does Firebase provide a solution / tailor-made to such practice which having our database in multiple regions while having a headquartered region and multiple other regions sharing all the databases, functions and auth across the regions?
(For now to have multiple servers location, we have to create different projects and the user and data syncing will be a problem)
Hope the language does not offend, cheers!
It seems like your question (or at least your assumptions) is based on the Firebase Realtime Database, so I'll answer for that below.
Q1) You can create more than 2 databases in a single project, each of which allows 100K connections. So it can scale beyond 200K connections. All of these are hosted in the same region though, so you can't use each database for a separate region.
Q2) For a database solution that handles multiple regions, I'd recommend looking at Cloud Firestore. Also see: Cloud Firestore - selecting region to store data?

Cloud Firestore - selecting region to store data?

I'm working on a product which for legal reasons needs to store user data in a specific region.
I'm using Firebase so I created a project selecting the region it needs to be in however looking at firestore where the user data is kept I can't find anything pinpointing the region the data actually is. The thing which makes me worry the most is the Cloud Functions endpoints start with us-central1 but obviously that could just be that cloud functions don't exist in the specified region.
Given this is an important matter is there a way to confirm the location of data and even force it to be in a specific region?
Update
Cloud Firestore supports the following regional GCP resource locations, in addition to the 2 multi-region (nam5, eur3) locations:
See the documentation for an up-to-date list of locations.
Original Answer
Cloud Firestore is currently only available in our US multi-region (Iowa, Oklahoma, South Carolina). As we approach GA we plan to roll it out to multiple locations across the globe and you'll be able to select which one at creation time. Not something you can do today though.

How to selectively replicate kind(tables) in google cloud datastore to multiple regions

How to selectively replicate kinds(tables) in google cloud datastore to multiple regions.
As I understand, one can create a google datastore one per project with multiple kinds.
Also while creating this datastore instance within the project, it asks right away which region you want to replicate to.
What if I want to replicate kind1 to USA region and kind2 to USA and EU region? is it possible?
Or do i have to create multiple projects with such respective policy for replication and manage it externally from another project which has the app.
I did try to dig into other posts and documentation on gcloud but did not get a clear answer.
Thanks in advance.
For having replicated kinds in Google Cloud Datastore to multiple regions (ie. USA and EU), you should have two different Cloud Datastore across two different projects and take care of replicating the data/kinds across these applications yourself (for example by defining a cron job) as answered in this post.
Also you could use Google Cloud Storage for unstructured data (for example backup storage), which supports Multi-Regional buckets and synchronize data across regions automatically.
Here you could find helpful guide for choosing storage options in GCP.

Resources