~/talk

Zero-Migration Encryption: Building Drop-in Encrypted Field in Django

Talkat DjangoCon Europe 2026 · 2026-04-15..04-19· [django, security]
links:none on file
links:none on file
slides:none on file

Sentry builds EncryptedFields, a custom Field base class that replaces CharField, JSONField and TextField as a drop-in, no database migration solution, handling both old plain-text and new encrypted values in a hybrid state by encrypting in get_prep_value and decrypting in from_db_value. Values carry a magic prefix plus a key ID so key rotation uses the right key; keys are mounted as files. Backfill runs as a separate job for billions of rows, runtime cost is <1 ms, tens of encrypts/sec and hundreds of decrypts/sec, and filtering on encrypted columns is intentionally unsupported.

AI-written summary · about

  1. 0:00Introduction to zero-migration encryption
  2. 1:09Encryption challenge at Sentry
  3. 3:19Requirements for encryption solution
  4. 4:51Zero-downtime migration constraints
  5. 7:19Traditional migration approach
  6. 9:05Django field abstraction for encryption
  7. 10:09No-migration encryption concept
  8. 11:13Handling encrypted and plaintext data
  9. 12:16Key rotation and multi-key support
  10. 14:03Encryption for JSON fields
  11. 15:07Implementation and performance
  12. 16:53Q&A session
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.