DataCache lets you cache large datasets — such as machine learning models — on local storage before creating an elastic container instance. Mount the cached data when you launch the instance to shorten startup time and avoid repeated downloads.
How it works
DataCache decouples data from container images. Instead of bundling your data into an image, you create a DataCache that pulls the data independently. When you deploy an application, mount the DataCache alongside the image cache. If the data changes, re-create the DataCache — no image rebuild required.
When you mount a DataCache, ECI automatically creates a pay-as-you-go cloud disk whose capacity equals the DataCache size. Mounting uses HostPath. The cloud disk is created and released together with the elastic container instance.
Use cases
DataCache is a good fit when:
Your application relies on large datasets that are slow to download at startup
Data changes frequently and you want to avoid rebuilding container images on each update
You want to separate data lifecycle management from application image management
Example: deploying a machine learning model
| Step | Without DataCache | With DataCache |
|---|---|---|
| 1 | Download model data to dev environment | Create a DataCache to pull the model |
| 2 | Package model + app into a container image | Package the app only into a container image |
| 3 | Build image cache | Build image cache |
| 4 | Deploy application | Deploy using the image cache + DataCache |
When the model is updated, you only need to re-create the DataCache and remount it — no image rebuild, tag republish, or image cache recreation.


Limitations
Default DataCache size is 20 GiB. Creation fails if the data volume exceeds 20 GiB.
The cloud disk is released when the elastic container instance is deleted.
If you do not set a retention period, the DataCache is retained indefinitely and continues to incur snapshot costs.
Create a DataCache
Configure the following properties when creating a DataCache.
Storage path
Specify a bucket and storage path within that bucket. If no bucket is specified, ECI stores the DataCache in the bucket named default.
Data source
DataCache supports the following data sources:
| Type | Description |
|---|---|
| URL | A direct download link, or a model or dataset on ModelScope or Hugging Face |
| NAS | An Apsara File Storage NAS (NAS) file system |
| OSS | An Object Storage Service (OSS) bucket |
| SNAPSHOT | An Alibaba Cloud snapshot |
Size
Specify the size based on your actual data volume. The default size is 20 GiB. If your data exceeds the specified size, the DataCache creation fails.
Retention period
By default, a DataCache is retained indefinitely. Set a retention period if you do not plan to use the DataCache long-term, to avoid incurring unnecessary snapshot costs.
Billing
Creating a DataCache
ECI creates temporary resources — an elastic container instance and a cloud disk — and generates a snapshot based on the temporary resources. You are charged for the temporary resources and the snapshot.
Using a DataCache
ECI creates a cloud disk equal in size to the DataCache and mounts it to the elastic container instance. You are charged for the cloud disk and the elastic container instance.
For detailed pricing, see DataCaches.