2
votes

We have an existing application on Python 2.7 on Google app engine standard. We are planning to migrate the application to python 3.7 because of end of support for python 2.7.

We use ndb library to access datastore.

According to documentation here it says we should "consider" using Cloud NDB instead of Datastore mode client library.

My question - is "Datastore mode client library" an option for applications migrating from python2.7 / ndb datastore to python 3.7/Firestore Datastore mode? Can I use it instead of "Cloud NDB"? The reason being, if we are going through migration to python 3.7 we might as well use the latest library (Datastore model client library) instead of "Cloud NDB".

2

2 Answers

4
votes

Cloud NDB is designed to be as close as possible to a drop-in replacement for App Engine NDB, to ease migration for existing users. It is essentially a compatibility layer for the NDB library API built on top of the Datastore mode client library. If you'd prefer to skip the NDB layer entirely and use the Datastore mode client library directly, you can certainly do so.

3
votes

NDB is currently being "upgraded" to work with Python 3.7. It's currently in beta and so definitely not recommended for production purposes even though it's pretty much in an advanced state. You won't be able to just drop it in without any adjustments since some "deep" features are being discarded but you still might get satisfied with it's current state. Consider exploring the source code : https://github.com/googleapis/python-ndb