Configure multiple regions for a database

You can configure a database to replicate data across multiple regions. Some of the benefits of multi-region databases include better data locality and higher availability for multi-region application architectures.

Data consistency

Astra DB follows the eventual consistency model. Data is queried from the first region created with the database. If a write request succeeds, data is immediately accessible in all regions when using the following consistency levels:

  • EACH_QUORUM for normal updates.

  • SERIAL for Lightweight Transactions (LWT).

For all other consistency levels, data written to one region might not be immediately accessible in other regions in the same database. Normally, it takes up to a few minutes to replicate this data. However, several factors might extend this time, such as workload volume, the number of regions, and network resources.

On rare occasions, a write request might succeed in one region but fail in another. In such scenarios, the time taken to repair the inconsistency determines the speed of replication. The repair cycle can take anywhere from a few minutes to several hours. If there’s a network disruption between regions, correcting the inconsistencies can take days.

Considerations

  • You cannot configure databases across multiple cloud providers. You can only add regions from the cloud provider the database was created in.

  • You cannot create a collection or load data to a specific region using the Astra Portal. You must use the initial region you selected when you created the database.

  • You cannot remove the original region that the database was created in.

  • You cannot drop a keyspace, drop a table, or truncate a table when the database is in the process of adding a new region.

  • You cannot replicate specific tables to a subset of regions. Astra DB replicates all data in the database to all of a database’s regions. For more information, see Can I specify replication rules by keyspace?.

  • If a network disruption occurs between regions, the following operations might have limited or no availability:

    • Schema changes

    • Table truncation

    • Lightweight transactions

    • Data repair

Add a region to a database

To add a region, you must have a role with the Manage Region organization permission.

  1. In the Astra Portal, go to Databases, and then select your database.

  2. On the Overview tab, in the Regions section, click Add Region.

  3. Select a region to add to your database.

    You can add only one region at a time. You can’t select regions that the database already uses.

  4. Click Add Region.

The database enters Maintenance status while provisioning and replicating data to the new region. While in Maintenance status, you can’t add or remove regions. Maintenance status doesn’t impact reads and writes.

When the database returns to Active status, the new region appears in the Regions section.

Using a multi-region database

There are a few operational differences when using a multi-region database versus a single-region database.

  • Your database’s CQL Console only connects to one region at a time.

    • The currently-connected region is displayed in the upper-right corner of the CQL Console.

    • Use the drop-down menu in the top-right corner of the CQL Console tab to switch between available regions.

  • Certain elements on your database’s Connect tab are region-specific.

    • When downloading the secure connect bundle, you must select the region you want to connect to.

    • The Select a Method section contains a drop-down menu to select the region you want to connect to.

Delete a region from a database

Any connections that use the deleted region are removed. To avoid data loss, all data is replicated before the region is deleted.

  1. In the Astra Portal, go to Databases, and then select your database.

  2. On the Overview tab, in the Region section, locate the region you want to delete, click more_vert More Options, and then select Delete.

    You can delete only one region at a time.

  3. In the confirmation dialog, enter delete, and then click Delete Region.

The database enters Maintenance status while deleting the region. While in Maintenance status, you can’t add or remove regions. Maintenance status doesn’t impact reads and writes.

When the database returns to Active status, the delete region is no longer listed in the Regions section.

Frequently asked questions

  1. How much does it cost to add a region to a database?

    Adding a region increases database costs. This includes a one-time data replication fee to new region(s), and charges for replicating new data to these regions.

  2. Where can I see the current usage for a region?

    Open your database and go to Region. Click the ellipsis (…​), and then select Details.

  3. How many regions can I add to a database?

    The number of regions that can be added to a database is only limited by the number of supported regions for your particular cloud provider.

  4. How quickly are updates applied to all regions in the same database?

    See Data consistency.

  5. Can I remove a region that I no longer need?

    Yes. You can delete any region that you added to a database, however you cannot delete the original region that the database was created in.

  6. Will I lose data when I remove a region?

    No. All data in the region is replicated prior to being decommissioned.

  7. Can I specify replication rules by keyspace?

    Astra DB replicates all data in the database to all of the database’s regions. This differs from Apache Cassandra® and DataStax Enterprise (DSE) where multiple keyspaces allow a database to replicate some tables to a subset of regions.

    To achieve the same effect in Astra DB, create a separate database instance that adheres to the necessary region restrictions. The database client must add a separate connection for the additional database and send queries to the appropriate connection depending on the table being queried.

  8. Can the IP Access List be configured by region?

    No. The database IP access list configuration applies at the database level.

  9. How are backups managed?

    Backups are recorded only from the original region that you selected when you created the database. When you restore a multi-region database from a backup, data is restored to the original region and then replicated to the additional regions. For more information, see Backup and restore.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com