Migrating from App Engine ndb to Cloud NDB

@wescpy
4 min readintermediate
--
View Original

Overview

The article discusses the migration process from the App Engine ndb client library to Cloud NDB, highlighting the benefits of using Cloud NDB for modernizing applications. It provides guidance through a video and codelab, emphasizing the seamless transition and the potential for further modernization.

What You'll Learn

1

How to migrate your application from App Engine ndb to Cloud NDB

2

Why transitioning to Cloud NDB is beneficial for modernizing applications

3

How to utilize the context manager in Cloud NDB for Datastore access

Prerequisites & Requirements

  • Familiarity with App Engine ndb and Cloud Datastore concepts
  • Basic experience with Python programming(optional)

Key Questions Answered

What are the main benefits of migrating to Cloud NDB?
Migrating to Cloud NDB allows developers to access new features and innovations in Cloud Datastore while preserving much of their existing code. It also facilitates modernization efforts, such as transitioning to Python 3 and breaking applications into microservices.
How does the migration process from App Engine ndb to Cloud NDB work?
The migration process involves using a context manager in Cloud NDB, which allows developers to maintain a similar code structure as in App Engine ndb. This minimizes changes needed in the existing codebase, making the transition smoother.
What resources are available for developers to assist with the migration?
Developers can access a corresponding codelab and video that provide hands-on experience with the migration process. These resources guide users through the steps necessary to successfully transition their applications to Cloud NDB.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Backend
Cloud Ndb
Used as the replacement client library for App Engine ndb, allowing access to Cloud Datastore.
Database
Cloud Datastore
The underlying database service that Cloud NDB interacts with.
Programming Language
Python
The primary programming language used for the migration and application development.

Key Actionable Insights

1
Utilize the provided codelab and video resources to guide your migration process.
These resources offer step-by-step instructions and hands-on experience, making it easier to understand the migration process and apply it to your own applications.
2
Consider the benefits of modernizing your application architecture by breaking it into microservices.
This approach can improve maintainability and scalability, allowing your application to better leverage cloud-native features.
3
Take advantage of the context manager feature in Cloud NDB to streamline your Datastore access.
Using context managers can help manage resources effectively and make your code cleaner and more Pythonic.

Common Pitfalls

1
Failing to properly utilize the context manager in Cloud NDB can lead to resource management issues.
Without using context managers, developers may encounter problems with database connections and resource leaks, which can affect application performance.

Related Concepts

Cloud Datastore
App Engine
Microservices Architecture
Python 3 Migration