Skip to main content

Memorystore

Exam guide§2.2
Memorystore

Fully managed in-memory cache for Redis or Memcached. Sub-millisecond reads, sits in front of a database or app. Pick when you see "cache", "reduce database load", "session store", or "sub-millisecond latency".

Google runs the infrastructure and automates the operational toil - high availability, failover, patching, and monitoring - so you write application code instead of managing Redis deployments. Start on the lowest tier and smallest size, then scale the instance up with minimal impact to availability.

Common uses: caching product catalogs, user sessions, and API responses - values read far more often than they change. The app checks the cache first and only a miss touches the slower durable database.

1. readhit → sub-ms2. miss → DB3. populateApplicationMemorystorein-memory cacheDatabaseCloud SQL, Spanner, …
Cache-aside pattern: the app checks Memorystore first. A cache hit returns in the sub-millisecond range; a cache miss falls back to the database, then the result is written into Memorystore so the next read is a hit.
GotchaA cache, not a system of record

Memorystore data lives in memory and is lost on restart. It caches what a durable database owns - never make it the source of truth for critical data. If a scenario needs persistent storage, Memorystore is the wrong answer even when it wins on latency.

Appsingle endpointMemorystore for Redis · HA instance99.9% SLAZone APrimaryread + writeZone BReplicapromoted on failoverreplication
A high-availability Redis instance replicates the primary across two zones. Your app talks to a single endpoint; on a zone outage the replica is promoted automatically - no connection change - backing the 99.9% availability SLA.
DECISIONRedis or Memcached in Memorystore?
Persistence, replication, HA, data structures (lists/sets), pub/subRedis
Simple, pure volatile key-value cache, horizontal shardingMemcached
Pick this when: Redis unless you only need a plain volatile cache
NumbersMemorystore for Redis limits
  • Latency: sub-millisecond reads and writes.
  • HA instance: replicated across 2 zones, 99.9% availability SLA.
  • Max instance size: up to 300 GB.
  • Network throughput: up to 12 Gbps.
GotchaLift-and-shift, no code changes

Memorystore for Redis is fully compatible with the Redis protocol, so you migrate from open-source Redis with the import/export feature and no code changes. Existing tools and client libraries just work - there is nothing new to learn.

0%0 of 147 pages studied