Earlier this month, I was given the opportunity to spend a day with RedGate in Cambridge, England. While I was there, I was introduced to a product called SQL Clone. SQL Clone is a database provisioning tool. It allows you to create clones of production databases that are a fraction of the size, which saves valuable disk space. With local clones of your database, your team will be able to develop, test, and fix issues in isolation; your production database will not be affected. Additionally, it takes the headache out of the management of these clones so that you and your team can ship value to your end users faster.

The Technology

So, how does SQL Clone work? Fundamentally, a clone is an isolated copy of the database. This copy is created from the data image, which is made up of the database’s MDF and LDF files. This image is immutable. Therefore, it can be reused without being damaged. A database clone created with SQL clone is made up of a Virtual Hard Disk mount point that holds the source data image of the database, as well as a differencing disk. Any change made to a clone database will only affect that clone. Because SQL Clone is only creating the mount point and the differencing disk, it is incredibly fast to produce a clone, allowing you to get back to the development quicker. You can read more about the technology behind SQL Clone at RedGate’s technical overview.

This tool is available in the Visual Studio Marketplace as an extension for VSTS or TFS. The extension provides three tasks: creating the data image, creating the clone, and deleting the clone. These tasks can be easily integrated into your existing CI/CD pipeline. The extension is free, but it requires a SQL Clone Server to be installed and visible to any build agents running clone tasks. For more information on the extension, visit the Marketplace.