How would you identify recent transactions, and how can Change Data Capture (CDC) detect them?
💡 Model Answer
To identify recent transactions, you can query a timestamp or monotonically increasing column (e.g., transaction_id or created_at) and filter rows where the value is greater than the last sync time. For CDC, configure a CDC tool (Debezium, AWS DMS, or native logical decoding) to read the database’s transaction log (WAL for PostgreSQL, binlog for MySQL). The CDC engine streams only the changes (INSERT, UPDATE, DELETE) to a downstream system such as Kafka or S3. By maintaining a checkpoint of the last processed LSN or offset, you can resume from that point and avoid reprocessing. The overall complexity is O(n) for scanning new rows, while CDC provides near‑real‑time change capture with minimal overhead. Example: In PostgreSQL, enable logical decoding, stream changes to Kafka, and consume them in downstream services for analytics or replication.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.
Get Assisting AI — Starts at ₹500