Share datastore between GAE (ndb) and GCE (gcloud.datastore) in a test environment

I have an app app app for Python using a datastore with the ndb API, and I want to do background work and store the results in a data store, so appengine uses it.

I wanted to use GCE or my computer to do this, but the ndb API is not available outside of appengine, and the alternative seems to be the gcloud.datastore API, which is very different.

How do you guarantee that what you click (with the gcloud API) matches what you get (i.e. matches the ndb object)?

I cannot run unit tests because the local server is not the same (gcd vs dev_appserver). Here is a workaround (but in Java).

Should I replace ndb code with gcloud.datastore in appengine to ensure consistency (but lose the benefits of ndb, such as automatic caching ...)?

Is there an obvious solution that I am missing? If someone had the same problem, how did you deal with it?

thanks

+4
source share
1 answer

, ndb, , , API App Engine, (HTTP) . , , , , GAE - GCE.

, API ndb API , , App Engine, App Engine ( Google Compute Engine).

gcloud.datastore (gcloud-python) API , , . , ndb (, , , , ), ndb Python, , .

+3

Source: https://habr.com/ru/post/1613438/


All Articles