---
title: "Schematizing Deletion at Scale"
description: "Shopify handles PII deletion in a warehouse ingesting tens of billions of events per day by requiring privacy-annotated schemas for every analytical event (4,500+ active schemas) and pseudonymising PII before it lands."
url: "https://swe.quest/articles/schematizing-deletion-at-scale-4a9164e6bb73ed7b"
canonical: "https://shopify.engineering/managing-pii-shopify-scale"
source: "Shopify Engineering"
published: "2021-06-10"
difficulty: "medium"
kind: "Case study"
reading_minutes: 16
tags: ["privacy","data-pipelines","messaging","analytics"]
---

# Schematizing Deletion at Scale

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2021-06-10, 16 min read, Case study. Original: [https://shopify.engineering/managing-pii-shopify-scale](https://shopify.engineering/managing-pii-shopify-scale)

## Summary

Shopify handles PII deletion in a warehouse ingesting tens of billions of events per day by requiring privacy-annotated schemas for every analytical event (4,500+ active schemas) and pseudonymising PII before it lands. A Scrubber on the Kafka pipeline applies irreversible obfuscation, such as masking IPs with geo enrichment or reducing user agents to device and OS families. For data that must stay recoverable, it applies tokenization: a vault issues consistent per-controller, per-subject tokens, so a deletion request only removes the token-to-PII mapping in the vault and never touches the petabyte-scale warehouse. Adoption came from making schematized events the default easy path, proving correctness through reconciliation and stress tests, and adding value like dataset discoverability.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Privacy](https://swe.quest/tags/privacy.md) (Security)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [Queues & messaging](https://swe.quest/tags/messaging.md) (Backend & APIs)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)

## Prerequisites

- Kafka basics ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))
- data warehouses
- PII and GDPR concepts ([easy posts on Privacy](https://swe.quest/tags/privacy.md?difficulty=easy))

## Keywords

Shopify, Kafka, tokenization, pseudonymisation, Scrubber, Tokenization Vault

## Related posts

- [Data logs: The latest evolution in Meta’s access tools](https://swe.quest/articles/data-logs-the-latest-evolution-in-meta-s-access-tools-614b48244a60ed88.md): Meta Engineering · 2025-02-04 · Medium · 11 min read · Data pipelines, Privacy, Analytics & OLAP, System design, Resilience
  Meta serves per-user data logs from its Hive data warehouse, which cannot handle per-user point queries, by batching many Download Your Information requests into one full-table scan.
- [How Meta understands data at scale](https://swe.quest/articles/how-meta-understands-data-at-scale-ab2f3889e09c8113.md): Meta Engineering · 2025-04-28 · Medium · 19 min read · Privacy, Data pipelines, Machine learning, System design
  Meta's Privacy Aware Infrastructure builds data understanding by schematizing every data asset in a canonical Thrift-based format (DataSchema, covering over 100 million schemas across 100+ systems) and annotating fields with a universal privacy taxonomy of semantic types.
- [Direct Data Sharing using Delta Sharing - Introduction: Our Journey to Empower Partners at Zalando](https://swe.quest/articles/direct-data-sharing-using-delta-sharing-introduction-our-journey-to-empower-5cd6ab3551b9f0de.md): Zalando Engineering · 2025-07-07 · Easy · 13 min read · Data pipelines, Analytics & OLAP, Identity & auth
  Zalando's Partner Tech team replaced a fragmented mix of SFTP, CSV downloads, APIs and S3 handoffs with Databricks-managed Delta Sharing, giving partners zero-copy access to more than 200 analytical datasets, some as large as 200TB.
- [De-identifying text at scale: How Airbnb protects personal data in AI training](https://swe.quest/articles/de-identifying-text-at-scale-how-airbnb-protects-personal-data-in-ai-training-8f0e89339f2f4724.md): Airbnb Engineering · 2026-11-17 · Medium · 13 min read · Privacy, Machine learning, ML platforms, Python
  Airbnb de-identifies messages, reviews and support chats before ML training using Presidio, an open-source PII framework, shipped as an in-process Python library and a shared pipeline step whose de-identified dataset tag gates model deployment.
- [Branching With or Without PII: The Future of Environments](https://swe.quest/articles/branching-with-or-without-pii-the-future-of-environments-9928f840495df503.md): Neon · 2025-11-11 · Easy · 12 min read · PostgreSQL, Privacy, Databases, CI/CD
  Neon branches can now be created with anonymized data: schema and data are copied from a parent such as production, then masked with the PostgreSQL Anonymizer extension using per-column rules (dummy emails, names, phone numbers, random values) while foreign keys and constraints stay intact.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
