This page provides an overview of data cache, our recommendations on choosing workloads on which to enable data cache,
and the limitations of using a data cache.
Data cache is an optional feature that stores data pages on high-speed local solid state drives (SSD) to accelerate query processing. Data cache extends the MySQL buffer pool to use both the memory and the local SSD.
When you enable data cache on your instance, this is how Cloud SQL
processes read and write requests:
Read request: Cloud SQL prioritizes reading data from the main memory,
followed by the data cache, and then the instance's storage.
This allows for the read operations to be processed with the lowest possible latency.
Write request: Cloud SQL commits the data to the instance's
storage and simultaneously writes it to the data cache.
Recommendations
Data cache provides performance benefits for certain workload types.
We recommend that you enable data cache for the following workload types:
Workloads where the working dataset doesn't fit in the main memory.
Using a data cache delivers maximum performance benefits when the entire working dataset can't fit in the instance's main memory.
In this scenario, Cloud SQL stores the working dataset in the main memory and the data cache.
The working dataset is generally smaller than the full dataset.
Workloads with 16 or more vCPUs.
Using a data cache generally provides more performance benefits for workloads with 16 or more vCPUs.
Workloads with more read operations than write operations.
Use a data cache for workloads that are predominantly made up of read operations.
Limitations
When a data cache becomes full, it removes the stored data based on the least recently used
analysis to accommodate subsequent updates to the data cache.
If there's a user- or system-triggered shutdown or restart, then the contents of the
data cache are available on restart. However, if the primary instance performs maintenance or encounters
an unexpected shutdown, such as in a failover operation, then the contents of the data cache are lost.
This can lead to reduced performance while the data cache is repopulated.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Data cache overview\n\n\u003cbr /\u003e\n\nMySQL \\| [PostgreSQL](/sql/docs/postgres/data-cache \"View this page for the PostgreSQL database engine\") \\| [SQL Server](/sql/docs/sqlserver/data-cache \"View this page for the SQL Server database engine\")\n\n\u003cbr /\u003e\n\n\n| **Note:** This page contains features related to Cloud SQL editions. For more information about Cloud SQL editions, see [Introduction to Cloud SQL editions](/sql/docs/mysql/editions-intro).\n\n\u003cbr /\u003e\n\nThis page provides an overview of data cache, our recommendations on choosing workloads on which to enable data cache,\nand the limitations of using a data cache.\n\nData cache is an optional feature that stores data pages on high-speed local solid state drives (SSD) to accelerate query processing. Data cache extends the MySQL buffer pool to use both the memory and the local SSD.\n\nYou can enable data cache when you [create an instance](/sql/docs/mysql/create-instance).\n\nYou can also enable or disable data cache on an existing instance with\n[near-zero downtime](/sql/docs/mysql/availability#enterprise-plus-availability).\n\nTo change the data cache setting on your instance,\nsee [edit an instance](/sql/docs/mysql/edit-instance) and\n\n[instance settings](/sql/docs/mysql/instance-settings#data-cache).\n\n\nWhen you enable data cache on your instance, this is how Cloud SQL\nprocesses read and write requests:\n\n- Read request: Cloud SQL prioritizes reading data from the main memory,\n followed by the data cache, and then the instance's storage.\n This allows for the read operations to be processed with the lowest possible latency.\n\n- Write request: Cloud SQL commits the data to the instance's\n storage and simultaneously writes it to the data cache.\n\nRecommendations\n---------------\n\nData cache provides performance benefits for certain workload types.\nWe recommend that you enable data cache for the following workload types:\n\n- Workloads where the working dataset doesn't fit in the main memory. Using a data cache delivers maximum performance benefits when the entire working dataset can't fit in the instance's main memory.\n In this scenario, Cloud SQL stores the working dataset in the main memory and the data cache.\n The working dataset is generally smaller than the full dataset.\n\n- Workloads with 16 or more vCPUs. Using a data cache generally provides more performance benefits for workloads with 16 or more vCPUs.\n\n- Workloads with more read operations than write operations. Use a data cache for workloads that are predominantly made up of read operations.\n\n| **Note:** When you switch an instance from Cloud SQL Enterprise Plus edition to Cloud SQL Enterprise edition, data cache is automatically disabled. Switching an instance to Cloud SQL Enterprise edition incurs some downtime.\n\nLimitations\n-----------\n\n- When a data cache becomes full, it removes the stored data based on the least recently used analysis to accommodate subsequent updates to the data cache.\n\n\u003c!-- --\u003e\n\n- If there's a user- or system-triggered shutdown or restart, then the contents of the data cache are available on restart. However, if the primary instance performs maintenance or encounters an unexpected shutdown, such as in a failover operation, then the contents of the data cache are lost. This can lead to reduced performance while the data cache is repopulated."]]