Overview
The article discusses the migration process from Cloud NDB to Cloud Datastore, emphasizing the benefits of consolidating app code to a single client library. It highlights the optional nature of this migration for developers currently using Cloud NDB or App Engine ndb, and provides resources for a sample migration.
What You'll Learn
1
How to migrate a sample app from Cloud NDB to Cloud Datastore
2
Why consolidating to a single client library can improve application stability
3
When to consider migrating from Cloud NDB to Cloud Datastore
Prerequisites & Requirements
- Familiarity with Cloud NDB and Cloud Datastore
- Experience with Python programming
Key Questions Answered
What is the purpose of migrating from Cloud NDB to Cloud Datastore?
The migration from Cloud NDB to Cloud Datastore allows developers to consolidate their application code to use a single client library for accessing Datastore, improving code stability and maintainability. This is particularly beneficial for those transitioning from legacy App Engine services.
How does the object model of Cloud NDB compare to Cloud Datastore?
Cloud NDB follows an object model similar to App Engine ndb, making it familiar for long-time Python App Engine developers. In contrast, the Cloud Datastore client library operates more like a JSON document store, which may differ in querying styles.
What resources are available for developers considering this migration?
Developers can access a corresponding codelab and video guidance to assist with the migration process. The codelab provides sample code for both Python 2 and Python 3, allowing users to practice the migration before applying it to their applications.
Technologies & Tools
Backend
Cloud Ndb
Used as a transition tool for Python 2 App Engine developers to access Datastore.
Backend
Cloud Datastore
The target database for migration, offering a standalone product for application data storage.
Key Actionable Insights
1Consolidating to a single client library can enhance application stability and reduce complexity.By using one library to access Datastore, developers can streamline their codebase, making it easier to maintain and debug. This is especially important for teams managing multiple applications with different libraries.
2Consider testing the migration on a sample app before applying changes to production systems.Using the provided codelabs and sample code allows developers to understand the migration process and identify potential issues in a controlled environment, minimizing risks during the actual migration.
Common Pitfalls
1
Failing to evaluate the necessity of migration if existing applications are stable.
Developers may rush into migration without considering whether the new features of Cloud Datastore are essential for their current applications, leading to unnecessary complexity.