2
votes

I have been going through the Google App Engine documentation (Python) now and found two different types of storage.

  1. NDB Datastore
  2. DB Datastore

Both quota limits (free) seem to be same, and their database design too. However NDB automatically cache data in Memcache!

I am actually wondering when to use which storage? What are the general practices regarding this?

Can I completely rely on NDB and ignore DB? How should it be done?

I have been using Django for a while and read that in Django-nonrel the JOIN operations can be somehow done in NDB! and rest of the storage is used in DB! Why is that? Both storages are schemaless and pretty well use same design.. How is that someone can tweak JOIN in NDB and not in DB?

1
to be clear, there is only one datastore. there are just 2 apis. db is the original api, ndb is a more recent one with a heist of added features. if you're starting an app from scratch - use ndbGwyn Howell
You should link to where you apparently read that about nonrel. Actually it seems you completely misunderstood whatever you read.Daniel Roseman

1 Answers

5
votes

In simple words these are two versions of datastore . db being the older version and ndb the newer one. The difference is in the models, in the datastore these are the same thing. NDB provides advantages like handling caching (memcache) itself. and ndb is faster than db. so you should definitely go with ndb. to use ndb datastore just use ndb.Model while defining your models