luvv to helpDiscover the Best Free Online Tools
Topic 6 of 8

Data Sharing And Access Patterns

Learn Data Sharing And Access Patterns for free with explanations, exercises, and a quick test (for Data Engineer).

Published: January 8, 2026 | Updated: January 8, 2026

Why this matters

As a Data Engineer, you enable safe, fast, and reliable ways for others to use warehouse data. Good sharing and access patterns reduce cost, protect sensitive data, and keep analytics and ML teams productive.

  • Serve BI dashboards without overloading the warehouse.
  • Enable data scientists to explore at scale with guardrails.
  • Share governed datasets with partners or other domains.
  • Apply row/column policies to protect PII while preserving utility.
Real tasks you will do
  • Create read-only views and materialized aggregates for dashboards.
  • Implement row-level and column-level security.
  • Publish curated data products with contracts and SLAs.
  • Set up batch extracts or governed shares for external partners.
  • Monitor access, cost, and performance; adjust patterns as usage evolves.

Concept explained simply

Data sharing and access patterns are reusable ways to let others read warehouse data safely and efficiently. You pick the right interface (views, extracts, files, APIs), apply the right policies (RLS, masking), and tune performance (aggregates, caching) so consumers get what they need without risking cost spikes or data leaks.

Mental model

Think of your warehouse as a library:

  • Collections: curated data products (facts/dimensions, features).
  • Library cards: roles and permissions per reader.
  • Reading rooms: interfaces (dashboards, SQL views, files, notebooks).
  • Librarian rules: policies like row/column security and data contracts.
  • Study guides: aggregates and semantic layers for faster answers.
Checklist: a good access pattern
  • Clear consumer and use-case defined.
  • Least-privilege permissions and data minimization.
  • Predictable performance and cost controls.
  • Governed interface (documented schema, SLAs).
  • Monitoring and feedback loop.

Key patterns you should know

Interfaces

  • SQL Views and Materialized Views: stable schemas, can enforce policies and pre-aggregation.
  • Batch Extracts: periodic snapshots to object storage (e.g., Parquet/CSV) for downstream tools.
  • Federated/Direct Query: live queries to curated views with caching and limits.
  • Open Data Shares/Protocols: read-only, versioned access to tables for external consumers.
  • APIs/Services: narrow, pre-validated slices for apps or operations.

Governance controls

  • Row-Level Security (RLS): filter rows per role/user (e.g., region = 'EU').
  • Column-Level Security (CLS)/Masking: hide or hash sensitive fields by role.
  • Object Tagging and Policies: mark PII and auto-enforce rules.
  • Data Contracts: define schema, freshness, SLAs, quality expectations.

Performance and cost

  • Precompute heavy aggregations for dashboards.
  • Sampling and downscaling for exploration; full scans only when needed.
  • Workload isolation (separate compute/warehouses) to prevent noisy neighbors.
  • Caching and extract refresh cadence aligned to business SLAs.
Design steps you can reuse
1. Identify consumers: BI, DS, partners, apps. Clarify queries, latency, and data sensitivity.
2. Choose interface: views/materialized views, extracts, shares, or APIs.
3. Apply governance: roles, RLS, masking, contracts.
4. Optimize path: aggregates, clustering/partitioning, indexing, caching.
5. Isolate and monitor: separate compute, quotas, usage dashboards, alerts.

Worked examples

Example 1: BI dashboards over sales
  • Need: Hourly-updated KPI dashboards; sub-second visuals; regional access.
  • Pattern: Materialized aggregates, semantic views, RLS on region.
  • Why: Fast queries, single source of truth, least privilege.
-- Aggregated table for dashboard
CREATE MATERIALIZED VIEW mv_sales_hourly AS
SELECT store_id, region, date_trunc('hour', ts) AS hour,
       SUM(amount) AS revenue, COUNT(*) AS orders
FROM fct_sales
GROUP BY 1,2,3;

-- RLS via view
CREATE VIEW v_sales_kpi AS
SELECT * FROM mv_sales_hourly
WHERE region = current_setting('app.region');
Example 2: Data science notebooks
  • Need: Ad-hoc exploration on large events; occasional full scans.
  • Pattern: Isolated compute for DS, default sampled views, on-demand full table with guardrails.
  • Why: Protects prod BI, reduces cost; still allows deep dives.
-- Sampled view for exploration
CREATE VIEW v_events_sample AS
SELECT * FROM fct_events TABLESAMPLE SYSTEM (5);

-- Usage policy: DS role has read on curated tables via isolated warehouse.
Example 3: External partner product feed
  • Need: Partner sees near-real-time product catalog; PII excluded.
  • Pattern: Read-only share of versioned tables or scheduled Parquet extract; CLS masking of sensitive columns.
  • Why: Auditable, revocable, scalable distribution without VPN or DB writes.
-- Publish curated columns only
CREATE VIEW v_products_share AS
SELECT product_id, name, category, price, last_updated
FROM dim_product
WHERE is_active = true;

