@@ -16,16 +16,17 @@ The primary differences come from:
1616## Bootstrapping
1717
1818The biggest difference is in establishing a runtime context for your NDB
19- application. In the Google App Engine environment, Legacy NDB could just
20- shoehorn the runtime context onto the current HTTP request. Decoupling NDB from
21- GAE, means we can't assume we're running in the context of a GAE request.
22-
23- To deal with this, the `` Client `` class has been introduced which by and large
24- works the same as Datastore's `` Client `` class and uses `` google.auth `` for
25- authentication. While this is different from how Legacy NDB worked, this is
26- consistent with how APIs in Google Cloud Platform work. You can pass a
27- `` credentials `` parameter to `` Client `` or use the
28- `` GOOGLE_APPLICATION_CREDENTIALS `` environment variable (recommended).
19+ application. The Google App Engine Python 2.7 runtime had a strong assumption
20+ that all code executed inside a web framework request-response cycle, in a
21+ single thread per request. In order to decouple from that assumption, Cloud NDB
22+ implements explicit clients and contexts. This is consistent with other Cloud
23+ client libraries.
24+
25+ The `` Client `` class has been introduced which by and large works the same as
26+ Datastore's `` Client `` class and uses `` google.auth `` for authentication. You
27+ can pass a `` credentials `` parameter to `` Client `` or use the
28+ `` GOOGLE_APPLICATION_CREDENTIALS `` environment variable (recommended). See
29+ [ https://cloud.google.com/docs/authentication/getting-started ] for details.
2930
3031Once a client has been obtained, you still need to establish a runtime context,
3132which you can do using the `` Client.context `` method.
@@ -217,12 +218,11 @@ that are affected are: `memcache_add`, `memcache_cas`, `memcache_decr`,
217218
218219## Privatization
219220
220- One thing legacy NDB didn't do very well, was distinguishing between internal
221- private and external public API. A few bits of the nominally public API
222- have been found to be * de facto* private. These are pieces that are omitted
223- from public facing documentation and which have no apparent use outside of NDB
224- internals. These pieces have been formally renamed and moved to be internally
225- facing, private API:
221+ App Engine NDB exposed some internal utilities as part of the public API. A few
222+ bits of the nominally public API have been found to be * de facto* private.
223+ These are pieces that are omitted from public facing documentation and which
224+ have no apparent use outside of NDB internals. These pieces have been formally
225+ renamed as part of the private API:
226226
227227- ` eventloop ` has been renamed to ` _eventloop ` .
228228- ` tasklets.get_return_value ` has been renamed to ` tasklets._get_return_value `
0 commit comments