Data cache overview Stay organized with collections Save and categorize content based on your preferences.
Note: This page contains features related to Cloud SQL editions. For more information about Cloud SQL editions, seeIntroduction to Cloud SQL editions.
This page provides an overview of data cache andrecommendations for theworkloads that work best when data cache is enabled.This page also lists the limitations of data cache.
Data cache is an optional feature that stores data pages on high-speedlocal solid state drives (SSD) to accelerate query processing.Data cache extends theOS page cacheto use both the memory and the local SSD.You can enable data cache when youcreate a Cloud SQL Enterprise Plus edition instance.To change the data cache setting on your instance,seeedit an instance andinstance settings.
For instances that have data cache enabled, Cloud SQLprocesses read and write requests in the following manner:
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'sstorage 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 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 usedanalysis to accommodate subsequent updates to the data cache.
- The following operations on the instance erase the contents of the data cache and can lead to a drop in performance while the data cache is repopulated:
- Planned maintenance
- An unexpected shutdown (stopping the instance)
- A major version upgrade
- The instance switching from zonal to regional or from regional to zonal
- A change to the machine type for the instance
- The number of CPU cores determines the size of the SSD. You can't resize the SSD independently.
- Fine-grained caching (for example, table-level caching or query-level caching) isn't supported.
- The data cache doesn't use thebuffer pool extension.
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 2025-12-17 UTC.