About the Author: Shane

By ,

SkySQL offers a robust platform for managing databases in the cloud, but setting up an effective disaster recovery (DR) site requires careful planning and execution. In this guide, we’ll explore how to automate the creation and restoration of SkySQL database services for disaster recovery purposes using the SkySQL API.

We are going to use SkySQL’s REST CloudOps API as shown in the main swagger documentation and the backup swagger documentation.

Understanding the backup service

The SkySQL Backup service offers a comprehensive suite of features designed to safeguard data integrity and facilitate efficient disaster recovery. With automated nightly backups, users benefit from regular full backups of their databases without impacting performance. Additionally, the service supports on-demand or scheduled backups, full and incremental backup options, as well as logical backups for flexible data restoration. Advanced features include Bring Your Own Bucket (BYOB) support for custom storage solutions, binlog backups for replication setup, and point-in-time recovery capabilities. SkySQL ensures data security with role-based access control for backup and restore operations, providing a robust backup solution tailored to users’ needs.

Defining requirements for your DR site

This blog overviews a easily automated hot DR site setup in SkySQL but defining your specific business requirements is a must/ Consider the following to start determining your need.

RPO & RTO: Define data loss and downtime tolerances.
Geographic Location: Evaluate proximity and regional stability.
DR Configuration: Choose between hot, warm, or cold setups based on budget and performance needs.

Setting Up Disaster Recovery Site

Prerequisites

  • SkySQL Account: You need access to SkySQL and an API token.
  • Basic knowledge of SkySQL API usage.
  • Bash Environment: Ensure you have an environment to execute commands via CLI.

Execution Steps

Step 1: Set your token for use in api commands

This session variable will be used for each subsequent command.

Step 2: Create your new DR service in SkySQL

Here we will create our service (you can also create via portal) with deployment options that can be adjusted for your needs.

Step 3: Initiate Restore to DR (backup if needed)

After setting up the new database service, you can initiate a restore operation from an existing backup. If you need a backup first, it’s easy to initiate one.

Step 4: Setup replication via skysql procs on the DR instance

This information is in the SkySQL documentation pages shown here and our above backup information from step 3 will allow us to set the proper start position for the replication stream. Make sure to create a user as indicated in the SkySQL documentation.

Step 5: Verification

Once the setup and restoration processes are complete, verify the status of the new database service in the SkySQL console. Ensure that the restoration was successful and that the service is replicating for use post failover in case of a disaster.

Conclusion

Automating these steps of provisioning a disaster recovery site for SkySQL empowers organizations to streamline the process and customization it around business needs. By leveraging these scripts, you can efficiently provision resources, restore data, and initiate backup restoration, thereby enhancing resilience and minimizing downtime in critical scenarios.

Incorporating these practices into your disaster recovery strategy to fortify your SkySQL deployments to safeguard your data against potential disruptions. Remember to periodically review and update your DR procedures to adapt to evolving business needs and technology advancements.