DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Optimizing Pgbench for CockroachDB Part 2
  • Cloud Database Services Compared: AWS, Microsoft, Google, and Oracle
  • Introduction to Data Replication With MariaDB Using Docker Containers
  • Using Envoy Proxy’s PostgreSQL and TCP Filters to Collect Yugabyte SQL Statistics

Trending

  • How To Introduce a New API Quickly Using Quarkus and ChatGPT
  • Code Reviews: Building an AI-Powered GitHub Integration
  • The End of “Good Enough Agile”
  • Agile’s Quarter-Century Crisis
  1. DZone
  2. Data Engineering
  3. Databases
  4. SQL Server Database Cloning on AWS

SQL Server Database Cloning on AWS

Database clones are great for Dev and Test environments, allowing devs to work with lightweight images in preparation for cloud deployments.

By 
Paul Stanton user avatar
Paul Stanton
·
May. 23, 17 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
6.0K Views

Join the DZone community and get the full member experience.

Join For Free

WinDocks is an independent port of Docker’s open source solution to Windows. Released in April 2016, WinDocks is popular for support of SQL Server Development and Test environments. The WinDocks 2.0 release this past month added database virtualization and is usable on any infrastructure or public cloud.

Cloning enables delivery of writable, terabyte-class databases in 30 seconds while using only 40 MB of storage. Let’s take a look at the technology and how it’s being used. (In the interest of full disclosure, I am a principal at WinDocks.)

Database Cloning  

A “clone” is a byte copy replica of the original. In this article, clones are based on Virtual Hard Disks, which support writable databases that are provisioned in seconds, and require only a fraction of the storage of the original. WinDocks cloning is based on the Windows Storage Management API. While Hyper-V is not supported on AWS, Windows Virtual Disks run wherever Windows Server 2012 and 2016 are supported. A writable 1 terabyte database can be cloned and delivered in just 30 seconds and, as mentioned, requires only 40 MB of storage! 

The process begins with a snapshot or backup that is restored to a VHD. The VHD becomes a full byte copy of the source database, and takes the normal time needed for the database backup to be restored. Once created, the VHD supports the creation of “clones” in the form of a Windows “differencing disks.” Each differencing disk includes pointers to the full byte copy image (the VHD parent) and captures any changes made. Clones are created in seconds and can be delivered mounted to a SQL Server container or used with existing SQL Server instances.

Image title

WinDocks builds the VHD with a Dockerfile using a command SETUPCLONING FULL (similar commands support the use of Differential backups or database files). WinDocks creates the VHD, the associated mount point, restores the database(s) to the VHD, and associates the VHD with a new Image. The VHD and associated backups can be located on the WinDocks host or a network attached file share. The Dockerfile below illustrates the use of multiple databases, with a data masking script applied to one.  

Image title

The image is built with a standard Docker build step, with an assigned image name of “clone.”

docker build  –t clone  c:\windocks\samples\testfastclonefromfullbackup


On completion, the image is available to create containers with the cloned database environment.   The standard Docker CLI is shown, with the return string including the containerid, port, and optional SQL as credentials.

Image title

Web UI and Clones for Non-Container SQL Server Instances

SQL Server database cloning was implemented to respond to requests for improved support of large and complex database environments, and requests also include a simpler web UI and flexibility to use SQL Server cloned environments with conventional (non-container) SQL Server instances. So, WinDocks 2.0 also includes a web UI and flexible use of the cloned environments with either containers or mounted to other SQL Server instances.  

The web UI is pointed to the IP address of the WinDocks host, a local host loopback address in this example. Images are listed followed by containers. A single click on the “create” button delivers a new container with cloned databases.

Image title

Images that include cloned databases include both a container and the full path to the cloned database(s). Below, a container is based on the “clone” image includes the port at which it is accessed and the full path to the cloned databases. The user can work with the clone + container instance, or mount the clones to a personal SQL Server. 

Image title

Benefits of Clones

Clones are well suited for most Development and Test uses. Where performance is critical, it is recommended that clones be accessed with high performance or dedicated LANs, but many teams are finding clones accessed over the Internet work well, too. This combination is particularly popular for teams that work on production database environments, and with more production workloads running on AWS, the use of clones is growing.   

The advantages delivered with clones are many:

  • Clones provide practical support for large and complex database environments and provide writable databases that are delivered in seconds. WinDocks containers and clones are compatible with all existing SQL Server tools and interoperate with VSS and SQLwriter based backup systems. 
  • Cloned images are immutable, versioned, and auditable for complex database environments.   This dramatically improves support for data governance and regulatory compliance.
  • Clones are economical and minimize network and storage costs of database copies.  
  • WinDocks customers average a 10:1 reduction in VMs used, by using containers on a shared host.

Explore the use of SQL Server Clones on AWS

WinDocks 2.0 is both a full-featured .NET and SQL Server container engine, and a general purpose tool for creating SQL Server database clones. WinDocks supports cloning on Windows 8.1 or Windows 10, Pro and Enterprise editions, and Windows Server 2012 or Windows Server 2016. WinDocks supports all editions of SQL Server 2008 onward, based on a default or named instance installed on the WinDocks host.  

Try it out by downloading a free Community Edition of WinDocks, available here.

Database AWS sql Docker (software) Cloning Clone (Java method)

Opinions expressed by DZone contributors are their own.

Related

  • Optimizing Pgbench for CockroachDB Part 2
  • Cloud Database Services Compared: AWS, Microsoft, Google, and Oracle
  • Introduction to Data Replication With MariaDB Using Docker Containers
  • Using Envoy Proxy’s PostgreSQL and TCP Filters to Collect Yugabyte SQL Statistics

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!