Manage persistence Stay organized with collections Save and categorize content based on your preferences.
This page explains how to perform common tasks for AOF and RDB persistence.
For more information about persistence, seePersistence overview.
RDB persistence tasks
This section gives instructions for common RDB persistence tasks.
Create an instance that uses RDB persistence
Console
In theData persistence strategy section, select theMemory Snapshot optionwhenCreating an instance.
Select a snapshot interval from theSnapshot interval menu.
Select a start time from theStart time (local time) menu. Local timeis the time where you are located.
gcloud
To create an instance that uses RDB persistence, run thecreate command:
gcloud memorystore instances createinstance \ --location=region-id \ --endpoints='[{"connections": [{"pscAutoConnection": {"network": "projects/PROJECT_ID/global/networks/NETWORK_ID", "projectId": "PROJECT_ID"}}]}]' \ --replica-count=replica-count \ --node-type=node-type \ --shard-count=shard-count \ --persistence-config-mode=rdb \ --rdb-config-snapshot-period=snapshot-interval \ --rdb-config-snapshot-start-time=timeReplace the following:
instance is the ID of the Memorystore for Valkey instance you're creating. Your instance ID must be 1 to 63 characters and use only lowercase letters, numbers, or hyphens. It must start with a lowercase letter and end with a lowercase letter or number.
region-id is the region where you want the instance placed.
project-id is the ID of the project where you want to createyour instance.
network-id is the ID of the network you want to use to createyour instance.
replica-count is the number of replicas (per shard). Acceptedvalues are
0-5.node-type is your chosen node type. Accepted values are:
shared-core-nanostandard-smallhighmem-mediumhighmem-xlarge
shared-core-nanonode type for development or testing purposesonly because this node type has no SLA. If you run Memorystore for Valkey in aproduction environment, then we recommend using thestandard-small,highmem-medium, orhighmem-xlargenode types. For moreinformation about these node types, seeChoose a node type.shard-count determines the number of shards in your instance. Shard count determines the total memory capacity for storing instance data. For more information about instance specification, seeInstance and node specification.
snapshot-interval is your chosen interval. Accepted values are
1h,6h,12h, and24h. The default value is24h.time is the start time of your RDB snapshot in the ISO 1801 format. For example:
2024-04-08T03:00:00Z. If you don't choose a start time when creating an instance that uses RDB persistence, the first snapshot is taken immediately.
Enable RDB persistence for an existing instance
Note: If you enable or disable persistence for an existing instance, then the instance might need to performmaintenance.Console
Go to theMemorystore for Valkey page in the Google Cloud console.
Click your instance ID.
In theConfigurations section, click the pencil icon next toPersistence.
Select theMemory Snapshot option.
Select a snapshot interval from theSnapshot interval menu.
Select a start time from theStart time (local time) menu. Local timeis the time where you are located.
Click theUpdate Instance button.
gcloud
To enable RDB persistence for an existing instance, run theupdate command:
gcloud memorystore instances updateinstance \ --location=region-id \ --persistence-config-mode=rdb \ --rdb-config-snapshot-period=snapshot-interval \ --rdb-config-snapshot-start-time=time
Replace the following:
instance is the ID of the Memorystore for Valkey instance you're creating. Your instance ID must be 1 to 63 characters and use only lowercase letters, numbers, or hyphens. It must start with a lowercase letter and end with a lowercase letter or number.
region-id is the region where you want the instance placed.
snapshot-interval is your chosen interval. Accepted values are
1h,6h,12h, and24h. The default value is24h.time is the start time of your RDB snapshot in the ISO 1801 format. For example:
2024-04-08T03:00:00Z. If you don't choose a start time when enabling RDB persistence on an existing instance, the first snapshot is taken immediately.
Adjust RDB snapshot interval
Console
Go to theMemorystore for Valkey page in the Google Cloud console.
Click your instance ID.
In theConfigurations section, click the pencil icon next toPersistence.
Select your chosen snapshot interval from theSnapshot interval menu.
Click theUpdate Instance button.
gcloud
To adjust the RDB snapshot interval, run theupdate command:
gcloud memorystore instances updateinstance \ --location=region-id \ --rdb-config-snapshot-period=snapshot-interval
Replace the following:
snapshot-interval is your chosen interval. Accepted values are
1h,6h,12h, and24h. The default value is24h.time is your chosen start time in the ISO 1801 format. For example:
2024-04-08T03:00:00Z.
Adjust the RDB snapshot start time
Console
Go to theMemorystore for Valkey page in the Google Cloud console.
Click your instance ID.
In theConfigurations section, click the pencil icon next toPersistence.
Select your chosen start time from theStart time (local time) menu.Local time is the time where you are located.
Click theUpdate Instance button.
gcloud
To adjust the RDB snapshot start time, run theupdate command. Changing the start time also changes the snapshot alignment time. For example, if you change the start time from 6:00 AM to 6:30 AM, with a snapshot frequency of1h, future snapshots align at 7:30 AM, 8:30 AM, 9:30 AM and every hour after that.
gcloud memorystore instances updateinstance \ --location=region-id \ --rdb-config-snapshot-start-time=time
Replace the following:
- time is your chosen start time in the ISO 1801 format. For example:
2024-04-08T03:00:00Z.
Pause RDB persistence
gcloud
To pause RDB persistence, you must set the snapshot schedule to a future time. When you want to unpause snapshots, you can re-adjust the time to when you want the next snapshot to occur.
To pause RDB snapshots, run theupdate command:
gcloud memorystore instances updateinstance \ --location=region-id \ --rdb-config-snapshot-start-time=time
Replace the following:
- time is your chosen start time in the ISO 1801 format. For example:
2024-04-08T03:00:00Z.
Disable RDB persistence
Console
Go to theMemorystore for Valkey page in the Google Cloud console.
Click your instance ID.
In theConfigurations section, click the pencil icon next toPersistence.
Select theNo persistence option.
Click theUpdate Instance button.
gcloud
To disable RDB persistence, run theupdate command:
gcloud memorystore instances updateinstance \ --location=region-id \ --persistence-config-mode=disabled
Monitor RDB persistence
You can useCloud Monitoring to view metrics for RDB persistence.
For a list of available metrics for RDB persistence, seepersistence metrics.
AOF persistence tasks
This section gives instructions for common AOF persistence tasks.
Create an instance that uses AOF persistence
Console
In theData persistence strategy section, select theAppend Only File (AOF) optionwhenCreating an instance.
Select a sync setting from theAOF Fsync mode menu.
gcloud
To create an instance that uses AOF persistence, run thecreate command:
gcloud memorystore instances createinstance \ --location=region-id \--endpoints='[{"connections": [{"pscAutoConnection": {"network": "projects/PROJECT_ID/global/networks/NETWORK_ID", "projectId": "PROJECT_ID"}}]}]' \ --replica-count=replica-count \ --node-type=node-type \ --shard-count=shard-count \ --persistence-config-mode=aof \ --aof-config-append-fsync=fsync-frequencyReplace the following:
instance is the ID of the Memorystore for Valkey instance you're creating. Your instance ID must be 1 to 63 characters and use only lowercase letters, numbers, or hyphens. It must start with a lowercase letter and end with a lowercase letter or number.
region-id is the region where you want the instance placed.
project-id is the ID of the project where you want to createyour instance.
network-id is the ID of the network you want to use to createyour instance.
replica-count is the number of replicas (per shard). Acceptedvalues are
0-5.node-type is your chosen node type. Accepted values are:
shared-core-nanostandard-smallhighmem-mediumhighmem-xlarge
shared-core-nanonode type for development or testing purposesonly because this node type has no SLA. If you run Memorystore for Valkey in aproduction environment, then we recommend using thestandard-small,highmem-medium, orhighmem-xlargenode types. For moreinformation about these node types, seeChoose a node type.shard-count determines the number of shards in your instance. Shard count determines the total memory capacity for storing instance data. For more information about instance specification, seeInstance and node specification.
fsync-frequency is yoursync setting. Accepted values are
always,everysec, andno.everysecis the default for this parameter.
Enable AOF persistence for an existing instance
Note: If you enable or disable persistence for an existing instance, then the instance might need to performmaintenance.Console
Go to theMemorystore for Valkey page in the Google Cloud console.
Click your instance ID.
In theConfigurations section, click the pencil icon next toPersistence.
Select theAppend Only File (AOF) option.
Select a sync setting from theAOF Fsync mode menu.
Click theUpdate Instance button.
Replace the following:
- fsync-frequency is yoursync setting. Accepted values are
always,everysec, andno.everysecis the default for this parameter.
Adjust the AOF sync setting for your instance
Console
Go to theMemorystore for Valkey page in the Google Cloud console.
Click your instance ID.
In theConfigurations section, click the pencil icon next toPersistence.
Select your chosen sync setting from theAOF fsync mode menu.
Click theUpdate Instance button.
gcloud
To adjust the sync setting for an instance that uses AOF persistence, run theupdate command:
gcloud memorystore instances updateinstance \ --location=region-id \ --aof-config-append-fsync=fsync-frequency
Replace the following:
- fsync-frequency is yoursync setting. Accepted values are
always,everysec, andno.everysecis the default for this parameter.
Disable AOF persistence
Console
Go to theMemorystore for Valkey page in the Google Cloud console.
Click your instance ID.
In theConfigurations section, click the pencil icon next toPersistence.
Select theNo persistence option.
Click theUpdate Instance button.
gcloud
To disable AOF persistence, run theupdate command:
gcloud memorystore instances updateinstance \ --location=region-id \ --persistence-config-mode=disabled
Monitor AOF persistence
You can useCloud Monitoring to view metrics for AOF persistence.
For a list of available metrics for AOF persistence, seepersistence metrics.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.