# Cache

## Memorystore

Memory Store is a fully managed in-memory cache service having protocol compatibility with Redis and Memcached. See documentations for [Memorystore Redis](https://cloud.google.com/memorystore/docs/redis/) and [Memorystore Memcached](https://cloud.google.com/memorystore/docs/memcached) (beta) for more information.

#### Zonal Resource

Memorystore is zonal, meaning each Memorystore instance is only available within a zone, or accessible from other zones within the same region. For high-availability, create a **Standard** tier instance, which includes a failover replica in a separate zone.

#### Connectivity

All Memorystore instances can only be accessed by a private IP on a VPC network. You can connect to a Memorystore instance from different Google Cloud Platform computing resources differently. In general, VM-based products (Compute Engine, Kubernetes Engine, and App Engine Flexible) requires the VM to be on the same VPC, and Serverless products requires [VPC Service Connector](https://cloud.google.com/vpc/docs/configure-serverless-vpc-access).

| Resource            | Method                                                                                             |
| ------------------- | -------------------------------------------------------------------------------------------------- |
| Compute Engine      | Out-of-the-box                                                                                     |
| Kubernetes Engine   | [VPC-Native cluster](https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips)             |
| App Engine Flexible | [Additional Configuration](https://cloud.google.com/appengine/docs/flexible/java/using-shared-vpc) |
| App Engine Standard | [VPC Service Connector](https://cloud.google.com/appengine/docs/standard/java11/connecting-vpc)    |
| Cloud Run           | [VPC Service Connector](https://cloud.google.com/run/docs/configuring/connecting-vpc)              |
| Cloud Function      | [VPC Service Connector](https://cloud.google.com/functions/docs/networking/connecting-vpc)         |

#### Protocol Compatibility

Because Memorystore is protocol compatible. You can use existing Spring Boot integration with Redis and Memcached as-is.

{% content-ref url="/pages/-MADiJMKwGFHIUmIY9Kl" %}
[Memorystore Redis](/app-dev/cloud-services/cache/memorystore-redis.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MADiM\_9RTTfDh\_qFZXY" %}
[Memorystore Memcached (beta)](/app-dev/cloud-services/cache/memorystore-memcached.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://spring-gcp.saturnism.me/app-dev/cloud-services/cache.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
