Towards Practical Differential Privacy for SQL Queries

Noah M. Johnson, Joseph P. Near, Dawn SongPVLDB 2018 · DOI

TL;DR

This paper introduces "elastic sensitivity," a novel method for approximating local sensitivity in SQL queries, enabling practical differential privacy for complex queries involving joins. Their system, FLEX, demonstrates negligible performance overhead and good utility on real-world query workloads, making differential privacy more accessible for enterprise analytics.

What Problem Does This Paper Address?

Organizations are increasingly collecting vast amounts of sensitive data, necessitating strong privacy guarantees. While differential privacy offers a robust framework for protecting individual privacy while enabling data analysis, existing mechanisms struggle with the complexity and variety of real-world SQL queries, especially those involving joins. Many prior approaches either don't support joins, require modifications to database engines, or are evaluated on limited, non-representative query sets. This leaves a significant gap in applying differential privacy to common enterprise data analytics scenarios.

Methods

The core innovation is elastic sensitivity, a method to approximate the local sensitivity of SQL queries, particularly those with general equijoins. Unlike previous approaches that relied on global sensitivity (which can be unbounded for joins) or computationally infeasible local sensitivity calculations, elastic sensitivity leverages precomputed database metrics (like maximum frequency of join keys) to derive a conservative upper bound on local sensitivity. This allows it to be compatible with standard SQL and existing database systems.

The authors built FLEX, an end-to-end system that uses elastic sensitivity. FLEX works by:

  1. Analyzing the SQL query: It parses the query and uses an abstract interpretation-based dataflow analysis to understand its structure.
  2. Calculating Elastic Sensitivity: It recursively computes the elastic sensitivity based on the query's relational algebra operations and precomputed database metrics.
  3. Applying Smooth Sensitivity: Elastic sensitivity is then smoothed using established techniques to ensure it's a valid input for privacy mechanisms.
  4. Adding Noise: Finally, Laplace noise is added to the query results based on the smoothed sensitivity and the privacy budget (ε, δ).

An optimization for public tables is also introduced, which prevents adding noise to data that is not considered sensitive, improving utility.

Datasets

The primary dataset used is a collection of 8.1 million real-world SQL queries executed at Uber between March 2013 and August 2016. This dataset is described as diverse, covering sensitive data like rider and driver information, trip logs, and customer support data.

For experimental evaluation, a subset of 9862 real queries from this dataset was used. Additionally, the authors evaluated their system on the TPC-H benchmark dataset, a standard for evaluating database performance, to assess utility on a different, albeit synthetic, workload.

Key Insights and Ideas

  • Real-world SQL is complex: The empirical study of 8.1 million queries revealed that equijoins are extremely common (62.1%), and many queries involve multiple joins, self-joins, and various join relationships. This highlights the inadequacy of prior DP mechanisms that don't robustly support joins.
  • Local sensitivity is key, but hard: While local sensitivity offers better utility than global sensitivity for joins, directly computing it is computationally prohibitive. Elastic sensitivity provides a practical, albeit approximate, way to leverage local sensitivity.
  • Joins are the main challenge: The paper emphasizes that handling joins is the primary hurdle for practical differential privacy in SQL. Elastic sensitivity's recursive definition is designed to tackle this by modeling the impact of each join operation.
  • Public tables offer a utility boost: Identifying and excluding sensitive data from privacy protection (e.g., public city data) significantly improves the utility of the results without compromising privacy.
  • High error for inherently sensitive queries: The study found that queries targeting individuals or very small subsets of data inherently require high error (low utility) to maintain privacy, a fundamental trade-off of differential privacy.

Key Results

  • Performance: FLEX incurs a negligible performance overhead of 0.03% on average, with query analysis taking milliseconds compared to seconds for original query execution.
  • Success Rate: FLEX successfully computes elastic sensitivity for 76% of the real-world queries in their experimental dataset. The main reasons for failure were unsupported query features (14.14%) and parsing errors.
  • Utility:
    • For queries with no joins, FLEX achieves high utility (less than 10% error) for a majority of queries, especially those with larger population sizes.
  • For queries with joins, FLEX shows similar utility trends, demonstrating its effectiveness in handling join complexity.
  • The public table optimization significantly improves utility, increasing the percentage of queries with high utility (error < 1.0%) from 28.5% to 49.8%.
  • When compared to wPINQ (another mechanism supporting joins), FLEX generally provided lower median error for representative join queries, often by a significant margin.
  • Privacy Budget Impact: Larger privacy budgets (higher ε) lead to lower median error, as expected.

Limitations and Future Work

  • Unsupported Queries: Elastic sensitivity does not support non-equijoins (e.g., A.x > B.y) or queries that use computed values from subqueries as join keys. Extending support for these would require database interactions or more complex metrics.
  • Aggregation Functions: The paper primarily focuses on counting queries and discusses extensions for sum and average, but notes that max/min functions are inherently sensitive and provide poor utility.
  • Database Constraints: The paper acknowledges that database constraints (like primary keys) can leak information and are not explicitly handled by elastic sensitivity, suggesting this as a future research direction.
  • Public Table Identification: The identification of public tables is domain-specific and requires manual configuration, though triggers could automate recomputation.
  • Future Work: The authors suggest extending support for other aggregation functions, handling non-equijoins, and accounting for database constraints. They also highlight the potential for integrating elastic sensitivity with existing budget-efficient approaches.

Summary updated

BibTeX
@article{johnson2018towards,
  author = {Noah M. Johnson and Joseph P. Near and Dawn Song},
  title = {{Towards Practical Differential Privacy for SQL Queries}},
  journal = {Proc. VLDB Endow.},
  year = {2018},
  doi = {10.1145/3187009.3177733},
}
Figure