<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dinesh Bommisetty on Medium]]></title>
        <description><![CDATA[Stories by Dinesh Bommisetty on Medium]]></description>
        <link>https://medium.com/@dinesh.bommisetty?source=rss-3c16b7de9062------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*UyH64VxilwdRMR8lgFh8IQ.png</url>
            <title>Stories by Dinesh Bommisetty on Medium</title>
            <link>https://medium.com/@dinesh.bommisetty?source=rss-3c16b7de9062------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 20:00:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dinesh.bommisetty/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Snowflake’s Cloud Data Warehouse — Zero copy cloning]]></title>
            <link>https://medium.com/@dinesh.bommisetty/snowflakes-cloud-data-warehouse-zero-copy-cloning-be12cbf6adad?source=rss-3c16b7de9062------2</link>
            <guid isPermaLink="false">https://medium.com/p/be12cbf6adad</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[snowflake-computing]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Dinesh Bommisetty]]></dc:creator>
            <pubDate>Tue, 12 May 2020 16:35:09 GMT</pubDate>
            <atom:updated>2020-05-12T16:35:09.860Z</atom:updated>
            <content:encoded><![CDATA[<h3>Snowflake’s Cloud Data Warehouse — Zero copy cloning</h3><p>Copy data without actually copying !!</p><p>You heard it right! Have you ever worried of additional storage costs and stepped back from having real time data in your dev and stage environments? Have you ever suffered of poor test results due to unavailability of proper data in your non-prod environments? Have you ever been in a situation to convince your team to move the code forward to QA environment without doing sanity or unit testing just because you/your organization could not afford long waiting hours, days even may be weeks to replicate production data? Then this article is for you, the right you!</p><p>Snowflake is a cloud data warehouse built from ground up specifically for cloud. It is fully data warehouse supporting ANSI SQL standards. Snowflake offers wide variety of killer features like UN DROPPING a table/schema/database, Storage &amp; Compute isolation, JSON support with SQL, Auto encryption, Auto query optimization and the very special feature, ZERO COPY CLONING, which left me fascinated about snowflake.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EAyXtEI1a6D3m24glgJyxQ.jpeg" /><figcaption>Source: <a href="https://www.snowflake.com/">https://www.snowflake.com/</a></figcaption></figure><p><a href="https://www.snowflake.com/">The Snowflake AI Data Cloud - Mobilize Data, Apps, and AI</a></p><p>So, enough of background. Let us get into the point.</p><p>Zero copy cloning is a snowflake implementation where a simple keyword CLONE lets you create copy of your tables, schemas, databases without copying the actual data. So, you can have almost real time data from production cloned into your dev and stage environments to be able to perform various actions. All this happens without actually replicating the data, which makes it so special. Let us visit the brief the advantages of this first and then we will go to the HOW section to answer all your mind boggling questions !</p><p>Advantages:</p><p>1. Almost no additional storage costs for cloning the data</p><p>2. No waiting time for cloning data from production to non-production environments, Like in a snap-of-a-finger</p><p>3. No need of administrative efforts as cloning is as simple as a select</p><p>4. Only clone, No copy: Data exists only in one place</p><p>5. Instantly promote corrected/fixed data to production</p><p>So, Time &amp; Money both are saved with this amazing feature. Now let us see how snowflake is able to do all this?</p><p>HOW ?</p><p>Snowflake does all this by playing around the metadata ! When you create a clone for your data, snowflake instead of copying data, creates new metadata information pointing to the data of interest. All these operations are performed by snowflake’s global services layer.</p><p>Without going into much details of Snowflake’s architecture here (Let us discuss in a separate post in detail), Lets us stick our discussion to zero copy cloning implementation.</p><p>Let us discuss with an example and explore:</p><p>Scenario: One application should be tested based on production data in QA environment.</p><p>As a first step, Let us create a clone of production data to stage environment with just a simple command as shown below.</p><p><strong>CREATE</strong> <strong>OR REPLACE TABLE</strong> &lt;STAGE_SCHEMA&gt;.TABLE_A_CLONE <strong>CLONE</strong> &lt;PROD_SCHEMA&gt;.TABLE_A ;</p><p>With above command clone TABLE_A_CLONE is created in stage env with the data available at the time of running this query in production table named TABLE_A. Snowflake’s underlying architecture stores data in smaller blocks called micro-partitions. So essentially, your clone is just a new set of metadata that is pointing to same micro-partitions that holds production data.</p><p>Visualize as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*2zQFy9WEtxvUjQpIGglekQ.png" /><figcaption>Pic1: Zero copy cloning illustration</figcaption></figure><p>TABLE_A_CLONE can be used just as any other table. It is fully independent and will support all kinds of DML, DDL operations. Even time travel also can be enabled on this clone separately ( Time travel is yet another wonderful feature of snowflake with which we can go back in time to get an older snapshot of the table, Lets discuss this in detail in a separate article ).</p><p>Now let us say as part of integration testing activities, your ETL jobs got executed in stage environment and inevitably modified some part of data from TABLE_A_CLONE. All this modified data belongs to Micro Partition -3. So, Now how snowflake deals with this change as the same micro partition is shared by production table as well? Well, now snowflake copies that modified micro-partition alone and creates a new micro-partition and assigns this one to stage environment alone as this change is owned by TABLE_A_CLONE alone. ( Users will not have access at micro partition level while exploring snowflake’s database, Here for representational purpose everything is explained in m-p level ).</p><p>Micro Partitions in snowflake are immutable, once created lasts in the same state until table is dropped. Hence, the change in stage environment is captured separately and metadata will point to the newly created micro partition and updates TABLE_A_CLONE.</p><p>This change will be as depicted as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*6GxqLXN3ejnX5BBFLV_pVg.jpeg" /><figcaption>Pic2: Change in cloned data illustration</figcaption></figure><p>So, additional storage costs are levied only for the modified data but not for the complete clone.</p><p>Let us discuss more on various distinguished options made available by snowflake in future posts !</p><p>Keep learning !!</p><p>Resources:</p><ol><li><a href="https://docs.snowflake.com/en/">https://docs.snowflake.com/en/</a></li><li><a href="http://www.google.com/">www.google.com</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be12cbf6adad" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>