简体   繁体   中英

Google-app-engine NDB

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 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM