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.

Loading PDF…

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.

Qrlew project is licensed under the Apache License, Version 2.0 (the "License"); you may not use it except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2023
Sarus Logo
Sarus Technologies