I Tried Out Database Cluster Groups (Preview) in Amazon Aurora MySQL

I Tried Out Database Cluster Groups (Preview) in Amazon Aurora MySQL

From a single routing endpoint, queries were routed to the cluster holding the data, by database and by row using four functions: MOD, HASH, PREFIX and COLUMN. Data was moved while writes continued, and queries still reached the destination cluster through the same endpoint.
2026.12.03

This page has been translated by machine translation. View original

Introduction

On December 2, 2026, database cluster groups for Amazon Aurora MySQL were announced in preview.

https://aws.amazon.com/about-aws/whats-new/2026/12/announcing-database-cluster-groups-amazon-aurora-mysql-preview/

Database cluster groups is a feature for managing multiple Aurora clusters as a group. For applications that split data across clusters, it provides a routing endpoint that delivers queries to the cluster that holds the data, as well as data movement between clusters.

In this article, I created a group of two clusters in us-east-2 and tested database-level routing, data movement during writes, and four types of routing functions.

https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/databaseclustergroups.html

Test environment

  • Region: US East (Ohio) (us-east-2)
  • Engine: Aurora MySQL 8.4.900
    • This is a preview-only version, and there is no upgrade path to the generally available version
  • Member clusters: 2 clusters per group
    • Aurora Serverless v2 (0.5 to 2 ACU)
    • Aurora I/O-Optimized
    • One writer instance
  • SQL host: EC2 in the same VPC
    • Instance type: t4g.micro (Amazon Linux 2023)
    • MySQL client: 8.4.13
  • AWS CLI: 2.43.2
  • Groups tested:
    • dcg-test: Created in the console. Used for routing functions and data movement
    • dcg-cli: Created with the AWS CLI. Used for group creation and database-level mapping

Creating a group

Console

Open Database cluster groups in the RDS console and choose Create cluster group.

Database cluster groups list screen. There is a Create cluster group button in the upper right

On the creation screen, you enter the group identifier, the engine (Aurora MySQL), and the number of new clusters and their configuration. Under Routing, enable Enable routing and select at least two subnets for the routing endpoint. I left the router parameters at their default values when creating the group.

Routing input screen. It has fields for Enable routing, subnets, security groups, and router parameters

After you set the maintenance window and backup window, the settings are shown in Review and create. This time, I created two new Aurora MySQL 8.4.900 clusters as a group with routing enabled.

Review and create screen. The final settings are listed, including routing enabled, 2 new clusters, Aurora MySQL 8.4.900, and Deletion protection Enabled

In the Member clusters tab of the group details after creation, the two clusters and their respective writer instances were listed, and the Group upgrade wave was 1.

Member clusters tab. Two member clusters and their writer instances are displayed

AWS CLI

I updated the AWS CLI to the latest version and also tried creating a group. I reused the subnet group and security group settings from the console.

The first step is the member clusters. With the AWS CLI, DB instances are created after the cluster is created, so here I create the cluster without an instance. The password is passed from a file, pass.txt, that contains only the password. I created dcg-cli-02 with the same command.

aws rds create-db-cluster --db-cluster-identifier dcg-cli-01 \
  --engine aurora-mysql --engine-version 8.4.mysql_aurora.8.4.900 \
  --storage-type aurora-iopt1 --storage-encrypted \
  --serverless-v2-scaling-configuration MinCapacity=0.5,MaxCapacity=2 \
  --master-username admin --master-user-password file://pass.txt \
  --db-subnet-group-name dcg-cli-subnets --vpc-security-group-ids sg-0123456789abcdef0 \
  --preferred-maintenance-window sun:03:00-sun:05:00 --preferred-backup-window 15:00-16:00

The second step is the group. Enable routing and specify the subnets and security group for the routing endpoint. For the router administrator password, save group-admin-password.json with the following content (with permissions 600) and pass it with --cli-input-json.

