DPSQL+: A Differentially Private SQL Library with a Minimum Frequency Rule
Organizations: LY Corporation
Abstract
SQL is the de facto interface for exploratory data analysis; however, releasing exact query results can expose sensitive information through membership or attribute inference attacks. Differential privacy (DP) provides rigorous privacy guarantees, but in practice, DP alone may not satisfy governance requirements such as the minimum frequency rule, which requires each released group (cell) to include contributions from at least distinct individuals. In this paper, we present DPSQL+, a privacy-preserving SQL library that simultaneously enforces user-level -DP and the minimum frequency rule. DPSQL+ adopts a modular architecture consisting of: (i) a Validator that statically restricts queries to a DP-safe subset of SQL; (ii) an Accountant that consistently tracks cumulative privacy loss across multiple queries; and (iii) a Backend that interfaces with various database engines, ensuring portability and extensibility. Experiments on the TPC-H benchmark demonstrate that DPSQL+ achieves practical accuracy across a wide range of analytical workloads -- from basic aggregates to quadratic statistics and join operations -- and allows substantially more queries under a fixed global privacy budget than prior libraries in our evaluation.
Figures & tables
| System | Architecture | Min freq. | Accountant | Backend compatibility |
|---|---|---|---|---|
| DPSQL+ (ours) | Proxy-based | Yes | Integrated | Spark SQL, SQLite, DuckDB |
| SmartNoise SQL OpenDP Community (2023) | Proxy-based | No | Integrated | Spark SQL, SQLite, PostgreSQL, BigQuery, SQL Server, etc |
| Qrlew Grislain et al. (2024) | Query Rewriting | No | External | PostgreSQL, BigQuery, Synapse SQL |
| ZetaSQL-DP Google (2023) | Engine Integration | No | External | BigQuery |
| DOP-SQL Yu et al. (2024) | Engine Integration | No | External | PostgreSQL |
| Chorus Johnson et al. (2020) | Query Rewriting | No | Integrated | PostgreSQL |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Type | Query | Description |
| Scalar | COUNT | The total number of tuples in the customer table. |
| COUNT_DISTINCT | The number of distinct nation keys in the customer table. | |
| SUM | The sum of account balances in the customer table. | |
| AVG | The mean account balance in the customer table. | |
| VAR | The variance of account balances in the customer table. | |
| STDDEV | The standard deviation of account balances in the customer table. |
Differential Privacy
Differential privacy limits how much an algorithm’s outputs can reveal about any one person’s data, with formal guarantees.
See all 263 papers