Lake storage is a fully managed storage layer in AnalyticDB for MySQL that handles data lake construction, metadata governance, and storage optimization automatically. Use it when you need a single layer that supports both offline batch processing and real-time analytics without managing the underlying infrastructure.
With lake storage, you can:
Store structured table data in open formats (Iceberg, Paimon) alongside unstructured file objects in a single layer.
Create, query, and manage lake storage tables from the XIHE and Spark engines.
Apply the same permission and lifecycle controls to lake storage tables as to internal tables.
Ingest data and run multi-engine queries without provisioning or maintaining storage infrastructure.
Lake storage is in invitational preview. To use this feature, submit a ticket to contact technical support.submit a ticket
Prerequisites
Before you begin, make sure you have an AnalyticDB for MySQL Enterprise Edition, Basic Edition, or Data Lakehouse Edition cluster.
Billing
Lake storage charges are based on data volume and usage duration on a pay-as-you-go basis. Reading from or writing to a lake storage also generates request fees for the number of PUT and GET requests.
For pricing details, see Enterprise Edition and Basic Edition pricing and Data Lakehouse Edition pricing.
Limits
Limit | Details |
Lake storages per region | Maximum 5 per Alibaba Cloud account. |
Lake storage name | Auto-generated in the format |
Storage usage display | Display has a delay. Data volume is not visible immediately after data is written. |
Backup and recovery | The AnalyticDB for MySQL backup and recovery feature does not support data in lake storage. |
Deletion condition | All data in the lake storage must be deleted before you can delete the lake storage. |
Create a lake storage
Log on to the AnalyticDB for MySQL console. In the upper-left corner, select a region. In the left-side navigation pane, click Clusters. Find the target cluster and click the cluster ID.
In the left-side navigation pane, choose Data Management > Lake Storages.
In the upper-right corner, click Create Lake Storage.
In the Create Lake Storage dialog box, click OK. The system auto-generates the lake storage name in the format
adb-lake-RegionID-RandomString. The name cannot be changed after creation.(Optional) Add a description to distinguish between lake storages used in different business scenarios.
In the Lake Storage Description column, click the
icon.In the Change Lake Storage Description dialog box, enter a description and click OK.
After the lake storage is created, AnalyticDB for MySQL automatically creates an OSS bucket in the same region with the same name as the lake storage. To view this bucket in the OSS console:
Log on to the OSS console
In the left-side navigation pane, click the
icon next to Favorite Paths.In the Add Favorite Path dialog box, configure the following settings and click OK:
Adding Method: Select Add from other authorized buckets.
Region: The region where the AnalyticDB for MySQL cluster resides.
Bucket: Enter the lake storage name.
Use lake storage
A lake storage table is a fully managed table in Iceberg or Paimon format. After creation, the system assigns a unique path to the table: oss://<LakeStorageName>/lakehouse/default/tables/<table_uuid>.
For example, a table named test_iceberg_tbl stored in oss://adb-lake-cn-shanghai-6gml****/lakehouse/default/tables/b22cd225-528d-421c-a2****.
Both the XIHE and Spark engines support reading from and writing to lake storage tables. The adb_lake_bucket parameter controls which lake storage a table uses:
Where | Effect |
In | All tables in the database use that lake storage. No need to specify it again at the table level. |
In | That table uses the specified lake storage. Required — omitting it causes an error. |
In both | The table uses the lake storage from |
Read from and write to a lake storage table using Spark SQL
Prerequisites
The cluster kernel version must be 3.2.3.0 or later.
To view and update the cluster version, log on to the AnalyticDB for MySQL console and go to the Configuration Information section on the Cluster Information page. For details, see View and update the minor version of a cluster.
Procedure
Go to Data Development.
Log on to the AnalyticDB for MySQL console. In the upper-left corner, select a region. In the left-side navigation pane, click Clusters. Find the target cluster and click the cluster ID.
In the left-side navigation pane, choose Job Development > SQL Development.
On the SQLConsole tab, select the Spark engine and a resource group (job resource group or interactive resource group with Spark).
Create a database and an Iceberg table.
Create a database.
CREATE DATABASE adb_external_db_iceberg WITH DBPROPERTIES ('adb_lake_bucket' = 'adb-lake-cn-shanghai-6gml****');Enable lake storage and create an Iceberg table.
SET spark.adb.lakehouse.enabled=true; CREATE TABLE adb_external_db_iceberg.test_iceberg_tbl ( id int, name string, age int ) USING iceberg PARTITIONED BY (age) TBLPROPERTIES ('adb_lake_bucket' = 'adb-lake-cn-shanghai-6gml****' );For
adb_lake_bucketscope behavior, see the parameter table above.
Write data to the Iceberg table.
SET spark.adb.lakehouse.enabled=true; INSERT INTO adb_external_db_iceberg.test_iceberg_tbl VALUES (1, 'lisa', 10), (2, 'jams', 10);(Optional) Delete rows from the Iceberg table.
SET spark.adb.lakehouse.enabled=true; DELETE FROM adb_external_db_iceberg.test_iceberg_tbl WHERE id = 1; DELETE FROM adb_external_db_iceberg.test_iceberg_tbl WHERE age = 20;Query data from the Iceberg table.
SET spark.adb.lakehouse.enabled=true; SELECT * FROM adb_external_db_iceberg.test_iceberg_tbl;Expected output:
+---+----+---+ |id |name|age| +---+----+---+ |1 |anna|10 | |2 |jams|20 | +---+----+---+(Optional) Drop the Iceberg table. The following statement removes the table from AnalyticDB for MySQL and deletes its data from OSS.
SET spark.adb.lakehouse.enabled=true; DROP TABLE adb_external_db_iceberg.test_iceberg_tbl;
Read from and write to a lake storage table using XIHE SQL
Prerequisites
The cluster kernel version must be 3.2.5.3 or later.
To view and update the cluster version, log on to the AnalyticDB for MySQL console and go to the Configuration Information section on the Cluster Information page. For details, see View and update the minor version of a cluster.
The DELETE statement cannot delete individual rows from a XIHE lake storage table. To remove data, drop the entire table.
Procedure
Go to Data Development.
Log on to the AnalyticDB for MySQL console. In the upper-left corner, select a region. In the left-side navigation pane, click Clusters. Find the target cluster and click the cluster ID.
In the left-side navigation pane, choose Job Development > SQL Development.
In the SQLConsole window, select the XIHE engine and an interactive resource group.
Create an external database and an Iceberg external table.
Create an external database.
CREATE EXTERNAL DATABASE test_db WITH DBPROPERTIES ('adb_lake_bucket' = 'adb-lake-cn-shanghai-6gml****');
Create an Iceberg external table.
CREATE TABLE test_db.test_iceberg_tbl ( id int, name string ) PARTITIONED BY (age int) STORED AS ICEBERG TBLPROPERTIES ( 'catalog_type' = 'ADB', 'adb_lake_bucket' = 'adb-lake-cn-shanghai-6gml****' );The following table describes the parameters.
Parameter
Description
catalog_typeThe catalog type. Set to
ADB.adb_lake_bucketThe lake storage for this table. For scope behavior, see the parameter table above.
Write data to the Iceberg table.
INSERT INTO test_db.test_iceberg_tbl SELECT 1, 'anna', 10; INSERT INTO test_db.test_iceberg_tbl SELECT 2, 'jams', 20;Query data from the Iceberg table.
SELECT * FROM test_db.test_iceberg_tbl;Expected output:
+---+----+---+ |id |name|age| +---+----+---+ |1 |anna|10 | |2 |jams|20 | +---+----+---+(Optional) Drop the Iceberg external table. The following statement removes the table from AnalyticDB for MySQL and deletes its data from OSS.
DROP TABLE test_db.test_iceberg_tbl;
Query data volume
In the left-side navigation pane, choose Data Management > Lake Storages.
In the Storage Size column, view the data volume of the target lake storage.
Storage usage display has a delay. Data volume is not visible immediately after data is written.
Delete a lake storage
Delete all data in the lake storage before proceeding. If any data remains, the deletion fails.
In the left-side navigation pane, choose Data Management > Lake Storages.
In the Actions column of the target lake storage, click Delete.
In the Delete dialog box, click OK.