Data Movement · Topic 12 of 17

Secure Data Sharing Versus Cloning

Decide between a data share and a clone, build a share with the right grants, and know reader accounts, consumer setup, costs and cross region limits.

  • 5 min
  • Includes a diagram
In a nutshell
  • Sharing copies no data. Consumers get a read only database per share and use their own compute.
  • Provider pays for storage, consumer pays for query compute.
  • Share steps: CREATE SHARE, grants of usage and select, ALTER SHARE ADD ACCOUNTS.

What it is

Secure Data Sharing lets a provider account give other accounts read access to its data without copying it. A clone is a zero copy duplicate of an object inside your own account, which then lives independently.

Providerowns the datashareConsumer accountread only databasequeries in placeProvider storageSource tableCLONECloneindependent copy of metadatadivergesOwn changes and storage

How it works

Share or clone

Choosing between a zero-copy clone for a copy in the same account, Secure Data Sharing for another account, a reader account for a consumer without Snowflake, and replication or auto-fulfillment for another region or cloud.

QuestionData shareClone
Who gets accessOther Snowflake accounts (or reader accounts)Users in the same account
Is data copiedNo, consumers query the provider's dataNo at creation, but the clone stores its own changes afterward
Can it be changed by the receiverNo, shared objects are read onlyYes
Stays current with sourceYes, changes are visible immediatelyNo, it is a point in time copy
Storage costProvider onlyClone's changed data adds storage
Compute costConsumer pays for its own queriesSame account pays

Pick a share when another account needs live, read only access. Pick a clone for a dev or test copy, a pre change backup or a what if analysis inside your own account.

Watch out

A consumer cannot clone a database created from a share, and cannot change anything in it. If the consumer needs a changeable copy, they must create their own table from the shared data, for example with CTAS.

Building a share

The provider creates a share and grants it access to the objects, then adds consumer accounts.

CREATE SHARE sales_share;
GRANT USAGE ON DATABASE sales_db TO SHARE sales_share;
GRANT USAGE ON SCHEMA sales_db.public TO SHARE sales_share;
GRANT SELECT ON TABLE sales_db.public.orders TO SHARE sales_share;
ALTER SHARE sales_share ADD ACCOUNTS = myorg.partner_acct;

The consumer then creates a read only database from the share and grants access to local roles.

CREATE DATABASE partner_sales FROM SHARE provider_org.provider_acct.sales_share;
GRANT IMPORTED PRIVILEGES ON DATABASE partner_sales TO ROLE analyst;
ProviderCREATE SHAREGRANT usage and selectShareADD ACCOUNTSConsumerCREATE DATABASE FROM SHAREIMPORTED PRIVILEGESAnalyst role

Points for design:

  • Shareable objects include databases, tables (including dynamic, external and Iceberg tables), secure views, secure materialized views, UDFs and some AI objects such as Cortex Search services.
  • Database roles can be granted to a share to control which objects each consumer sees.
  • Views from several databases: a secure view that reads another database needs REFERENCE_USAGE on that database granted to the share.
  • Secure views are recommended for shares, because they hide the definition and prevent leaking data through optimizer behavior. A regular view can be added only to a share created with SECURE_OBJECTS_ONLY = FALSE, and that setting cannot be changed back.
  • Changes in the provider's tables show up for consumers at once, and access can be revoked at any time.
  • Only roles with the privileges to create shares (for example ACCOUNTADMIN or a role with CREATE SHARE) can build one. The consumer needs IMPORT SHARE or ACCOUNTADMIN to create the database.

Reader accounts

A consumer without a Snowflake account can get a reader account that the provider creates, owns and pays for. Reader accounts can query shared data but cannot do DML on it. The provider pays for the compute those users consume.

Region and cloud boundaries

A direct share works only inside one region on one cloud platform. To reach a consumer in another region or cloud, publish through a listing with cross cloud auto-fulfillment, which replicates the data product for you. This is covered with listings on the next pages.

Exam tip

When the exam says "no data is copied", the answer is Secure Data Sharing. When it says "independent copy with its own changes", it is a clone.

Costs

Consumers pay only for compute they use to query shared data. The provider continues to pay for the storage of the shared data. Cloning costs nothing at creation, and storage grows as the clone or the source changes.

Common mistakes

  • Granting SELECT on a table to a share without granting USAGE on its database and schema.
  • Sharing a view that reads another database without granting REFERENCE_USAGE on it.
  • Sharing a regular view and exposing the definition. Prefer secure views.
  • Expecting a consumer to write to or clone a shared database.
  • Trying a direct share to an account in a different region or cloud.
  • Forgetting GRANT IMPORTED PRIVILEGES, so no role in the consumer account can see the database.

What to remember for the exam

  • Sharing copies no data. Consumers get a read only database per share and use their own compute.
  • Provider pays for storage, consumer pays for query compute.
  • Share steps: CREATE SHARE, grants of usage and select, ALTER SHARE ADD ACCOUNTS.
  • Consumer steps: CREATE DATABASE ... FROM SHARE, then GRANT IMPORTED PRIVILEGES.
  • Secure views are the way to share view logic safely. Cross database views need REFERENCE_USAGE.
  • Reader accounts are for consumers without an account, owned and paid for by the provider.
  • Direct shares stay within a region. Use a listing with auto-fulfillment across regions and clouds.
  • A clone is a zero copy duplicate in the same account and can be changed independently.

Check yourself

  • A partner with its own Snowflake account needs always current, read only access to a table. Share or clone?

    A share, because consumers query the provider's live data without a copy.

  • What must the consumer do after creating a database from a share so analysts can query it?

    Grant IMPORTED PRIVILEGES on the database to a local role.

  • Who pays for the compute used by a reader account?

    The provider, which owns and pays for the reader account.

Topic 12 of 17 in Data Movement

Test yourself on Data Movement

The full Snowflake DEA-C02 question bank has 709 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Snowflake. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.