{"AdminUserPassword": "<パスワード>"}
aws rds create-db-cluster-group --db-cluster-group-identifier dcg-cli \
  --engine aurora-mysql \
  --enable-routing --admin-username admin \
  --routing-endpoint-configuration '{"VpcSubnetIds":["subnet-0123456789abcdef0","subnet-0123456789abcdef1"],"VpcSecurityGroupIds":["sg-0123456789abcdef0"],"NetworkType":"IPV4"}' \
  --backup-retention-period 1 --preferred-backup-window 15:00-16:00 \
  --preferred-maintenance-window Sun:03:00-Sun:05:00 \
  --cli-input-json file://group-admin-password.json

Once the group is available, get the routing endpoint name with describe-db-cluster-groups. The later SQL connects to this Endpoint.

aws rds describe-db-cluster-groups --db-cluster-group-identifier dcg-cli \
  --query 'DBClusterGroups[0].{Status:Status,Engine:Engine,RoutingEnabled:RoutingEnabled,Routing:RoutingEndpointConfigurationInfo,AdminUsername:AdminUsername,BackupRetentionPeriod:BackupRetentionPeriod,PreferredBackupWindow:PreferredBackupWindow,PreferredMaintenanceWindow:PreferredMaintenanceWindow,DeletionProtection:DeletionProtection,CopyTagsToSnapshot:CopyTagsToSnapshot,MinEngineVersion:MinEngineVersion,MaxEngineVersion:MaxEngineVersion,Members:DBClusterGroupMembers}' \
  --output json
{
    "Status": "available",
    "Engine": "aurora-mysql",
    "RoutingEnabled": true,
    "Routing": {
        ...
        "Status": "available",
        "Endpoint": "dcg-cli.rw-<id>.db-cluster-group.us-east-2.rds.amazonaws.com",
        "ReaderEndpoint": "dcg-cli.ro-<id>.db-cluster-group.us-east-2.rds.amazonaws.com",
        "Port": 3306,
        ...
    },
    ...
    "DeletionProtection": false,
    ...
    "Members": []
}

The output includes a ReaderEndpoint, but the documentation states that a group reader endpoint is not supported.

The third step is adding the members. I specified 1 for the upgrade wave, the same as the group created in the console. Add dcg-cli-02 in the same way. The command returns before the join completes, so confirm it by checking that the cluster appears in DBClusterGroupMembers of describe-db-cluster-groups.

aws rds add-db-cluster-to-db-cluster-group --db-cluster-group-identifier dcg-cli \
  --db-cluster-identifier dcg-cli-01 --db-cluster-group-upgrade-wave 1

The fourth step is creating a writer instance in each joined cluster.

aws rds create-db-instance --db-instance-identifier dcg-cli-01-instance-1 \
  --db-cluster-identifier dcg-cli-01 \
  --engine aurora-mysql --db-instance-class db.serverless

It took about 19 minutes for the group to become available, 3 to 4 seconds to add a member, and about 8 minutes to create the two instances running them at the same time.

Routing

From the SQL host, I connect with the mysql client to the member cluster endpoints and the routing endpoint. The following commands use these variables.

export MYSQL_PWD='<パスワード>'
M1=dcg-cli-01.cluster-<id>.us-east-2.rds.amazonaws.com
M2=dcg-cli-02.cluster-<id>.us-east-2.rds.amazonaws.com
RT=dcg-cli.rw-<id>.db-cluster-group.us-east-2.rds.amazonaws.com

Database-level mapping

In dcg-cli, I register database-level mappings. They associate a database name, a member cluster alias, and a collocation name (router_collocation_group), which is the unit of movement.

First, connect to the routing endpoint as admin and check the member cluster aliases.

mysql -h "$RT" -P 3306 -u admin --ssl-mode=REQUIRED -t \
  -e 'SELECT member_cluster_alias, db_cluster_identifier FROM dbclustergroup_sys.member_cluster_mappings;'

13 seconds after the instances became available the result was empty, and about 1 minute later two rows were displayed.

+----------------------+-----------------------+
| member_cluster_alias | db_cluster_identifier |
+----------------------+-----------------------+
| dcg-cli-02           | dcg-cli-02            |
| dcg-cli-01           | dcg-cli-01            |
+----------------------+-----------------------+

Once the two rows are displayed, proceed in the following order.

  1. Connect directly to each member cluster and create the database and user
  2. Create a router user on the routing endpoint and register the mapping

