Skip to main content

Sharing data with specific users

MotherDuck enables you to securely share data with specific users. Common scenarios include:

  • Building data applications, in which each tenant should only have access to their own data.
  • Sharing sensitive data within your Organization.
  • Sharing data outside of your Organization.

Sharing data with others is easy:

  1. Data provider creates a Hidden share.
  2. Data provider gets back the share URL and passes this URL to the data consumer.
  3. Data consumer attaches the share.
  4. Data provider periodically updates the share to push new data to data consumers.

1. Creating hidden shares

To share a database, first create a Hidden share. No actual data is copied and no additional costs are incurred in this process.

  1. Click on the "trident" next to the database you'd like to share. Select "share". trident
  2. Optionally name the share.
  3. Under Access choose "Anyone in my Organization" if you'd like to limit access to only members of your Organization.

If you choose "Anyone with the share link", MotherDuck users outside of your Organization will have access to this share as well.

  1. Create the share.
  2. Copy the resulting ATTACH command to your clipboard and send it to your data consumers. trident

2. Consuming shares

The data consumer in your Organization can use SQL to attach the share and start querying it!

Run the ATTACH command to attach the share as a queryable database. This is a zero-cost metadata-only operation.

ATTACH md:_share/birds/e9ads7-dfr32-41b4-a230-bsadgfdg32tfa; -- Creates a zero-copy clone database called birds

Learn more about ATTACH SHARE.

3. Updating shared data

If the database being shared has changed, in order for the changes to propagate to the data consumer, the data provider needs to update the share.

UPDATE SHARE birds; 

Learn more about UPDATE SHARE.

note

We are working on auto-updating shares.