0

I am setting up a relationship where two Google App Engine applications (A and B) need to share data. B needs to read data from A, but A is not directly accessible to B. Both A and B currently use Google Datastore (NOT persistent disk).

I have an idea where I take a snapshot of A's state and upload it to a separate Google Cloud Storage location. This location can be read by B.

Is it possible to take a snapshot of A using Google App Engine and upload this snapshot (perhaps in JSON) to a separate Google Cloud Storage location to be read from by B? If so, how?

kevherro
  • 1
  • 1
  • 2

1 Answers1

0

What you're looking for is the Datastore managed export/import service:

This page describes how to export and import Cloud Firestore in Datastore mode entities using the managed export and import service. The managed export and import service is available through the gcloud command-line tool and the Datastore mode Admin API (REST, RPC).

You can see a couple of examples described in a bit more details in these more or less related posts:

You may need to take extra precautions:

  • if you need data consistency (exports are not atomic)
  • to handle potential conflicts in entity key IDs, especially if using manually-generated ones or referencing them in other entities

If A is not directly accessible to B isn't actually something intentional and you'd be OK with allowing B to access A then that's also possible. The datastore can be accessed from anywhere, even from outside Google Cloud (see How do I use Google datastore for my web app which is NOT hosted in google app engine?). It might be a bit tricky to set it up, but once that's done it's IMHO a smoother sharing approach than the export/import one.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97