Cleaning up resources
To avoid charges, remove the test resources that you created in this tutorial. Remove the routing data first, then the member clusters, and then the database cluster group for Aurora.
If you added clusters that you already run, remove them from the tutorial group, but don't delete the clusters. On version 8.4.900, DB instances run only in clusters that belong to a group, so delete a member cluster's DB instances before you remove it. A removed cluster keeps its storage and backups but can't serve connections. To take an existing cluster out of a group that you keep using, see Removing a member cluster.
Removing the tutorial resources
If you enabled routing, first remove the routing data. A DELETE with no WHERE clause removes up to 1,000 data mappings from across the group, and skips mappings that scaleout tables use. Delete the tutorial row by name.
To remove the routing data
-
At the routing endpoint, as the administrative router user, delete the database-level mapping row. An empty
router_table_nameselects only the database-level row.DELETE FROM dbclustergroup_sys.data_mappings WHERE (router_db_name, router_table_name) = ('tenant_0001', ''); -
At the routing endpoint, drop the router user.
DROP USER 'app_user'@'%'; -
On each member cluster, through its own cluster endpoint, drop
app_user.DROP USER 'app_user'@'%'; -
On the first member cluster, through its own cluster endpoint, drop the tutorial database.
DROP DATABASE tenant_0001;
Then remove the member clusters and delete the group. You can't delete a cluster while it's a member of a group, so remove it from the group first.
A removal doesn't check or delete the data mappings that name the cluster, so delete them first, as in the routing data procedure. If the member cluster is stopped, a DELETE of its data mappings fails with error 3168 until you remove the member cluster, so remove it first, then delete its mappings. On version 8.4.900, a removed member cluster keeps its storage and backups but has no DB instances, so it can't serve connections. For the full steps and checks, see Adding and removing member clusters and Creating, modifying, and deleting a database cluster group for Aurora.
For the parameters of each call, see the Amazon RDS API Reference.
Next steps
Each of the following is a separate choice that you can make later. To run a group day to day, see Managing a database cluster group for Aurora, including the following topics:
-
Upgrading a database cluster group for Aurora in waves, to upgrade member clusters in waves.
-
Backing up and restoring a database cluster group for Aurora, to back up the group and restore every member cluster to a consistent point in time.
-
Monitoring database cluster groups for Aurora, to read member clusters side by side.
To bring the clusters that you run today into a group, see Add member clusters. If your application already splits data across them, see Describing existing data partitions with data mappings and Sending traffic through the routing layer.
Placing and moving data when you use routing
If you use routing, you choose placement and movement for one database or table at a time, when you're ready:
-
To decide where data lives and whether you need a routing key, see Designing data placement.
-
To place databases or single tables on specific member clusters, see Using database-level and table-level mappings.
-
To move a database or collocation to another member cluster with minimal downtime, use data movement. For more information, see Moving data between member clusters.
-
To spread one table that outgrows a member cluster across several member clusters, see Choosing a routing key and routing function and Creating and loading a scaleout table.
Before you place two databases on different member clusters, find the statements that join or write both of them. Split those statements, or keep those databases in one collocation.