-- Mask anything sensitive at source if present
-- (e.g., no emails or internal costs exposed)

Exercises

Do these to lock in the concepts. Quick test is available to everyone; log in to save your progress.

Exercise 1 (Design): Marketing wants daily customer segmentation in BI across US and EU. Only EU analysts can see EU PII; US analysts see US PII only. Dashboards refresh daily; cost must be predictable.
  • Choose interface.
  • Define modeling/aggregations.
  • Describe governance (RLS/CLS, roles).
  • Plan performance and refresh cadence.
  • Monitoring and rollback plan.
Hints
  • Materialize daily aggregates for segments.
  • RLS by region; CLS to mask PII out-of-region.
  • Use read-only semantic views for BI.
Show solution

Interface: BI reads semantic views over daily materialized aggregates. Modeling: Dimensional model (dim_customer, dim_region, fct_segments_daily). Aggregations: Precompute segment counts and lift by region. Governance: Roles us_bi and eu_bi; RLS region = 'US' or 'EU'; CLS masking on PII columns for non-matching region. Performance: Refresh aggregates nightly; cache BI extracts; isolate BI compute. Monitoring: Track dashboard query latency, bytes scanned, and refresh success; rollback by switching BI to previous successful partition if refresh fails.


Exercise 2 (SQL policy): You have orders(customer_id, region, amount). Create a view for EU analysts that only shows EU rows and masks customer_id to keep the last 4 characters.
Hints
  • Use WHERE region = 'EU'.
  • Masking: concatenate stars with RIGHT(customer_id, 4).
Show solution
CREATE VIEW v_orders_eu AS
SELECT
  CONCAT(REPEAT('*', GREATEST(LENGTH(customer_id)-4, 0)), RIGHT(customer_id, 4)) AS customer_id_masked,
  region,
  amount
FROM orders
WHERE region = 'EU';

Self-check checklist

  • Did you enforce least privilege (only needed columns/rows)?
  • Did you separate compute for different consumer groups?
  • Did you define refresh cadence that matches business SLAs?
  • Did you include monitoring and a rollback/disable plan?

Common mistakes

  • Granting broad table access instead of views with RLS/CLS. Fix: expose only curated views; tag and mask PII.
  • Relying only on live queries for BI. Fix: pre-aggregate and cache where possible.
  • No workload isolation. Fix: separate warehouses/compute pools per consumer/team.
  • Unbounded notebook scans. Fix: default to sampled views, quotas, and cost alerts.
  • Sharing raw staging data with partners. Fix: publish stable, versioned curated datasets with contracts.
How to self-check
  • Random user test: can a user see what they should not? If yes, tighten RLS/CLS.
  • Cost drilldown: which dashboards or users scan the most bytes?
  • Schema stability: did a change break downstream? If yes, define a contract and versioning.

Practical projects

  • Project 1: Publish a sales analytics data product with a data contract, RLS by region, and a BI-ready semantic view plus a daily materialized aggregate.
  • Project 2: Create a partner share (or scheduled Parquet export) for a product catalog, excluding PII, with monitoring and revoke procedure.
  • Project 3: Build a DS sandbox: sampled views, isolated compute, and a pathway to request full scans with approval.

Learning path

  • Start: RLS/CLS basics, roles/permissions, curated views.
  • Next: Materialized views and aggregate tables for BI performance.
  • Then: Data contracts, versioning, and change management.
  • Advanced: External data sharing, open protocols, and cross-domain governance.

Who this is for

  • Data Engineers who publish warehouse datasets to BI, DS, and partners.
  • Analytics Engineers defining semantic layers and aggregates.

Prerequisites

  • SQL proficiency (views, joins, aggregations).
  • Basics of dimensional modeling.
  • Understanding of roles/permissions in your warehouse.

Next steps

  • Instrument usage metrics (bytes scanned, concurrency, cache hits).
  • Draft data contracts for your top 3 data products.
  • Pilot RLS/CLS on a sensitive dataset and document results.

Mini challenge

Choose an access pattern for each scenario and justify briefly:

  • Near-real-time operations dashboard with strict cost controls.
  • Monthly partner report; they need only 6 columns and last 90 days.
  • Company-wide self-serve metrics with sensitive user attributes.

Keep answers to 3–5 sentences each.

Practice Exercises

2 exercises to complete

Instructions

Marketing wants daily customer segmentation in BI across US and EU. Only EU analysts can see EU PII; US analysts see US PII only. Dashboards refresh daily; cost must be predictable.

  • Choose interface.
  • Define modeling/aggregations.
  • Describe governance (RLS/CLS, roles).
  • Plan performance and refresh cadence.
  • Monitoring and rollback plan.
Expected Output
A short design spec: interface, aggregates, roles/policies, refresh cadence, monitoring and rollback.

Data Sharing And Access Patterns — Quick Test

Test your knowledge with 7 questions. Pass with 70% or higher.

7 questions70% to pass

Have questions about Data Sharing And Access Patterns?

AI Assistant

Ask questions about this tool