Connect directly to dcg-cli-01 and create the database tenant_0001 and the user app_user.

mysql -h "$M1" -u admin --ssl-mode=REQUIRED -t
CREATE DATABASE tenant_0001;
CREATE TABLE tenant_0001.customers (id BIGINT PRIMARY KEY, name VARCHAR(100));
INSERT INTO tenant_0001.customers VALUES (1, 'Customer A on 01');
CREATE USER IF NOT EXISTS 'app_user'@'%' IDENTIFIED BY '<パスワード>';
GRANT SELECT, INSERT, UPDATE, DELETE ON tenant_0001.* TO 'app_user'@'%';

On dcg-cli-02, I also created tenant_0002, a row with id 101 (Customer B on 02), and the same app_user.

On the routing endpoint, create a router user with the same name as on the members, and register a mapping for each database.

CREATE USER 'app_user'@'%' IDENTIFIED BY '<パスワード>';
INSERT INTO dbclustergroup_sys.data_mappings (cluster_db_name, router_db_name, member_cluster_alias, router_collocation_group) VALUES ('tenant_0001', 'tenant_0001', 'dcg-cli-01', 'cg_tenant_0001');
INSERT INTO dbclustergroup_sys.data_mappings (cluster_db_name, router_db_name, member_cluster_alias, router_collocation_group) VALUES ('tenant_0002', 'tenant_0002', 'dcg-cli-02', 'cg_tenant_0002');
SELECT * FROM dbclustergroup_sys.data_mappings;
+-----------------+--------------------+----------------+-------------------+----------------------+-----------------------+--------------------------+
| cluster_db_name | cluster_table_name | router_db_name | router_table_name | member_cluster_alias | db_cluster_identifier | router_collocation_group |
+-----------------+--------------------+----------------+-------------------+----------------------+-----------------------+--------------------------+
| tenant_0001     |                    | tenant_0001    |                   | dcg-cli-01           | NULL                  | cg_tenant_0001           |
| tenant_0002     |                    | tenant_0002    |                   | dcg-cli-02           | NULL                  | cg_tenant_0002           |
+-----------------+--------------------+----------------+-------------------+----------------------+-----------------------+--------------------------+

There is a short delay before the mapping is reflected in the routing layer, so I waited 5 seconds before reading. Then I connected to the routing endpoint as app_user and read both databases from a single endpoint.

mysql -h "$RT" -P 3306 -u app_user --ssl-mode=REQUIRED -t <<'SQL'
SELECT 'tenant_0001' AS db, id, name FROM tenant_0001.customers;
SELECT 'tenant_0002' AS db, id, name FROM tenant_0002.customers;
SQL
+-------------+----+------------------+
| db          | id | name             |
+-------------+----+------------------+
| tenant_0001 |  1 | Customer A on 01 |
+-------------+----+------------------+
+-------------+-----+------------------+
| db          | id  | name             |
+-------------+-----+------------------+
| tenant_0002 | 101 | Customer B on 02 |
+-------------+-----+------------------+

Next, I ran INSERTs into both databases as app_user.

INSERT INTO tenant_0001.customers VALUES (2, 'Inserted via router into 0001');
INSERT INTO tenant_0002.customers VALUES (102, 'Inserted via router into 0002');

When I connected directly to each member cluster and read the data, the rows written through the routing endpoint were in the mapped member.

mysql -h "$M1" -u admin --ssl-mode=REQUIRED -t -e "SELECT 'on 01' AS member, id, name FROM tenant_0001.customers ORDER BY id;"
mysql -h "$M2" -u admin --ssl-mode=REQUIRED -t -e "SELECT 'on 02' AS member, id, name FROM tenant_0002.customers ORDER BY id;"
+--------+----+-------------------------------+
| member | id | name                          |
+--------+----+-------------------------------+
| on 01  |  1 | Customer A on 01              |
| on 01  |  2 | Inserted via router into 0001 |
+--------+----+-------------------------------+
+--------+-----+-------------------------------+
| member | id  | name                          |
+--------+-----+-------------------------------+
| on 02  | 101 | Customer B on 02              |
| on 02  | 102 | Inserted via router into 0002 |
+--------+-----+-------------------------------+

