With the recent release of NDB, is there any reason to keep using the old datastore API?
I'm working on an application that currently uses the old datastore API, and I have put quite some effort into caching objects in memcache. Am I correct in my understanding that, by changing to NDB, I can remove my custom caching, and still preserve my current performance?
Furthermore, does NDB in any way change the need for sharding counters? Is the limit of 5 writes per second to an entity(group) in some way changed in NDB?
EDIT
Given that my application is still under development and I have no entities that I cannot easily delete, is there something I should consider before changing to NDB, or would it be as easy as just changing db.Model
to ndb.Model
?
The Google Datastore NDB Client Library allows App Engine Python apps to connect to Datastore. The NDB client library builds on the older DB Datastore library adding the following data store features: The StructuredProperty class, which allows entities to have nested structure.
Use this RESTful API with any programming language to manage your App Engine applications.
App Engine is part of Google Cloud Platform, a suite of services for running scalable applications, performing large amounts of computational work, and storing, using, and analyzing large amounts of data.
An NDB tasklet is a piece of code that might run concurrently with other code. If you write a tasklet, your application can use it much like it uses an async NDB function: it calls the tasklet, which returns a Future ; later, calling the Future 's get_result() method gets the result.
The main reason to keep using the old API is for legacy applications. The NDB API is not entirely the same as the existing DB API, so you'll need to make changes to your code to use it. You're correct that you won't need to use your own caching code any longer, at least for get operations - if you're caching the results of queries, it will still be useful to keep that code.
NDB doesn't provide any means to get around the need to shard counters if you want to use high write rates on them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With