Snowflake Information Sharing Capabilities – DZone – Uplaza

Information drives enterprise within the fashionable economic system; the quicker companies can get to knowledge and supply significant insights, the extra they’ll allow knowledgeable decision-making. Snowflake has come a good distance on this house in recent times, and the progress is spectacular. Snowflake can also be being more and more adopted by a number of companies, as it’s well-known for its giant dataset processing and computing energy. It supplies scalability, affordability, safety, ease of use, customization, and simple knowledge integration. As well as, Snowflake supplies a bunch of specialised providers, like Snowflake Arctic, Snowflake for Huge Information, Snowflake Information Sharing, and Snow Pipe, as required relying on the use case. They bring about a robust weapon to the desk for all enterprises striving to money in on strategic knowledge utilization.

On this paper, I’ll discover how knowledge sharing works in Snowflake. Information sharing is the method of constructing knowledge out there to a number of customers, functions, or organizations whereas sustaining its high quality. Organizations usually have to share knowledge with clients, suppliers, and companions, however they face vital challenges corresponding to poor governance, outdated options, guide knowledge transfers, and being tied to particular distributors. To turn out to be really data-driven, organizations want an improved methodology for sharing knowledge. Snowflake gives a contemporary answer to those challenges, enabling seamless and safe knowledge sharing.

Information Sharing

When utilizing Snowflake as your knowledge warehouse, you possibly can share chosen knowledge objects with one other Snowflake account holder and even with somebody who does not have a Snowflake account (by way of a Reader Account). One main benefit of knowledge sharing in Snowflake is that the info is not copied or transferred between accounts. As a substitute, any updates made to the supplier account are instantly out there to the buyer.

Supplier

The supplier, additionally known as the info supplier or producer, is the consumer of a Snowflake account liable for making a share and making it out there to different Snowflake account customers for consumption. Because the creator of the share, the supplier holds the authority to find out which knowledge and sources are shared and accessible to different customers throughout the Snowflake ecosystem.

Client

An information shopper refers to any account that opts to determine a database utilizing a share supplied by an information supplier. As an information shopper, upon integrating a shared database into your account, you acquire entry to and may question the contents of the database in the identical method as some other database inside your account.

There are totally different strategies for sharing knowledge in Snowflake. You may both limit entry based mostly on particular permissions, guaranteeing solely licensed customers can view sure objects, or you can also make the info out there for all meant customers to learn. This flexibility permits for safe and environment friendly knowledge collaboration.

Direct Share

Direct Share is the only methodology for shoppers to entry knowledge shared by a supplier when the supplier and shopper are in the identical area. This strategy requires the info supplier to have entry to the account IDs of the buyer accounts. As soon as arrange, shoppers can simply view and use the shared knowledge objects.

Customers With Snowflake Account

Customers with a Snowflake account will be given entry to knowledge shared by a supplier. The shared objects can solely be accessed by these shoppers. On this setup, the supplier is charged for storage, whereas the buyer is charged for compute utilization. When sharing and consuming knowledge by way of Snowflake shares, it’s essential to comply with finest practices. These embrace validating the info shares, auditing entry to the shared knowledge, and including or eradicating objects from the shares as wanted. This ensures safe and environment friendly knowledge sharing.

A listing of instructions to be executed in Snowflake to share an object from the supplier to the buyer.

CREATE DATABASE ROLE MYSHARE;
GRANT USAGE ON SCHEMA PUBLIC TO DATABASE ROLE MYSHARE;
GRANT SELECT ON VIEW VW_CUSTOMER  TO DATABASE ROLE MYSHARE;
SHOW GRANTS TO DATABASE ROLE MYSHARE;
CREATE OR REPLACE SHARE MY_TEST_SHARE;
GRANT USAGE ON DATABASE SAMPLE_DB TO SHARE MY_TEST_SHARE;
GRANT USAGE ON SCHEMA SAMPLE_DB.PUBLIC TO SHARE MY_TEST_SHARE;
GRANT SELECT ON TABLE SAMPLE_DB.PUBLIC.CUSTOMER_TEST TO SHARE MY_TEST_SHARE;
SHOW SHARES;
SHOW GRANTS TO SHARE MY_TEST_SHARE;
ALTER SHARE MY_TEST_SHARE ADD ACCOUNT= ACC12345;
------ TO SHARE ALL OBJECTS 
GRANT SELECT ON ALL TABLES IN SCHEMA SAMPLE_DB.PUBLIC TO SHARE MY_TEST_SHARE;
GRANT SELECT ON ALL TABLES IN DATABASE SAMPLE_DB  TO SHARE MY_TEST_SHARE;

Customers With No Snowflake Account (Reader Account)

As an information supplier, you would possibly need to share knowledge with a shopper who doesn’t have a Snowflake account or just isn’t able to turn out to be a licensed Snowflake buyer. Customers with no Snowflake account can not entry shared knowledge. To allow entry, you possibly can create a Reader Account and share it with the buyer. With Reader Accounts, sharing knowledge is fast, easy, and reasonably priced with out having the consumer join a Snowflake account. The supplier account that generated every reader account is accountable for managing it. Each the processing and storage charges that the shopper incurs can be lined by the supplier.

CREATE MANAGED ACCOUNT READER_ACCT;
ADMIN_NAME='READER_ACCT';
ADMIN_PASSWORD='**********';
TYPE='READER';
SHOW MANAGED ACCOUNTS;
--Snowflake URL with Locator ( Share it with the Client)
ALTER SHARE SHARE_NAME ADD ACCTID=LOCATOR IN URL IN ABOVE LINE ;
SHARE_RESTRICATIONS=FALSE;
ALTER SHARE QCUFBZG.AXYZ5751.POC_SNOWFLAKE_SECURE_SHARE ADD ACCOUNT=XYZ11993;
SHARE_RESTRICTIONS=FALSE;

When sharing knowledge with a shopper, the buyer can see all the knowledge, and the supplier can not disguise any knowledge. It is prompt that you just share knowledge utilizing safe views. This fashion, solely the attributes meant for the buyer are seen, and entry to different knowledge is restricted. Views must be labeled as safe in the event that they’re meant to make sure knowledge privateness.

Itemizing

Itemizing is a extra superior manner of securely sharing knowledge and operates on the identical producer and shopper mannequin as Direct Share. Nevertheless, it differs in that it is not restricted to the identical area; knowledge will be accessed by Snowflake accounts in several areas. Information will be shared with particular accounts or printed within the Snowflake Market. Listings are available in two varieties: Non-public and Public.

  • Non-public: Non-public listings are solely accessible to particular shoppers. They permit you to make the most of itemizing options to straight share knowledge and different info with different Snowflake accounts in any Snowflake area.
  • Public: Information merchandise will be shared in Snowflake Market publicly. By providing listings on the Snowflake Market, you possibly can promote your knowledge product throughout the Snowflake Information Cloud. This lets you share curated knowledge choices with a number of shoppers without delay, as an alternative of managing sharing preparations with every shopper individually.

Conclusion

Snowflake’s data-sharing capabilities present a contemporary answer for organizations trying to share knowledge securely and effectively. By leveraging the options talked about, companies can overcome conventional data-sharing challenges and unlock the complete potential of their knowledge. Decide the very best strategy in sharing your knowledge with shoppers or accessing the info from suppliers based mostly on the use case. For extra detailed directions and finest practices on implementing knowledge sharing, confer with the official Snowflake documentation.

Share This Article
Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Exit mobile version