Routing functions

To distribute the rows of a table across multiple clusters, you define routing functions. Here I used dcg-test, created in the console, and tried four methods: MOD, HASH, PREFIX, and COLUMN.

Create the actual tables on each member, register the destinations with table-level data mappings, and then define the routing functions and scale-out tables.

Member-side tables and table-level mappings

Run the following on both members by connecting directly.

CREATE DATABASE sc;
CREATE TABLE sc.m_mod    (customer_id INT NOT NULL, order_id INT NOT NULL, note VARCHAR(30), PRIMARY KEY (customer_id, order_id));
CREATE TABLE sc.m_hash   (user_id BIGINT NOT NULL, note VARCHAR(30), PRIMARY KEY (user_id));
CREATE TABLE sc.m_prefix (path VARCHAR(100) NOT NULL, note VARCHAR(30), PRIMARY KEY (path));
CREATE TABLE sc.m_column (order_year INT NOT NULL, order_id INT NOT NULL, note VARCHAR(30), PRIMARY KEY (order_year, order_id));
GRANT SELECT, INSERT, UPDATE, DELETE ON sc.* TO 'app_user'@'%';

On the routing endpoint, run the following as admin.

INSERT INTO dbclustergroup_sys.data_mappings
(cluster_db_name, cluster_table_name, router_db_name, router_table_name, member_cluster_alias, router_collocation_group)
VALUES
('sc','m_mod','sc','t_mod_s1','dcg-test-01','mod_0'),       ('sc','m_mod','sc','t_mod_s2','dcg-test-02','mod_1'),
('sc','m_hash','sc','t_hash_s1','dcg-test-01','hash_0'),    ('sc','m_hash','sc','t_hash_s2','dcg-test-02','hash_1'),
('sc','m_prefix','sc','t_prefix_s1','dcg-test-01','pfx_0'), ('sc','m_prefix','sc','t_prefix_s2','dcg-test-02','pfx_1'),
('sc','m_column','sc','t_column_s1','dcg-test-01','col_0'), ('sc','m_column','sc','t_column_s2','dcg-test-02','col_1');

Connect to the routing endpoint as admin and create the routing functions and scale-out tables.

CREATE SCALEOUT ROUTING FUNCTION mod_fn(customer_id INT) AS
PARTITION BY MOD(customer_id, 2)
IN TARGET COLLOCATION (mod_0 VALUES IN (0), mod_1 VALUES IN (1));

CREATE SCALEOUT ROUTING FUNCTION hash_fn(user_id BIGINT) AS
PARTITION BY HASH('xxhash', user_id)
IN TARGET COLLOCATION (hash_0 VALUES IN RANGE (0, 4611686018427387903), hash_1 VALUES IN RANGE (4611686018427387904, MAXVALUE));

CREATE SCALEOUT ROUTING FUNCTION prefix_fn(path VARCHAR(100)) AS
PARTITION BY PREFIX(path, '/', 1)
IN TARGET COLLOCATION (pfx_0 VALUES IN ('us'), pfx_1 VALUES IN ('eu'));

CREATE SCALEOUT ROUTING FUNCTION column_fn(order_year INT) AS
PARTITION BY COLUMN(order_year)
IN TARGET COLLOCATION (col_0 VALUES IN RANGE (2000, 2024), col_1 VALUES IN RANGE (2025, MAXVALUE));

CREATE SCALEOUT TABLE t_mod    (ROUTE BY KEY(customer_id POSITION(1)) USING ROUTING FUNCTION mod_fn)    MEMBERS (MEMBER sc.t_mod_s1, MEMBER sc.t_mod_s2);
CREATE SCALEOUT TABLE t_hash   (ROUTE BY KEY(user_id POSITION(1))     USING ROUTING FUNCTION hash_fn)   MEMBERS (MEMBER sc.t_hash_s1, MEMBER sc.t_hash_s2);
CREATE SCALEOUT TABLE t_prefix (ROUTE BY KEY(path POSITION(1))        USING ROUTING FUNCTION prefix_fn) MEMBERS (MEMBER sc.t_prefix_s1, MEMBER sc.t_prefix_s2);
CREATE SCALEOUT TABLE t_column (ROUTE BY KEY(order_year POSITION(1))  USING ROUTING FUNCTION column_fn) MEMBERS (MEMBER sc.t_column_s1, MEMBER sc.t_column_s2);

