Qrlew framework
The SQL-to-SQL Differential Privacy layer
What is Qrlew?
Qrlew /ˈkɝlu/ is the open source library that rewrites SQL queries into privacy-preserving variants using Differential Privacy (DP).
Use Qrlew if you want to bring privacy guarantees to your SQL pipelines. It is:
SQL-to-SQL
Qrlew turns SQL queries into differentially-private SQL queries that can be executed at scale on many SQL datastore, in many SQL dialects.
Feature-rich
Qrlew covers the broadest range of SQL queries, including JOIN
, Common Table Expressions (WITH
) and nested SELECT
.
Privacy-optimized
Qrlew automatically optimizes the most important DP parameters to maximize utility.
It keeps track of value bounds and ranges throughout each computation step, minimizing the amount of noise needed to achieve differential privacy.
Meet us at PPAI-24: The 5th AAAI Workshop on Privacy-Preserving Artificial Intelligence, Monday, February 26, 2024. Read the paper we will present. And give us your feedback.
How does Qrlew work?
The Qrlew library, solves the problem of running a SQL query with DP guarantees in three steps:
1. The SQL query submitted by an analyst is parsed and converted into an intermediate representation called Relation.
2. The Relation is rewritten into a DP variant.
3. The DP variant of the Relation can be rendered as an SQL query string in any dialect.
At the end of this process, the query string can submitted to the data store of the data owner. The output can be shared with the data practitioner or published without worrying about privacy leakage.
Deep-dive into Qrlew
To learn more about qrlew read the deep-dive section of the documentation, or read Qrlew white paper.
Why a Whitepaper?
Differential Privacy is hard to implement right. It is a problem for a piece of software one rely on for data protection
To foster trust, Sarus relies on a two-pronged strategy:
- Open-source core
- Peer reviewed methodology
Qrlew — Sarus SQL core — is open-source so that anyone, and experts in particular, can check its implementation.
Qrlew has been reviewed by the Differential Privacy community and presented in a AAAI-24 workshop: PPAI-24
What does the Whitepaper tell us?
The paper introduces Qrlew, an open source library that can parse SQL queries into Relations — an intermediate representation — that keeps track of rich data types, value ranges, and row ownership; so that they can easily be rewritten into differentially-private equivalent and turned back into SQL queries for execution in a variety of standard data stores.
With Qrlew, a data practitioner can express their data queries in standard SQL; the data owner can run the rewritten query without any technical integration and with strong privacy guarantees on the output; and the query rewriting can be operated by a privacy-expert who must be trusted by the owner, but may belong to a separate organization.
Play with Qrlew online
Qrlew Relation Viewer
To rewrite SQL into Differentially Private SQL, Qrlew parses input queries and represent them in a abstract representation we call Relations.
Relations are compositions of simple building blocks that simplify the rewriting process.
To understand, how some SQL is parsed into a Relation, and debug some cases, you can play with the interactive Relation Viewer.
Qrlew Playground
To see how SQL queries are parsed into Relations, which are rewritten into Differentially Private equivalent, and then rendered into safe SQL queries, you can have a look at the interactive Qrlew Playground.