Smart Disaster Recovery (DR): SmartDR
On this page
Note
This is a Preview feature.
SmartDR creates and manages a continuous asynchronous replication of data between a primary and a geographically separate secondary region.
You can initiate SmartDR via the SingleStore Portal or API.
SmartDR replicates the exact topology from the primary to the secondary region and maintains all the users, permissions, and workspace configurations across the regions.
Benefits
The principal benefits of SmartDR are minimal ongoing costs and a low Recovery Point Objective (RPO of up to 10 minutes).
Use Case
A primary use case for SmartDR is to guarantee business continuity in the face of a region outage.
Depending on your business requirements, it may be essential to have both Multi-AZ High Availability (HA) and SmartDR.
In conjunction with SmartDR, Point-in-Time Recovery (PITR), gives you the ability to go back in time and recover data in both the primary and secondary regions.
Setting up SmartDR
Minimum Pre-requisites
-
An existing workspace group - at the time of creation of the workspace group, under
Advanced Settings
you must check out theEnable SmartDR and Database Branching
option.You can see the Replication
tab to perform SmartDR and branching only if you have enabled this option. -
A workspace in the workspace group - at the time of creation of the workspace, under the
Deployment Type
, currently on the Non-Production option is available. -
A database and its tables.
Configuring the Replication
-
Select the
Replication
tab from the top menu and then select+Configure Replication
. -
Select the details for:
-
Primary region
- this displays the region where your database(s) currently reside.This is displayed by default and cannot be modified. -
Secondary region
- select from the drop-down list the region to which you want to replicate the database(s).
-
-
Choose the database(s)
to replicate from the list displayed. -
Select
Submit
.You will see a status bar indicating the progress of the replication processes and the replication status of each selected database.
Failover
Once the database(s) replication is set up and synced up, you can fail over your application to the secondary region anytime there is a regional failure.
To start the process, click the Failover
button under the Replication
tab.Confirm
in the popup window.
During the failover deployment, the system automatically performs the following tasks in the background:
-
Provisions the environment in the secondary region, maintaining the primary region's topology.
-
Provisions and configures all your workspaces.
-
Attaches the databases to the workspace and provides a connection string.
To access the connection string: -
Select the
Overview
tab. -
Choose the
Connect String
from theWorkspaces
>Connect
option from the drop-down list.
-
-
Preserves user permissions, pipelines, firewall settings and other metadata from your primary region.
System-Managed Databases
After initiating the failover process, you may notice either through the UI or by running the SQL command SHOW DATABASES
, there are two databases: one attached to the workspace (WS) and another with the same name but including a timestamp, in a detached state.
The detached database, referred to as a system-managed database, is a continuation of your primary region's database.
During failover, SingleStore attaches a branch of this system-managed database to your workspace.
You can access the data in the system-managed database at any time by attaching it as a branch and recovering the missing rows.
Failback
To initiate failback from the secondary region to the primary region:
-
Click the
Failback
button located under theReplication
tab. -
Check the "I confirm.
. . " checkbox and click Confirm
in the popup window.This action triggers the failback process. A status bar displays progress.
The system automatically performs the following tasks during failback:
-
Configures the primary region environment.
-
Attaches replicated databases to the workspace and provides the connection string.
-
Updates user permissions and other metadata with changes from the secondary region.
Upon successful completion, the primary region becomes active, and the secondary region is no longer accessible.
Pre-provisioning
Pre-provisioning can be used to configure compute resources in a secondary region in advance.
This enables you to:
-
Configure the private endpoints in the secondary region, before failover is initiated.
-
Test DR by failing over to the secondary region without disrupting your production environment.
-
Failover is faster because compute is already running.
To pre-provision:
-
In the Portal, navigate to the
Replication
tab. -
Click on
Enable Pre-Provisioning
.
This starts the background process to configure the secondary region with the same topology of workspaces as your primary region.
To validate your failover capabilities and ensure business continuity, you can switch to the secondary region, attach your database to a workspace, and start querying the data from the secondary region.
You can attach your application in the secondary region and verify that it can insert or update your database as expected, without impacting your production environment.
This seamless testing is possible because when you attach your database to a workspace in the secondary region SingleStore Helios automatically creates a branch of your database.
Last modified: July 10, 2024