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

You can only add one region to a database at a time. To add a region, you must have a role with the Manage Region permission. For more information about permissions, see permissions.

Adding a region temporarily puts your database into Maintenance status. Once complete, the database returns to an Active status. Reads and writes aren’t affected during this period.

  • Vector databases

  • Serverless (non-vector) databases

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

  2. Under Overview > Database Details > Regions, click Add Region.

  3. In the Add Region dialog, use the Region drop-down to select the new region you want to add to your database.

    • You can only add one region at a time.

    • Regions that have already been added to the database are grayed out.

  4. Click Add Region.

You are returned to your database’s Overview tab and the database status changes to Maintenance. Your database keeps this status until all data has finished replicating to the new region. During this time, you cannot delete regions or configure additional regions.

Once the operation is complete, the database status returns to Active. The new region appears in the Regions section of your database’s Overview tab.

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

  2. Under Overview > Regions, click Add Region.

  3. In the Add Region dialog, use the Region drop-down to select the new region you want to add to your database.

    • You can only add one region at a time.

    • Regions that have already been added to the database are grayed out.

  4. Click Add Region.

You are returned to your database’s Overview tab and the database status changes to Maintenance. Your database keeps this status until all data has finished replicating to the new region. During this time, you cannot delete regions or configure additional regions.

The new region appears in the Regions section of your database’s Overview tab. Once the operation is complete, the database status returns to Active.

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 will be removed. However, all data is replicated before the region is deleted, to avoid data loss.

You can only delete one region from a database at a time.

Deleting a region temporarily puts your database into Maintenance status. Once complete, the database returns to an Active status. Reads and writes aren’t affected during this period.

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

  2. Under Overview > Regions, find the region you want to delete, click more_vert More Options, and then select Delete.

  3. In the confirmation dialog, enter delete in the text box and click Delete Region.

You are returned to your database’s Overview tab and the database status changes to Maintenance. During this time, you cannot add or delete additional regions.

The deleted region is removed from the Regions section of your database’s Overview tab. The database status returns to Active when the operation is complete, which may take several minutes.

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 IP Access List configuration applies at the database level.

  9. How are backups managed?

    Backups are taken from the original region in which the database was first created. In the event that a database needs to be restored from a backup, the backup is restored to the original region and the data is replicated to additional regions. For help with restoring a database, please contact DataStax Support.

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