Snowflake Data Mesh
Ownership, not centralisation
A data mesh is an organisational model expressed through technical boundaries: domains own their data as products, a self-serve platform makes those products consumable, and governance is federated â policies set centrally, enforced by the domains themselves. The technology does not create the mesh; it makes the ownership boundaries real. In Snowflake those boundaries are schemas or databases owned by domain roles, sharing grants that cross them, and tag-driven policies that apply uniformly without a central team editing every object.
The reason Snowflake suits this model is that its sharing primitives are cheap. Moving data between two domains does not require a copy, a pipeline, or a ticket â it requires a grant, and the grant can be scoped to specific views rather than whole databases. That makes the marginal cost of a new data product small, which is what allows product thinking to replace the extract-and-deliver pattern.
- Domains own schemas, pipelines, and quality for their own data.
- Products are versioned, documented, discoverable interfaces, not tables.
- Governance defines the rules centrally; domains enforce them in their own objects.
Prerequisites
- !Snowflake roles and grants
- !Data sharing and secure views
What You'll Learn
- 1Map mesh principles onto Snowflake databases, roles, and grants
- 2Package a domain's data as a secure, documented product
- 3Apply federated governance through tags and masking policies
- 4Measure product health with usage and quality metrics
The four principles, mapped to objects
Each mesh principle has a concrete Snowflake counterpart, and getting the mapping right is most of the design work. Ambiguity here is what produces a mesh in name only, where every domain nominally owns data but any table can be selected by any analyst.
| Principle | Snowflake object | Enforced by | Failure without it |
|---|---|---|---|
| Domain ownership | database or schema per domain | role grants | central team becomes a bottleneck |
| Data as product | secure view or share | USAGE on product role | raw tables leak upstream |
| Self-serve platform | warehouses, stages, templates | platform team's grants | every domain reinvents ingestion |
| Federated governance | tags, policies, masking | account-level policy objects | rules exist on paper only |
The ownership mapping has one decision that deserves care: database-per-domain versus schema-per-domain. Databases give the strongest isolation â Time Travel retention, grants, and object names are all namespaced â but complicate cross-domain joins because two databases cannot be joined in one USE. Schema-per-domain inside a shared database makes joins trivial and relies entirely on grants for isolation. Most teams start with schema-per-domain for frictionless analytics and introduce database boundaries only for domains with regulatory separation.
Defining a domain and its product
A domain is a role hierarchy plus a namespace plus a service level. The role owns the schemas, the schemas hold the pipelines and models, and the product is the interface other domains are allowed to touch â almost always a secure view or a share rather than a base table.
-- The domain's administrative role
CREATE ROLE IF NOT EXISTS marketing_domain_admin;
-- Namespace owned by the domain
CREATE SCHEMA IF NOT EXISTS marketing_domain
WITH MANAGED ACCESS
COMMENT = 'Marketing domain: campaigns, attribution, audience segments';
GRANT USAGE ON DATABASE analytics TO ROLE marketing_domain_admin;
GRANT CREATE SCHEMA ON DATABASE analytics TO ROLE marketing_domain_admin;
GRANT OWNERSHIP ON SCHEMA analytics.marketing_domain
TO ROLE marketing_domain_admin REVOKE CURRENT GRANTS;
-- The product role: what other domains are granted
CREATE ROLE IF NOT EXISTS marketing_product_reader;
-- The product itself: a secure view with contracts applied
CREATE OR REPLACE SECURE VIEW analytics.marketing_domain.customer_audience
COMMENT = 'DATA PRODUCT: audience scores for campaign targeting. Owner: marketing. SLA: refreshed hourly. Contact: #marketing-data.'
AS
SELECT
c.customer_id,
a.segment,
a.propensity,
a.scored_at
FROM analytics.marketing_domain._staging.audience_scores a
JOIN analytics.core.customers c
ON c.customer_id = a.customer_id
WHERE a.scored_at >= DATEADD(day, -90, CURRENT_TIMESTAMP());
-- Grant product access, never table access
GRANT SELECT ON VIEW analytics.marketing_domain.customer_audience
TO ROLE marketing_product_reader;
GRANT USAGE ON SCHEMA analytics.marketing_domain
TO ROLE marketing_product_reader;
-- Consumers receive the product role, not the domain role
GRANT ROLE marketing_product_reader TO ROLE analytics_analyst;
WITH MANAGED ACCESS on the domain schema is the mechanism that keeps ownership real: only the schema owner can grant on objects inside it, so a well-meaning engineer cannot accidentally grant the whole world on a staging table. The product view carries its contract in the comment, and the product role is the only handle consumers ever hold â which means deprecating a product is revoking one grant rather than chasing every downstream role.
Federated governance
Federated governance means the centre defines policy once and domains comply without a review queue. In Snowflake the policy objects live at account level: classification tags, masking policies, row access policies, and network rules. Domains apply them to their own objects, and compliance can be verified centrally by querying which objects reference which policies.
-- Classify columns once; domains attach the tags
CREATE OR REPLACE TAG pii_email
COMMENT = 'Email address: PII, masking required';
CREATE OR REPLACE TAG pii_customer_id
COMMENT = 'Customer identifier: restricted sharing';
-- Apply classification at the domain level
ALTER TABLE analytics.marketing_domain._staging.audience_scores
MODIFY COLUMN customer_id SET TAG pii_customer_id = 'true';
-- Row access policy: region isolation enforced in the policy
CREATE OR REPLACE ROW ACCESS POLICY region_isolation AS (region STRING)
RETURNS BOOLEAN ->
CURRENT_ROLE() IN ('ACCOUNTADMIN', 'SECURITY_OFFICER')
OR region = CURRENT_SETTING('app.user_region')
OR CURRENT_SETTING('app.user_region') = 'GLOBAL';
ALTER TABLE analytics.marketing_domain.audience_scores_applied
ADD ROW ACCESS POLICY region_isolation ON (region);
-- Which objects use which policies? Federated compliance check
SELECT
ref_database_name,
ref_schema_name,
ref_entity_name,
policy_name,
policy_kind
FROM TABLE(INFORMATION_SCHEMA.POLICY_REFERENCES())
WHERE policy_name IN ('REGION_ISOLATION')
OR policy_kind = 'MASKING_POLICY'
ORDER BY ref_database_name, ref_schema_name, ref_entity_name;
-- Tag coverage across a domain
SELECT
table_schema,
table_name,
column_name,
tag_name,
tag_value
FROM TABLE(INFORMATION_SCHEMA.TAG_REFERENCES_ALL_COLUMNS(
'ANALYTICS', 'DATABASE'))
WHERE tag_name IN ('PII_EMAIL', 'PII_CUSTOMER_ID')
ORDER BY table_schema, table_name, column_name;
The tag-reference query is what turns governance from a document into a control. A monthly report of untagged columns that look like PII gives the centre something measurable to hold domains accountable for, and it does not require the centre to review any individual change.
Sharing products across domains
Because products are views or shares, cross-domain consumption is a grant rather than a pipeline. The two paths â same-account grants and cross-account shares â have different operational profiles, and most meshes use both.
-- Same account: grant the product role to a consumer domain
GRANT ROLE marketing_product_reader TO ROLE finance_analyst;
-- Cross-account: create a share of the product schema
CREATE OR REPLACE SHARE marketing_share
COMMENT = 'Marketing domain products for the regional subsidiary';
GRANT USAGE ON DATABASE analytics TO SHARE marketing_share;
GRANT USAGE ON SCHEMA analytics.marketing_domain TO SHARE marketing_share;
GRANT SELECT ON VIEW analytics.marketing_domain.customer_audience
TO SHARE marketing_share;
-- Add a consumer account
ALTER SHARE marketing_share ADD ACCOUNTS = ('SUBSIDIARY_ACCT_ID');
-- On the consumer side
CREATE DATABASE marketing_sub
FROM SHARE analytics_org.marketing_share;
-- Revoke is the deprecation story
ALTER SHARE marketing_share REMOVE ACCOUNTS = ('SUBSIDIARY_ACCT_ID');
REVOKE ROLE marketing_product_reader FROM ROLE finance_analyst;
Secure shares are what make a mesh economically viable across accounts: the data is not copied, so the consuming account pays only for the compute that reads it, and the producing account's retention and masking policies continue to apply. The mental model to carry is that a share is a live pointer with access control, not a snapshot.
The self-serve platform layer
The platform team's job is to make the marginal cost of a new domain near zero. Concretely that means templated ingestion patterns, a standard role naming convention, shared warehouses with sensible defaults, and a publishing checklist that every data product passes before its grant is opened. The test for whether the platform is working is simple: how long does it take a new domain to go from empty schema to a first published product?
| Platform offering | What it standardises | What it removes |
|---|---|---|
| Naming and role conventions | object and grant structure | review meetings about naming |
| Ingestion templates | file formats, staging, CDC patterns | bespoke per-domain loaders |
| Product checklist | documentation, tests, SLA fields | products nobody trusts |
| Shared warehouses | sizing, timeouts, auto-suspend | runaway credit incidents |
| Quality harness | tests run in CI before publish | production surprises |
The checklist deserves emphasis because documentation is the part most often skipped. A product without a stated owner, refresh cadence, and known limitations is a table with a grant â and consumers will discover its quirks the hard way, in a dashboard, at the worst possible moment.
Metrics that tell you the mesh is working
Meshes fail in measurable ways: products nobody uses, domains that cannot ship, and governance that nobody can verify. Each of those has a Snowflake-visible signal.
-- Which products are actually used?
SELECT
ref_entity_name AS product,
COUNT(DISTINCT user_name) AS consumers,
COUNT(*) AS queries,
MAX(query_start_time) AS last_used
FROM snowflake.account_usage.access_history
CROSS JOIN LATERAL FLATTEN(input => direct_objects_accessed) obj
JOIN snowflake.account_usage.query_history q
ON q.query_id = access_history.query_id
WHERE query_start_time >= DATEADD(day, -30, CURRENT_TIMESTAMP())
AND ref_entity_name ILIKE '%MARKETING_DOMAIN%'
GROUP BY ref_entity_name
ORDER BY consumers DESC, queries DESC;
-- Product freshness: how stale is the newest published data?
SELECT
MAX(scored_at) AS last_product_refresh,
DATEDIFF(hour, MAX(scored_at), CURRENT_TIMESTAMP()) AS hours_stale
FROM analytics.marketing_domain.customer_audience;
-- Per-domain object counts: is ownership concentrating or fragmenting?
SELECT
table_schema,
COUNT(*) AS objects,
COUNT(DISTINCT table_owner) AS owners
FROM information_schema.tables
WHERE table_schema ILIKE '%DOMAIN%'
GROUP BY table_schema
ORDER BY objects DESC;
-- Governance coverage: untagged columns in domain schemas
SELECT
table_schema,
COUNT(*) AS untagged_pii_like_columns
FROM information_schema.columns
WHERE table_schema ILIKE '%DOMAIN%'
AND REGEXP_LIKE(column_name, 'email|phone|ssn|address', 'i')
AND NOT EXISTS (
SELECT 1
FROM TABLE(INFORMATION_SCHEMA.TAG_REFERENCES_ALL_COLUMN(
table_catalog || '.' || table_schema, 'SCHEMA')) t
WHERE t.column_name = information_schema.columns.column_name
)
GROUP BY table_schema;
The product-usage query is the uncomfortable one. A mesh that publishes twenty products and uses two has a documentation problem masquerading as a platform problem, and the fix is usually retiring the unused products so the catalogue reflects reality.
Mistakes that collapse a mesh back into a warehouse
Common Mistakes
Granting consumers the domain's administrative role
Fix: Create a product role per product and grant only that; the admin role should never leave the domain.
Publishing base tables instead of secure views
Fix: Base tables leak upstream columns and break the product contract the moment the model changes.
Centralising approval for every new product
Fix: Federate: the centre defines policy and the domains self-serve, or the mesh becomes a queue.
Skipping documentation because the view is self-explanatory
Fix: An owner, a refresh cadence, and known limitations are the minimum for a product anyone will trust.
Letting every domain invent its own role naming
Fix: Standardise conventions in the platform layer so grants are enumerable and reviewable.
Measuring success by product count
Fix: Measure by consumption; unused products are catalogue debt, not progress.
Applying governance only in the central team's review
Fix: Encode rules as tags and policies applied by domains, then verify coverage centrally.
Copying data between domains with pipelines when a grant would do
Fix: Copies create divergence and cost; shares keep a single source of truth.
Practices that keep domains genuinely autonomous
Best Practices
- Give every product a product role, a documented secure view, and a named owner.
- Use WITH MANAGED ACCESS on domain schemas so only the domain owner grants on its objects.
- Encode governance as account-level tags and policies that domains attach rather than discuss.
- Publish a product checklist and make the grant step contingent on passing it.
- Run usage, freshness, and coverage queries on a schedule and review them with domains.
- Prefer shares over copies for cross-account and cross-domain movement.
- Retire unused products; a smaller trustworthy catalogue outperforms a large ambiguous one.
- Keep the platform layer's job to reduce time-to-first-product, and measure it.
Key takeaways
Key Takeaways
- A data mesh is ownership boundaries made real by roles, schemas, and grants â not by a new tool.
- Products are secure views or shares with documented contracts, never raw base tables.
- Federated governance means centrally defined tags and policies, applied and verified locally.
- Secure shares make cross-domain and cross-account movement cheap enough that copying becomes the exception.
- The platform team's metric is time-to-first-product for a new domain.
- Unused products are the most common silent failure; consumption metrics expose them.
- Grant the product role, never the domain admin role â that single rule protects most of the model.
Where to go next
- Access Control â the role model every domain boundary rests on.
- Data Sharing â the mechanics of shares within and across accounts.
- Governance â tags, classification, and policy objects used above.
- Access History â the consumption and coverage evidence for domain health.