Awesome Open Source
Awesome Open Source


Build Status Coverage Status GoDoc

Package is a datastore API for the Google App Engine (GAE) Go Runtime Environment that uses memcache to cache all datastore requests. It is compatible with both Classic and Managed VM products. This package guarantees strong cache consistency when using nds.Get* and nds.Put*, meaning you will never get data from a stale cache.

Exposed parts of this API are the same as the official one distributed by Google ( However, underneath uses a caching stategy similar to the GAE Python NDB API. In fact the caching strategy used here even fixes one or two of the Python NDB caching consistency bugs.

You can find the API documentation at

One other benefit is that the standard datastore.GetMulti, datastore.PutMulti and datastore.DeleteMulti functions only allow you to work with a maximum of 1000, 500 and 500 entities per call respectively. The nds.GetMulti, nds.PutMulti and nds.DeleteMulti functions in this package allow you to work with as many entities as you need (within timeout limits) by concurrently calling the appropriate datastore function until your request is fulfilled.

How To Use

You can use this package in exactly the same way you would use However, it is important that you use nds.Get*, nds.Put*, nds.Delete* and nds.RunInTransaction entirely within your code. Do not mix use of those functions with the equivalents as you will be liable to get stale datastore entities from

Ultimately all you need to do is find/replace the following in your codebase:

  • datastore.Get -> nds.Get
  • datastore.Put -> nds.Put
  • datastore.Delete -> nds.Delete
  • datastore.RunInTransaction -> nds.RunInTransaction


Versions are specified using Go Modules.

  • Version 1.x.x: Can be found on branch master and uses the package.
  • Version 2.x.x: Can be found on branch v2. This is a major update and takes advantage of the new package provided by Google. It currently in an experimental state and we welcome contributions.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
go (15,379
datastore (29
appengine (26
memcache (25