Limited Time Offer:Up to 0% off Hello Interview Premium
Up to 0% off Hello Interview Premium 🎉
Hello Interview
Learn System Design
System Design Course
Introduction
How to Prepare
Delivery Framework
Core Concepts
Key Technologies
Common Patterns
Question Breakdowns
Networking Essentials
API Design
Data Modeling
Caching
Sharding
Consistent Hashing
CAP Theorem
Database Indexing
Numbers to Know
Bitly
Dropbox
Local Delivery Service
Ticketmaster
FB News Feed
Tinder
LeetCode
WhatsApp
Rate Limiter
YouTube
FB Live Comments
YouTube Top K
Uber
Web Crawler
Ad Click Aggregator
FB Post Search
Yelp
Instagram
Strava
Distributed Cache
Online Auction
Job Scheduler
News Aggregator
Price Tracking Service
Notification System
Robinhood
Google Docs
Payment System
Metrics Monitoring
Online Chess
ChatGPT
Real-time Updates
Dealing with Contention
Multi-step Processes
Scaling Reads
Scaling Writes
Handling Large Blobs
Managing Long Running Tasks
Redis
Elasticsearch
Kafka
API Gateway
Cassandra
DynamoDB
PostgreSQL
Flink
ZooKeeper
Proximity Search
Time Series Databases
Data Structures for Big Data
Vector Databases
Change Data Capture
All Posts
Shopify Inventory Reservations
Discord Message Storage
Slack Job Queue
Figma Multiplayer
Spotify Data Lake
Vote For New Content
Pricing
Sign in / Sign up
Search
⌘K
Pricing
Tutor
Get Premium
Advanced Topics

Change Data Capture

Learn how change data capture streams database writes to caches, search indexes, and downstream services without dual writes.

You’re in a system design interview and you need to keep two data stores in sync. Maybe your primary database needs to feed a search index. Or perhaps you’re moving data into a warehouse to run offline analytics.
The answer here is usually change data capture (CDC), which works by reading changes from the database’s replication log and propagating them to downstream services. Often, CDC is exactly the right tool. But candidates also tend to reach for it in situations where CDC isn’t the best fit and an alternative would serve them better.
CDC works best when consumers just need a copy of your data. But it can start to fall apart when they need to know why that data changed. In this article, we’ll build a simple test you can use in an interview to decide when CDC is the right choice, when it creates subtle correctness problems, and what to use instead.

What is CDC

Suppose your product catalog lives in Postgres, but you use Elasticsearch to power product search across your app. Postgres is the source of truth, but every time a product is created, updated, or deleted, you need that change reflected in Elasticsearch too.
One option is to have the application write to both systems so that when a product changes, the application updates Postgres and Elasticsearch at the same time. This seems simple enough, but if one write succeeds while the other fails, the two systems are now out of sync. You can retry the failed write, but now you need retry logic, idempotency, and some way to recover if the application crashes between the two operations.
Dual writing

How CDC works

When to use CDC

Keeping a derived index in sync

Replicating an OLTP database into a data warehouse

Zero-downtime database migration

When not to use CDC

Sending an email when an order ships

Invalidating a cache when a row changes

Running cleanup or background jobs after state changes

Conclusion

Purchase Premium to Keep Reading

Unlock this article and so much more with Hello Interview Premium

Buy Premium

Currently up to 20% off

Hello Interview Premium

System Design Guided Practice
Exclusive content
Recent interview questions
Learn More
Reading Progress

On This Page

What is CDC

How CDC works

When to use CDC

Keeping a derived index in sync

Replicating an OLTP database into a data warehouse

Zero-downtime database migration

When not to use CDC

Sending an email when an order ships

Invalidating a cache when a row changes

Running cleanup or background jobs after state changes

Conclusion

Questions
Meta SWE Interview QuestionsAmazon SWE Interview QuestionsGoogle SWE Interview QuestionsOpenAI SWE Interview QuestionsAnthropic SWE Interview QuestionsEngineering Manager (EM) Interview Questions
Learn
Learn System DesignLearn DSALearn BehavioralLearn ML System DesignLearn Low Level DesignGuided Practice
Links
FAQPricingGift PremiumHello Interview Premium
Legal
Terms and ConditionsPrivacy PolicySecurity
Contact
About UsProduct Support

7511 Greenwood Ave North Unit #4238 Seattle WA 98103

© 2026 Optick Labs Inc. All rights reserved.