Skip to Content
Compliance (GDPR/CCPA)

Compliance & Privacy (GDPR, CCPA)

This pattern centers on user-scoped datasets, exportability, and controlled retention/deletion.

Core pattern

  • USER table scope for per-user data boundaries
  • storage routing (STORAGE_ID, optional USE_USER_STORAGE) for compliance regions
  • role-based access checks to reduce accidental cross-user exposure
  • auditable row metadata (CURRENT_USER(), timestamps)

Example Schema

sql snippetSQL
CREATE TABLE app.user_data (  id BIGINT PRIMARY KEY DEFAULT SNOWFLAKE_ID(),  data_type TEXT,  content JSON,  created_by TEXT DEFAULT CURRENT_USER(),  created_at TIMESTAMP DEFAULT NOW()) WITH (  TYPE = 'USER',  STORAGE_ID = 'local',  USE_USER_STORAGE = true,  FLUSH_POLICY = 'interval:300');

Example workflow

bash snippetBASH
# 1) Query user records for export package# 2) Serialize records to archive# 3) Deliver export artifact with audit metadata
sql snippetSQL
-- Account deletion path (application-owned workflow)DROP USER 'alice';
Last updated on