skip to Main Content

I am coming from ‘Google App Engine land’ where the the result of a query could be stored in a memcache; it allows granular control of what queries or objects are being stored. This is helpful for reducing the cost of frequently requested and large queries. If I am correct, it is not the same in Firestore.

AFAIK, Firestore’s memcache automatically choose what to cache in order to increase performance and reduce cost. How does memcache differ between Firestore and Google App Engine

2

Answers


  1. Neither Firestore nor Datastore provide “native” a cache implementation. The datastore/memcache integration in GAE is not a given feature, its mostly provided by data access frameworks like Objectify which are still scrmabling to update implementations to the new API ( switching from Datastore to Firestore in datstore mode!).

    The good news is that if your queries are still coming from an App engine instance you should have no problem implementing some “interceptor” to check for cache values before going to the DB, unfortunately you’ll be responsable for updating, checking and purging that data manually from memcache.

    Login or Signup to reply.
  2. Firestore (and Firebase in general) do not have a memcache, but you can use it with Google’s cloud memorystore memcache service or any other. And I think this is better because it is just a redis service, with fully compatible redis API, whereas the memcache in GAE was proprietary.

    I would also note that the new GAE flexible environments drop the GAE memcache so I guess even GAE itself is transitioning away from the proprietary memcache.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search