{
  "id": 4770626,
  "title": "CDC with Sling: When Log-Based Works and When Query-Based Is Enough",
  "url": "https://urgent.news/2026/09/01/cdc-with-sling-when-log-based-works-and-when-query-based-is-enough",
  "topic": "health",
  "section": "Health & Medicine",
  "published": "2026-09-01T02:36:40.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/flarco/cdc-with-sling-when-log-based-works-and-when-query-based-is-enough-3oae"
  },
  "original_language": "en",
  "account": "Every team replicating an operational database to a data warehouse encounters the dilemma of incremental replication versus change data capture (CDC). Incremental replication runs on a schedule, while CDC reads the database transaction log to capture every change. Sling provides both options, allowing teams to choose based on their specific needs.\n\nThe difference lies in how each mode identifies changes. Incremental replication asks the source for rows with a specific update key greater than the last checkpoint. It pulls only the newer rows, which is simple and doesn't require special database privileges. However, it has a limitation: deleted rows at the source are not included in the result set, so they are not replicated to the target.\n\nCDC, on the other hand, doesn't query the table at all after the initial load. Instead, it reads the transaction log, which keeps a record of every change made to the database. This includes inserts, updates, and deletes. While this method requires more setup and higher privileges, it ensures that all changes, including deletes, are captured and applied to the target.\n\nTo illustrate the difference, a MySQL table named \"orders\" with 50,000 rows was created. The incremental replication performed a full load and then processed new orders, status changes, and deleted orders. The final count in the target showed 52,000 rows, including the five deleted orders, demonstrating the gap in incremental replication.\n\nIn contrast, query-based incremental CDC was able to accurately replicate all changes, including the deletes, as they were present in the transaction log. This guide demonstrates the need for CDC when dealing with databases where deletions are frequent and must be consistently mirrored in the data warehouse.",
  "summary": "Introduction Every team syncing an operational database to a warehouse eventually hits the same fork in the road. You have a mode: incremental replication that runs on a schedule, it works, and then a report comes back wrong. A row that a customer cancelled is still in the warehouse. Nobody deleted it there; it was deleted in the source, and the sync never noticed. That is not a bug. It is the…",
  "key_points": [
    "Incremental replication loads data on a schedule, simpler with no special privileges.",
    "CDC reads transaction log for every change, including deletes, after initial load.",
    "Query-based CDC accurately replicates all changes, including deletes, from transaction log."
  ],
  "editors_take": "Teams handling frequent deletions in their databases now have a clearer case for using change data capture over incremental replication to ensure accurate mirroring in their data warehouses.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}