Abstract
Differential privacy (DP) is fast becoming the gold standard in enabling statistical analysis of data while protecting the privacy of individuals. However, practical use of differential privacy still lags behind research progress because research prototypes cannot satisfy the scalability requirements of production deployments. To address this challenge, we present Chorus, a framework for building scalable differential privacy mechanisms which is based on cooperation between the mechanism itself and a high-performance production database management system (DBMS). We demonstrate the use of Chorus to build the first highly scalable implementations of complex mechanisms like Weighted PINQ, MWEM, and the matrix mechanism. We report on our experience deploying Chorus at Uber, and evaluate its scalability on real-world queries.
Introduction
While differential privacy (DP) provides a rigorous mathematical framework for data protection, its industrial adoption has been hindered by a fundamental architectural trade-off. Historically, organizations have had to choose between two suboptimal approaches for deploying DP. The "Post-Processing" approach adds noise to the final results of standard SQL queries; while highly scalable, it cannot support advanced DP mechanisms that require data transformation (such as outlier clipping) prior to aggregation. Conversely, the "Deep Integration" approach involves building custom database engines designed specifically for DP. While these custom engines support complex mechanisms, they lack the performance, reliability, and feature sets of mature, production-grade database management systems (DBMS).
Chorus bridges this gap by introducing a "cooperative architecture." It allows organizations to run sophisticated DP mechanisms on massive datasets by leveraging the optimization power of existing SQL databases. By rewriting queries to embed privacy-preserving operations, Chorus pushes the heavy lifting of data processing to the DBMS while maintaining strict privacy guarantees.
System Architecture
Chorus operates as a smart intermediary between the data analyst and an unmodified SQL DBMS. The framework follows a three-stage pipeline to ensure both privacy and performance:
- Query Rewriting: Utilizing the Apache Calcite framework, Chorus parses incoming SQL queries and transforms them. It embeds privacy-preserving logic—such as clipping data bounds using
MAXandMINfunctions or creating data subsamples viaGROUP BYclauses—directly into the SQL syntax. - Sensitivity Analysis: Before execution, Chorus employs an abstract interpretation framework to analyze the rewritten query. This step calculates the "sensitivity" of the query—the maximum influence a single record can have on the output—without accessing the actual underlying data.
- Post-processing: The rewritten query is executed on the production DBMS. Chorus receives the raw result and applies the necessary statistical noise (e.g., Laplace or Gaussian noise) based on the calculated sensitivity before returning the final, private answer to the user.
This modular design allows developers to implement DP mechanisms as Scala functions, making it possible to compose simple primitives into complex, iterative algorithms like the Matrix Mechanism or MWEM.
Experimental Evaluation
To evaluate the efficacy and scalability of Chorus, the framework was tested against real-world workloads at Uber. The evaluation utilized a production data sample containing 300 million records across tables for trips, riders, and drivers. The test suite consisted of a corpus of 18,774 actual queries written by Uber analysts for tasks ranging from fraud detection to business intelligence.
Performance and Scalability
Chorus demonstrated the ability to handle industrial-scale workloads, processing over 10,000 queries per day in a production environment to assist with GDPR compliance. Performance overhead remained low for standard sensitivity-based mechanisms (Elastic and Restricted Sensitivity). The majority of queries experienced less than 50% overhead, with a mean overhead below 25%. Most performance impacts were only significant for queries that originally executed in under 100ms.
Accuracy and Utility
The framework maintained high data utility for large-scale analysis. For queries involving sample sizes greater than 10,000 records, the median relative error introduced by DP noise was less than 1%. However, the evaluation also highlighted the "Join Penalty": queries involving complex SQL joins were significantly more difficult to answer accurately under DP constraints compared to single-table queries, representing a continuing challenge for the field.
Discussion and Limitations
The deployment of Chorus at Uber confirmed that pushing privacy operations into the database layer is a viable path for large-scale DP. However, the system's security model relies on the "Trust in the Stack" assumption. Because Chorus assumes the DBMS executes queries according to standard semantics, any discrepancy between the DBMS execution and Chorus’s abstract interpreter could potentially compromise privacy guarantees. Additionally, Chorus is currently limited to SQL; it cannot analyze or support User-Defined Functions (UDFs) or stored procedures written in other languages.
Conclusion
Chorus demonstrates that cutting-edge differential privacy does not require abandoning existing high-performance infrastructure. By treating the DBMS as a cooperative partner in the privacy-preserving process, Chorus enables the deployment of complex DP mechanisms at a scale previously thought unattainable. Future work will focus on integrating formal verification to mathematically prove the correctness of rewriting rules, further hardening the framework against potential privacy leaks.
Summary updated