As app_user, I ran INSERTs that include the routing key, one row per statement. The destination for HASH is calculated by the routing layer, so it cannot be known in advance on the client side.

INSERT INTO sc.t_mod (customer_id, order_id, note) VALUES (1, 1, 'mod key=1');

The keys inserted were 1 to 6 for MOD, 101 to 108 for HASH, four paths for PREFIX, and four years for COLUMN. I connected directly to each member to check which one each row went into.

Method Function Key Rows that went to member 01 Rows that went to member 02
MOD MOD(customer_id, 2) customer_id 1 to 6 2, 4, 6 1, 3, 5
HASH HASH('xxhash', user_id) user_id 101 to 108 103, 104, 107 101, 102, 105, 106, 108
PREFIX PREFIX(path, '/', 1) us/nyc/1, us/sfo/1, eu/par/1, eu/ber/1 us/nyc/1, us/sfo/1 eu/ber/1, eu/par/1
COLUMN COLUMN(order_year) order_year 2022, 2024, 2025, 2026 2022, 2024 2025, 2026

For MOD, PREFIX, and COLUMN, when I specified the key and read through the routing endpoint, the expected single row was returned.

Data movement

For data movement, in dcg-test I moved the collocation cg_tenant_0001 of tenant_0001 from dcg-test-01 to dcg-test-02. Before the move, tenant_0001 was mapped to dcg-test-01 and tenant_0002 to dcg-test-02.

Commands

Run the move command by connecting to the routing endpoint as admin. With EXPLAIN, you can check the contents of the move without starting a job.

EXPLAIN ALTER DBCLUSTERGROUP MOVE COLLOCATION cg_tenant_0001 FROM `dcg-test-01` TO `dcg-test-02` PRESERVE_GRANTS_FOR = ('app_user');
Status: Success (1 warning)
Collocation: cg_tenant_0001
Cutover Type: AUTOMATIC
Database data mapping updates: 1
Table data mapping updates: 0
Warnings:
  Binary logging is disabled on the source 'dcg-test-01'; the data-movement job will enable it dynamically for the duration of the move, and will check the binlog filter lists then. Long-running transactions on the source can delay the start of the move.

When you run it without EXPLAIN, a job ID is returned.

ALTER DBCLUSTERGROUP MOVE COLLOCATION cg_tenant_0001 FROM `dcg-test-01` TO `dcg-test-02` PRESERVE_GRANTS_FOR = ('app_user');
JOB_ID
<job_id>

An account specified in PRESERVE_GRANTS_FOR must exist on both the source and the destination and must have been granted privileges directly on the objects being moved. If the schema name contains _, grant on the source with an escape as follows.

GRANT SELECT, INSERT, UPDATE, DELETE ON `tenant\_0001`.* TO 'app_user'@'%';

To check the status of the job, filter move_info by the job ID.

SELECT job_id, status, phase, progress_details, errors, warnings, cleanup_status, updated_at
FROM dbclustergroup_data_movement.move_info
WHERE job_id = '<job_id>';

Impact on writes

I ran the move while continuing to write as app_user. The write is a loop that INSERTs one row on a new connection every 0.5 seconds and records the result. I did not change the connection target or connection settings before or after the move.

i=2000
while [ $i -lt 3500 ]; do
  ts=$(date -u +%H:%M:%S.%3N)
  out=$(mysql -h "$RT" -P 3306 -u app_user --ssl-mode=REQUIRED -N -B \
    -e "INSERT INTO tenant_0001.customers VALUES ($i, 'load-$i'); SELECT COUNT(*) FROM tenant_0001.customers;" 2>&1) \
    && r="OK count=$(echo "$out" | tail -1)" || r="ERR: $(echo "$out" | tr '\n' ' ' | cut -c1-200)"
  echo "$ts id=$i $r" >> writer.log
  i=$((i+1)); sleep 0.5
done

