# When Change Data Capture Can Break Application Encapsulation

DevFeed: [When Change Data Capture Can Break Application Encapsulation](<https://devfeed.tech/articles/change-data-capture-breaks-encapsulation-does-it-though-18808.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/change-data-capture-breaks-encapsulation-does-it-though/>)

Published: 2023-11-21T00:00:00Z

Content type: article

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>), [streaming-data-processing](<https://devfeed.tech/topics/streaming-data-processing.md>), [Kafka](<https://devfeed.tech/topics/kafka.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [apache-kafka](<https://devfeed.tech/tags/apache-kafka.md>), [data](<https://devfeed.tech/tags/data.md>), [debezium](<https://devfeed.tech/tags/debezium.md>), [schema](<https://devfeed.tech/tags/schema.md>), [stream-processing](<https://devfeed.tech/tags/stream-processing.md>), [streaming](<https://devfeed.tech/tags/streaming.md>)

## AI overview

This article examines whether exposing database change event feeds through Change Data Capture (CDC) breaks application encapsulation. It explains that CDC can expose internal table models as event APIs and create schema and downstream-consumer risks, then discusses ways to address those risks.

## Source excerpt

Table of Contents CDC--A Quick Primer Does CDC Break Encapsulation? Entering Data Contracts Implementation Approaches For Data Contracts The Outbox Pattern Stream Processing Streaming Data Contracts--Beyond the Basics Handling Schema Changes Summary This post originally appeared on the Decodable blog. All rights reserved. Having worked on Debezium--an open-source platform for Change Data Capture (CDC)--for several years, one concern I've heard repeatedly is this: aren't you breaking the encapsulation of your application when you expose change event feeds directly from your database? After all, CDC exposes your internal persistent data model to the outside world, which may have unintended consequences, e.g. in terms of data exposure but also when it comes to changes to the schema of your data, which may break downstream consumers.