---
title: "Automating data removal"
description: "Meta's SCARF framework includes a subsystem that finds and deletes unused classes of data, such as tables, storage use cases and TAO object types, across 21 data systems."
url: "https://swe.quest/articles/automating-data-removal-d163bb8b8352c57e"
canonical: "https://engineering.fb.com/2023/10/31/data-infrastructure/automating-data-removal/"
source: "Meta Engineering"
published: "2023-10-31"
difficulty: "medium"
kind: "Case study"
reading_minutes: 9
tags: ["privacy","databases","static-analysis","refactoring"]
---

# Automating data removal

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2023-10-31, 9 min read, Case study. Original: [https://engineering.fb.com/2023/10/31/data-infrastructure/automating-data-removal/](https://engineering.fb.com/2023/10/31/data-infrastructure/automating-data-removal/)

## Summary

Meta's SCARF framework includes a subsystem that finds and deletes unused classes of data, such as tables, storage use cases and TAO object types, across 21 data systems. It combines static code references from Glean with runtime read counters instrumented into production data systems. When a type has no references and no traffic, SCARF files a ticket, blocks reads and writes as a dry run, and then deletes the data, with backups as a last safeguard. It models cross-system asset dependencies so deletions happen in the right order, and it will not break code references, relying on its dead-code subsystem to prune those first; in a year it removed petabytes across 12.8M data types.

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)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [Static analysis](https://swe.quest/tags/static-analysis.md) (Engineering practices)
- [Refactoring & migrations](https://swe.quest/tags/refactoring.md) (Engineering practices)

## Prerequisites

- static analysis basics ([easy posts on Static analysis](https://swe.quest/tags/static-analysis.md?difficulty=easy))
- database tables and schemas ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

SCARF, Glean, TAO, DELF, Meta

## Related posts

- [Automating product deprecation](https://swe.quest/articles/automating-product-deprecation-9c964f5b3db1d6d5.md): Meta Engineering · 2023-10-17 · Medium · 10 min read · Refactoring & migrations, Developer productivity, Static analysis, Developer tools
  SCARF (Systematic Code and Asset Removal Framework) is Meta's tooling for deprecating products by removing dead code and unused data, credited with deleting over 100M lines of code in five years and petabytes of data across 12.8M data types in 21 systems in one year.
- [Automating dead code cleanup](https://swe.quest/articles/automating-dead-code-cleanup-e03bc4ba07b5bf1c.md): Meta Engineering · 2023-10-24 · Medium · 7 min read · Static analysis, Refactoring & migrations, Developer productivity, Python
  Meta's SCARF framework finds dead code by building a cross-language, symbol-level dependency graph from Glean and augmenting it with runtime usage data such as API endpoint logs, URI dispatch tables and async job invocations, then garbage-collects unreachable nodes, subgraphs and cycles.
- [Migrating Data Ingestion Systems at Meta Scale](https://swe.quest/articles/migrating-data-ingestion-systems-at-meta-scale-338df596ae05796f.md): Meta Engineering · 2026-05-12 · Medium · 9 min read · Data pipelines, Event-driven architecture, MySQL, Refactoring & migrations, Deployment
  Meta migrated tens of thousands of MySQL-to-warehouse change data capture (CDC) ingestion jobs, together moving several petabytes daily, from customer-owned pipelines to a self-managed warehouse service, and fully retired the legacy system.
- [Protecting user data through source code analysis at scale](https://swe.quest/articles/protecting-user-data-through-source-code-analysis-at-scale-357585a0d96f83c8.md): Meta Engineering · 2025-02-18 · Medium · 4 min read · Static analysis, Threat detection, Application security, Python
  Meta's Anti-Scraping team encodes known scraping attack vectors as taint-analysis rules in its in-house static analyzers, Zoncolan for Hack and Pysa for Python, so potential vectors are flagged before code ships.
- [Schematizing Deletion at Scale](https://swe.quest/articles/schematizing-deletion-at-scale-4a9164e6bb73ed7b.md): Shopify Engineering · 2021-06-10 · Medium · 16 min read · Privacy, Data pipelines, Queues & messaging, Analytics & OLAP
  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.

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)
