20
votes

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?

1
Either the internets are broken or Nick Johnson does not work on sundays... either way I lose... - Klaus Byskov Pedersen
Cripes, give me a chance! You only asked the question an hour ago. :) - Nick Johnson

1 Answers

18
votes

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.