TL;DR
DP4SQL introduces a flexible differential privacy (DP) framework for relational databases that moves away from rigid, "one-size-fits-all" privacy policies. By allowing data curators to mix and match fine-grained privacy labels at the column level, the system automatically derives precise noise bounds for SQL queries. This prevents relational DP systems from either underprotecting sensitive data or destroying utility with excessive noise.
What Problem Does This Paper Address?
Applying differential privacy to relational databases is notoriously difficult. Traditional DP models assume a single-table setup where hiding an individual's presence is straightforward. Real-world databases, however, split an individual's information across multiple tables connected by foreign keys.
Existing DP SQL systems rely on hard-coded, rigid "neighbor relations" (the mathematical definition of what data should be indistinguishable to an attacker). They typically treat entire records or entities uniformly. This creates a severe mismatch in practice:
- Partially public data: A table might contain public columns (e.g., course names) alongside private ones (e.g., student grades). Rigid systems treat the whole table as private, injecting unnecessary noise.
- Public table sizes: If the total number of records is public knowledge, deleting a record to simulate a "counterfactual world" violates public knowledge. Instead, values must be replaced, which changes query stability metrics.
Data administrators currently face a daunting choice: manually rewrite complex privacy proofs for every policy tweak, or accept a rigid system that either leaks privacy or ruins query utility.
Methods
The authors propose DP4SQL, a multi-level middleware system that automatically translates human-friendly privacy policies into rigorous mathematical noise bounds:
- High-Level Privacy Labels: Administrators label relations or columns using three intuitive categories:
DEL: Protects the very existence of records (unbounded DP).REP^A: Protects specific attributes $A$ while assuming the table size and other columns are public (bounded DP).PUB: Marks the entire relation as public.- Data Ownership Graphs: To track how an entity's data propagates across a schema, DP4SQL constructs a directed graph based on foreign key constraints. This maps out exactly which records are transitively "owned" by a private entity (e.g., a student owning records in an enrollment table).
- Low-Level Plausible Deniability Actions: The system automatically compiles these high-level labels into concrete data actions:
Add(add rows),Del(delete rows), andRep(replace values). - Automated Inference System: DP4SQL uses an inference engine with production rules to track these actions through standard relational algebra operators (Select, Project, Join, Group-By, and Aggregations like
COUNT,SUM, andAVG). It leverages integrity constraints to bound "join amplification" tightly, ultimately computing an upper bound on the query's global sensitivity to calibrate Laplace noise.
Datasets
The paper evaluates DP4SQL using two setups:
- University Database Case Study: A synthetic, multi-table schema representing students, faculty, scholarships, course sections, and enrollments to demonstrate fine-grained policy handling.
- TPC-H Benchmark: An industry-standard benchmark representing a complex business environment. The evaluation uses a standard scale factor of 1, resulting in a database containing 8.7 million records across eight tables.
Key Insights and Ideas
- The Public Size Paradox: Counterintuitively, knowing that a table size is public can sometimes require more noise for certain queries. For example, if a student's ID is replaced rather than deleted, it alters two groups in a
GROUP BYquery (decrementing one, incrementing another) instead of just dropping one. Naive systems that don't model this correctly end up underprotecting data. - Leveraging Key Joins: General joins can cause sensitivity bounds to explode because any row can theoretically match many rows. However, by explicitly tracking primary-foreign key constraints in the schema, DP4SQL applies a much tighter bounding rule (
T-Key1), drastically reducing the required noise without sacrificing privacy.
Key Results
The authors compared DP4SQL against baseline rigid policies and Tumult Analytics (a production-grade DP framework based on PrivateSQL):
- Eliminating Underprotection: In the university case study (Query 3), baseline unbounded policies under-approximated query sensitivity because they failed to account for public table sizes, leading to insufficient noise injection. DP4SQL correctly identified the higher sensitivity and applied the safe amount of noise.
- Massive Utility Gains: For queries returning entirely public information from a mixed table (e.g., Query 16 on TPC-H), baseline systems assumed the underlying relations were fully private and injected massive noise, rendering the output useless (worse than a model that always outputs 0). DP4SQL recognized the public nature of the requested attributes and returned the exact answer with zero added noise.
- Comparable Performance on Standard Queries: For baseline queries where data was uniformly private (Queries 1 and 4), DP4SQL matched the tight sensitivity bounds and low relative error of existing state-of-the-art tools.
Limitations and Future Work
- Declarative Policy Complexity: Currently, administrators must label base tables. The authors plan to explore higher-level declarative policies where users can specify privacy goals directly for complex database views (e.g., "hide all interactions between any faculty-student pair") and let the system infer the table labels.
- Utility-Guided Query Rewriting: While DP4SQL avoids altering query semantics, integrating data-dependent optimization techniques like data truncation or record dropping could help safely lower global sensitivity bounds for highly complex, nested queries.
Summary updated