Quick revision
The short answer
I would set a policy of data minimisation at capture: every connector declares the columns it captures, and personal columns are excluded, masked or hashed with a salt unless a documented need exists. Raw CDC topics stay inside the owning domain with access control by sensitivity, while other teams consume curated, minimised topics. Retention is shortened, erasure follows a lineage map of downstream copies, and the rollout goes by risk with a review gate for new connectors and continuous audits.
What to remember
In this answer, we set a policy of data minimisation at capture, using Debezium column lists, masking and salted hashing so personal data is never copied unless a documented need exists. Raw CDC topics stay in the owning domain while curated topics serve everyone else, topics are classified with access per class, retention is shortened and erasure follows tombstones and a lineage map. We rolled it out by risk with a review gate first, and kept it true with scanning, access reviews and an exception path.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would set a policy of data minimisation at capture: every connector declares the columns it captures, and personal columns are excluded, masked or hashed with a salt unless a documented need exists. Raw CDC topics stay inside the owning domain with access control by sensitivity, while other teams consume curated, minimised topics. Retention is shortened, erasure follows a lineage map of downstream copies, and the rollout goes by risk with a review gate for new connectors and continuous audits.
Why this question is asked
CDC is so convenient that it spreads personal data quietly: a connector captures whole tables because that is the default, 25 teams subscribe, and each copies the topics into its own store. Nobody decided to distribute dates of birth across the company; it just happened. Interviewers ask this leadership question to see whether we can fix the cause rather than chase copies, and whether we can roll out a policy across many teams without stopping the business. In this answer, we will set the minimisation rule at capture, separate raw and curated topics, handle retention and erasure, plan the rollout by risk, and keep it true with audits.
1Why the Problem Starts at Capture
Personal data in a topic is copied every time someone consumes it into another store: a search index, a data warehouse table, a cache, a team's own database. With 30-day retention and several downstream copies, a single email address can end up in five systems, each with different access rules and no deletion process. Removing it later means finding every copy. Removing it at capture means the copies are never made.
So the first principle of the policy is data minimisation: we capture only the columns someone has a documented need for. That matches privacy law's minimisation principle, and it is also cheaper, because smaller topics cost less to store and move.
2Minimising at Capture With Connector Settings
Debezium lets each connector control columns precisely. Columns are named by schema, table and column, and we can capture only some, drop some, mask them with asterisks, or replace them with a salted hash that still allows joins on the value without revealing it.
| Treatment | Consumers can | Use when |
|---|---|---|
Exclude (column.exclude.list) | nothing | no consumer needs it (the default) |
| Mask with asterisks | see it exists | a column must be present but not readable |
| Salted hash | join and count on it | linking records without identity |
| Capture as is | read the value | documented need, restricted topic |
The policy says that every connector must declare its columns with an include or exclude list, and that personal columns are excluded, masked or hashed unless an approved exception exists. A hash is useful when teams need to join or count by a person without seeing who it is; the salt is kept secret and rotated by policy. Note that a salted hash of an email is still personal data under most privacy laws, since it identifies a person consistently, so hashed columns still count as sensitive, just less exposed.
3Raw Topics Stay Home, Curated Topics Go Out
Even after minimisation, some raw CDC topics must keep personal data because the owning domain needs it. Those topics stay within the owning domain, with access granted only to its services. Other teams consume curated topics: minimised projections or proper domain events published by the owning team, with a contract. This also helps beyond privacy, because consumers stop depending on the owner's table layout.
We classify every topic by sensitivity, for example public, internal, confidential and restricted, record an owner, and grant access per class through ACLs managed as code. A restricted topic needs an approved request with a purpose and an expiry date.
- Operational databasefull rows, owned by the domain
- Debezium connectorcolumn lists, masking and hashing at capture
- Raw CDC topic (restricted)owning domain only, short retention
- Curated topic or domain eventsminimised fields, contract, wider access
- Downstream storesregistered in the lineage map
5 layers, from the top down. Step through them one at a time.
4Retention and Erasure
Thirty days is longer than most raw CDC topics need. Consumers keep up within minutes or hours, so we shorten retention on raw topics to what recovery actually requires, for example three days, which shrinks the window in which personal data sits in Kafka.
Compacted topics are different: they keep the latest record per key indefinitely. For those, erasure works through keys and tombstones. When a person is erased, the source row is deleted, Debezium emits a delete and a tombstone, and compaction eventually removes the key. That only works if the personal data is keyed by the entity and nowhere else, so the policy forbids personal fields in keys of other entities.
Kafka is often the easy part. The copies downstream are where erasure fails, so we keep a lineage map recording which store consumes which topic and holds which personal fields, and each store owner provides an erasure process that the privacy office can trigger and verify.
5Rolling It Out by Risk
Sixty databases and 25 teams cannot change at once, so the rollout follows risk.
- Inventory connectors, columns, consumersfrom schemas and consumer groups
- Add review gate for new connectorsstops new exposure immediately
- Fix highest-risk flows firstsensitive columns, widely read topics
- Consumers need the field?Yesexception with owner and expiryNoexclude, mask or hash
- Shorten raw retention, update lineage mapthen the next batch
5 steps in order. Play them, or step through them one at a time.
We start with an inventory of every connector, its tables and columns, and which consuming teams read which fields, which we can largely gather from schemas and consumer group data. The highest-risk flows, sensitive columns in widely read topics, are fixed first. A review gate is added immediately for new connectors and for schema changes that add personal columns, so the problem stops growing while we fix the backlog. Consuming teams that rely on a field get a migration window and help moving to curated topics, and teams with a real need use a documented exception path with an owner and an expiry, rather than quietly keeping access.
6Auditing Continuously
A policy decays unless someone checks it. We run a scanner that samples messages from topics and looks for personal data patterns such as email addresses, phone numbers and dates of birth in topics classified below confidential, and opens a ticket for each hit. Access to restricted topics is reviewed quarterly, results are reported to the privacy office, and exceptions are reviewed on expiry. These reports are also the evidence the next privacy review will ask for.
7Follow-up questions
Why hash rather than exclude the email?
Only when a consumer needs to link records about the same person without knowing who it is, for example counting distinct customers. If nobody needs that, excluding the column is better, because a hash is still personal data and still needs protection.
How do you handle a team that says it needs dates of birth?
Through the exception path: they state the purpose, for example age verification, the minimum form that serves it (often an over-18 flag rather than the date), and accept a restricted topic, an owner and an expiry date for the exception.
Does shortening retention break replay?
It limits how far back consumers can replay from Kafka. For raw CDC we accept that, because a lost consumer can be rebuilt with an incremental snapshot from the source database instead of a 30-day replay.
8Conclusion
In this answer, we set a policy of data minimisation at capture, using Debezium column lists, masking and salted hashing so personal data is never copied unless a documented need exists. Raw CDC topics stay in the owning domain while curated topics serve everyone else, topics are classified with access per class, retention is shortened and erasure follows tombstones and a lineage map. We rolled it out by risk with a review gate first, and kept it true with scanning, access reviews and an exception path.
Open with
I would set a policy of data minimisation at capture, because every copy downstream starts at the connector. Each connector must declare the columns it captures with column.include.list or column.exclude.list, and personal columns are excluded by default, masked with column.mask.with.n.chars, or hashed with a salt using column.mask.hash with the algorithm and salt, when a team needs to join on them, unless there is a documented need.
Then, if they want more
Then I would classify topics by sensitivity with named owners and access control per class. Raw CDC topics stay inside the owning domain, and other teams consume curated, minimised topics or proper domain events.
For retention and erasure, I would shorten retention on raw CDC topics, rely on keys and tombstones for compacted topics, and maintain a lineage map of downstream copies so erasure reaches every store.
The rollout goes by risk: inventory connectors and columns, add a review gate for new connectors and schema changes that add personal columns right away, fix the highest-risk flows first, and give consuming teams a migration window and support.
Finally, I would audit continuously: scan topic samples for personal data patterns, review access quarterly, report to the privacy office, and keep a documented exception path with owners and expiry dates for teams with real needs.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Apache Kafka documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "A privacy review finds that personal data such as emails, addresses and dates of birth...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-streams-connect/df1a2b730a/