Caching : Cloud MemoryStore vs Cloud Firestore vs Realtime DB?

4.9k Views Asked by At

I have a small collection (100 docs) that will be updated periodically, Let's say every 5 minutes. Which solution would be faster to read this collection ? Firestore, Realtime DB, or MemoryStore (Reads are done from a Firebase app).

Actually I'm asking this because I read somewhere that cloud datastore use memcache as a front, and that led me to wonder if firestore has this kind of caching; if so, why not using memorystore directly.

Thx in advance for your feedback !

1

There are 1 best solutions below

2
On

Cloud MemoryStore should have the quickest response times (backend for Redis)... while it might depend what the purpose (application) of caching data may be; unless loading that data into a web-application (which is already backed by Redis - or shall be); it might only add useless complexity.

Cloud Memorystore is compatible with the Redis protocol, allowing easy migration with zero code changes.

For documents, Firestore should still provide sufficient performance, without additional caching... if any caching would make sense, then it would be caching query results, caching calculation results; eg. from domain aggregation SUM() and AVG(); there it would definitely make sense.