Google-app-engine NDB
Asked Answered
H

1

20

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?

Haskell answered 1/4, 2012 at 11:49 Comment(2)
Either the internets are broken or Nick Johnson does not work on sundays... either way I lose...Haskell
Cripes, give me a chance! You only asked the question an hour ago. :)Acephalous
A
18

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.

Acephalous answered 1/4, 2012 at 13:15 Comment(3)
Just the info I needed, thanks. I have not gotten around to caching the result of queries. Do you know about any good source of information on this matter?Haskell
@KlausByskovHoffmann Not really - it depends entirely on the nature of your queries. If you can reliably invalidate the results, by all means cache them - or better, the end result (the generated page).Acephalous
Thanks. Well, I'm not sure that I can reliably invalidate the results in all cases, so I might be better of not caching query results at the moment. Anyway, thanks for your help, and great to see that you do indeed work on a sunday :-)Haskell

© 2022 - 2024 — McMap. All rights reserved.