user257543
user257543

Reputation: 891

Is there a caching library for google datastore api in node.js

I'm looking into using gcloud node api to access the datastore api but was curious if it supported query caching in a similar manner to ndb? If not, what's the best way to make sure repeated queries are cached?

Upvotes: 3

Views: 1052

Answers (3)

user257543
user257543

Reputation: 891

I ended up using NsqlCache-datastore which is integrated into gstore-node. Guide: https://medium.com/google-cloud/how-to-add-a-cache-layer-to-the-google-datastore-in-node-js-ffb402cd0e1c

Upvotes: 1

JJ Geewax
JJ Geewax

Reputation: 10579

As far as I know, gcloud-node isn't planning to be a full-on ORM (like ndb is for Python). Also, as Patrick Costello noted in the comments above, NDB doesn't cache query results, but individual entities instead.

I think if you want caching of query results (or individual entities), you'd have to manually cache these by running your own Memcache server (http://memcached.org/) and interacting with it using memcached (https://www.npmjs.com/package/memcached)

Upvotes: 1

user257543
user257543

Reputation: 891

Looks like I can use the memcache app engine service accessible through this node library: https://github.com/GoogleCloudPlatform/appengine-nodejs

Upvotes: 0

Related Questions