Compliance & Privacy (GDPR, CCPA)
This pattern centers on user-scoped datasets, exportability, and controlled retention/deletion.
Core pattern
USERtable scope for per-user data boundaries- storage routing (
STORAGE_ID, optionalUSE_USER_STORAGE) for compliance regions - role-based access checks to reduce accidental cross-user exposure
- auditable row metadata (
CURRENT_USER(), timestamps)
Example Schema
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
# 1) Query user records for export package# 2) Serialize records to archive# 3) Deliver export artifact with audit metadata-- Account deletion path (application-owned workflow)DROP USER 'alice';Last updated on