The move started at 17:59:43 (UTC) and reached Completed at 18:05:25. The duration was about 5 minutes 40 seconds, of which Initializing took about 5 minutes 30 seconds. The number of rows copied in Seeding was 732.

18:04:10 Running Initializing NotStarted NULL
18:05:15 Running Precheck NotStarted NULL
18:05:20 Running Cdc NotStarted {"PRECHECKS":{"started_at":"2026-12-02T18:05:14Z","checks_total":15,"checks_failed":0,"checks_passed":15},"SEEDING":{"started_at":"2026-12-02T18:05:16Z","tables_total":1,"records_migrated":732,"tables_completed":1,"estimated_records":732}}
18:05:25 Completed CutoverFlip NotStarted {"PRECHECKS":{"started_at":"2026-12-02T18:05:14Z","checks_total":15,"checks_failed":0,"checks_passed":15},"SEEDING":{"started_at":"2026-12-02T18:05:16Z","tables_total":1,"records_migrated":732,"tables_completed":1,"estimated_records":732},"CDC":{"started_at":"2026-12-02T18:05:16Z","iud_replicated":9,"replication_lag_seconds":0},"CUTOVER":{"started_at":"2026-12-02T18:05:21Z","attempt_count":1}}
18:05:30 Completed CutoverFlip Complete {"PRECHECKS":{"started_at":"2026-12-02T18:05:14Z","checks_total":15,"checks_failed":0,"checks_passed":15},"SEEDING":{"started_at":"2026-12-02T18:05:16Z","tables_total":1,"records_migrated":732,"tables_completed":1,"estimated_records":732},"CDC":{"started_at":"2026-12-02T18:05:16Z","iud_replicated":9,"replication_lag_seconds":0},"CUTOVER":{"started_at":"2026-12-02T18:05:21Z","attempt_count":1}}

After the move, the mapping for tenant_0001 pointed to dcg-test-02.

+-----------------+----------------------+--------------------------+
| cluster_db_name | member_cluster_alias | router_collocation_group |
+-----------------+----------------------+--------------------------+
| tenant_0001     | dcg-test-02          | cg_tenant_0001           |
| tenant_0002     | dcg-test-02          | cg_tenant_0002           |
+-----------------+----------------------+--------------------------+

When I read from the routing endpoint with the same connection settings as before the move, there were 784 rows, the same as the result of connecting directly to dcg-test-02. This matches the sum of the 152 rows before the move and the 632 INSERTs that succeeded during the move.

+-------------+---------+---------+
| routed_rows | MIN(id) | MAX(id) |
+-------------+---------+---------+
|         784 |       1 |    2632 |
+-------------+---------+---------+
+------------+---------+---------+
| rows_on_02 | MIN(id) | MAX(id) |
+------------+---------+---------+
|        784 |       1 |    2632 |
+------------+---------+---------+

At the time of the post-move check, 633 writes had been recorded; 632 succeeded, and 1 write at the moment of cutover (id 2589) failed with error 63927.

18:05:20.463 id=2587 OK count=740
18:05:21.029 id=2588 OK count=741
18:05:21.595 id=2589 ERR: ERROR 63927 (HY000) at line 1: Cannot write to `tenant_0001`.`customers` while data movement job '<job_id>' is in progress 
18:05:22.152 id=2590 OK count=742

Reads and writes during cutover are rejected with 63927. During cutover, other errors such as 1412, 63928, 1317, 1180, and 1927, as well as connection drops (2013, 2006), may also be returned, and the retry method differs by error.

  • 63927, 1412: Re-run the statement
  • 63928, 1180: Re-run the entire transaction
  • 1317: Roll back and re-run the entire transaction (reconnect first if the connection was lost)
  • 1927, 2013, 2006: Reconnect and re-run the entire transaction

An application that keeps writing during a move needs retry logic that branches by error.

Summary

I confirmed that multiple Aurora MySQL clusters can be managed as a group, and that queries can be delivered from the routing endpoint to the cluster that holds the data. If you have an application that splits data across clusters, please try this update, keeping in mind that this is a preview version (8.4.900) that cannot be upgraded to the generally available version.

Share this article

AWSのお困り事はクラスメソッドへ