关于 Secure Data Sharing

Secure Data Sharing 允许您与其他 Snowflake 账户共享您账户下数据库内的选定对象。您可以共享以下 Snowflake 对象:

  • Databases

  • Tables

  • Dynamic tables

  • External tables

  • Externally managed and managed Apache Iceberg™ tables

  • Externally managed Delta Lake tables (with Delta Direct and catalog-linked databases)

  • Views

    • Regular views
    • Secure views
    • Secure materialized views
    • Semantic views
  • Cortex Search services

  • User-defined functions (UDFs) (secure and non-secure)

  • Models of type USER_MODEL, CORTEX_FINETUNED, or DOC_AI

Snowflake 支持通过 共享 来共享数据库,共享由数据提供商创建,并由数据使用者“导入”。

Important

All database objects shared between accounts are read-only (i.e. the objects cannot be modified or deleted, including adding or modifying table data).

Secure Data Sharing 的工作原理是怎样的?

With Secure Data Sharing, no actual data is copied or transferred between accounts. All sharing uses Snowflake’s services layer and metadata store. Shared data does not take up any storage in a consumer account and therefore does not contribute to the consumer’s monthly data storage charges. The only charges to consumers are for the compute resources (i.e. virtual warehouses) used to query the imported data.

由于不复制或交换任何数据,提供商可以快速轻松地设置 Secure Data Sharing,使用者则几乎可以即时访问导入的数据:

  • The provider creates a share of a database in their account and grants access to specific objects in the database. The provider can also share data from multiple databases, as long as these databases belong to the same account. One or more accounts are then added to the share, which can include your own accounts (if you have multiple Snowflake accounts).

    For more details, refer to 什么是共享? (in this topic).

  • On the consumer side, a read-only database is created from the share. Access to this database is configurable using the same, standard role-based access control that Snowflake provides for all objects in the system.

通过这种架构,Snowflake 就实现了一个提供商网络,允许与多个使用者(包括其自己的组织内部的使用者)共享数据,且使用者可访问来自多个提供商的导入数据:

Overview of provider accounts sharing data with consumer accounts

Note

Any full Snowflake account can both provide and consume imported data. Snowflake also supports third-party accounts, a special type of account that consumes imported data from a single provider account. For an overview of the publisher–subscriber model and related account types, see Third party (publisher–subscriber) accounts. For reader accounts specifically, see 用于第三方访问的阅读者账户 (in this topic).

什么是共享?

共享是指定的 Snowflake 对象,其中封装了共享数据库所需的全部信息。

Data providers add Snowflake objects (databases, schemas, tables, secure views, etc.) to a share using either or both of the following options:

  • 选项 1: 通过数据库角色向共享授予对象的权限。
  • 选项 2: 将对象的权限直接授予共享。

For more information on these options, refer to How to share database objects.

您可以通过将账户添加到共享,来选择哪些账户可以使用共享中的数据。

(在使用者账户中)从共享创建数据库后,使用者账户中的用户即可访问所有导入的对象:

Relationship between databases, database objects, shares, and accounts

共享是安全、可配置的,并且完全由提供商账户控制:

  • 添加到共享的新对象立即可供全部使用者使用,从而提供对导入的数据的实时访问。
  • 共享中对现有对象的更新会立即同步至所有使用者。
  • 可以随时撤销对共享(或共享中的任何对象)的访问权限。

Snowflake 中的共享选项

可使用以下选项之一在 Snowflake 中共享数据:

  • 列表,在其中将共享和附加元数据作为数据产品提供给一个或多个账户,
  • Direct Share,可直接将特定数据库对象(共享)共享给您所在区域的另一个账户,
  • 数据交换,可在其中设置和管理一组账户并向该组提供共享,
  • a clean room, in which you can share data and control which queries can be run against your data.

You can also convert a direct share to a listing. For instructions, see Convert a direct share to a listing.

See Data sharing and collaboration in Snowflake for more details.

数据提供商和使用者概述

在 Snowflake 中共享时,共享数据的账户称为提供商,而作为数据接收者的账户称为使用者。

关于提供商

数据提供商是任何创建共享并使其可供其他 Snowflake 账户使用的 Snowflake 账户。作为数据提供商,您与一个或多个 Snowflake 账户共享数据库。对于您共享的每个数据库,Snowflake 均支持使用授权,为数据库中选定的对象提供精细的访问控制(即,您授予对数据库中一个或多个特定对象的访问权限)。

You can create as many shares as you want, and add as many accounts to a share as you want. If you want to provide a share to many accounts, you might want to use a listing or a data exchange.

For a guide to sharing data as a provider, refer to Share secure database objects. For more detailed information, refer to Create and configure shares.

关于使用者

数据使用者是选择从数据提供商提供的共享创建数据库的任何账户。作为数据使用者,将导入的数据库添加到您的账户后,即可像访问账户中的其他任何数据库一样,访问和查询数据库中的对象。

您可以使用数据提供商提供的任意多个共享,但每个共享只能创建一个数据库。

For more details, refer to Consume imported data.

与提供商共享的使用指标

If you provide listings privately, using a data exchange, or on the Snowflake Marketplace, you have access to various metrics about consumer usage of your listings, and metrics about the consumer accounts accessing your listings.

For details about usage data for listings, refer to Monitor listing use. Usage data for listings shared in a data exchange is only available in the views contained in the Data Sharing Usage schema of the imported Snowflake database.

用于第三方访问的阅读者账户

仅支持 Snowflake 账户之间的数据共享。作为数据提供商,您可能希望与还没有 Snowflake 账户或尚未准备好成为获得许可的 Snowflake 客户的使用者共享数据。

您可以创建阅读者账户,以便与这些使用者共享数据。阅读者账户(以前称为“只读账户”)提供了一种快捷、简单且经济高效的数据共享方式,而不要求使用者成为 Snowflake 客户。

每个阅读者账户都属于创建它的提供商账户。作为提供商,您可以使用 共享 与阅读者账户共享数据库;但阅读者账户只能使用创建它的提供商账户中的数据。请参考下图:

Overview of data sharing reader accounts

阅读者账户中的用户可查询已通过阅读者账户导入的数据,但不能执行完整账户中允许的任何 DML 任务,例如数据加载、插入、更新和类似的数据操纵操作。

For more details, refer to Manage reader accounts.