A reconciliation-first approach to CDC into Redshift, and where GoldenGate and AWS DMS pipelines actually go wrong.
Cutover night. The row counts match to the last digit. Somebody posts a green checkmark in the channel and everyone goes to bed.
Three days later, finance asks why order totals for one region are off by a few thousand dollars. Nothing is down. Nothing alerted. The counts still match. That’s the problem.
The pattern is familiar to anyone who has moved a busy database onto a new platform. The pipeline gets built, the full load finishes, change data capture (CDC) hums along, and the team picks the one check that’s easy to run: count the rows. Counts catch missing data. They say nothing about data that arrived wrong, arrived twice, or never got its update.
This article is about the checks I’d automate before trusting either GoldenGate or AWS DMS to feed Redshift, and the lag arithmetic that tells you when the pipeline is falling behind.
The short version
- Treat row counts as a smoke test, never as the exit criterion for a cutover.
- Land every change as an append-only record, then apply the latest change per key. Don’t rely on Redshift to reject duplicates.
- Alert on the slope of lag, and put source-side bulk jobs on a calendar.
- Reconcile with bucketed checksums over the whole table, then drill into the buckets that disagree.
Every number below comes from one worked example with made-up data: an Oracle ORDERS table of 480 million rows being replicated into Redshift. It is illustrative, not from a real system, and I flag it each time.
1. Row counts are a smoke test
A matching count proves the pipeline didn’t lose or duplicate whole rows at one moment in time. It’s a useful first check, and I run it. But look at what it can’t see:
| What went wrong | Do row counts catch it? | Why |
|---|---|---|
| An update was lost or applied out of order | No | The row exists on both sides |
| A delete never reached the target | Yes, eventually | Counts drift, but only after enough deletes |
| A large text column was truncated in flight | No | Same keys, shorter values |
| An empty string became NULL (or the reverse) | No | Counts ignore content |
| Timestamps lost precision or shifted time zone | No | Same keys, different values |
| The same change was applied twice | Sometimes | Only if it was an insert |
Five of those six defects leave the count untouched or only occasionally move it. If your exit criterion is “counts match,” you’ve certified the easiest thing to get right.
2. Pick the tool by its failure mode
People compare GoldenGate and DMS on feature lists. I compare them on what happens when something goes wrong, because that’s where the weekends go. This is my rule of thumb, not a law. Check licensing and the current documentation for your versions before you decide.
| Oracle GoldenGate | AWS DMS | |
|---|---|---|
| Capture | Extract reads the redo, writes trail files | A task on a replication instance reads the source logs |
| If the target is slow | Trail files absorb the backlog (size the disk) | Source logs must stay available until the task catches up |
| Transformation | Rich mapping and filtering | Table mappings and basic rules |
| Operating model | You run and upgrade the processes | Managed service, fewer moving parts |
| Where I’d lean | High-volume Oracle estates, strict ordering, long-lived replication | Time-boxed migrations, small teams, AWS-native stacks |
Whichever you choose, the target side looks the same, and that’s where most of this article lives.
3. Five stages, three checks

The pipeline is easy to draw. The discipline is in giving each stage a check that can fail loudly:
- Buffer: lag slope. Is the backlog growing or shrinking? (Section 5.)
- Land: change counts. Does the number of changes landed per batch match what the source log says it emitted?
- Reconcile: checksums. Does the content agree, not just the count? (Section 6.)
4. Land the changes, then apply the latest per key
I land every change as an append-only record with its operation, commit position and sequence. Then I apply only the latest change per key. Two reasons. First, retries and replays are harmless, because applying the same batch twice gives the same result. Second, Redshift doesn’t enforce primary keys. They’re informational, used by the planner, so the target will happily store duplicates and won’t tell you.
Untested sketch, Redshift SQL (check syntax against your cluster version; newer clusters also support MERGE):
CREATE TABLE orders_changes ( batch_id BIGINT, op CHAR(1), commit_scn BIGINT, seq BIGINT, order_id BIGINT, status VARCHAR(20), amount_cents BIGINT, updated_at TIMESTAMP ); CREATE TEMP TABLE latest AS SELECT * FROM ( SELECT c.*, ROW_NUMBER() OVER ( PARTITION BY order_id ORDER BY commit_scn DESC, seq DESC) AS rn FROM orders_changes c WHERE batch_id = 1042 ) AS t WHERE rn = 1; BEGIN; DELETE FROM orders USING latest l WHERE orders.order_id = l.order_id; INSERT INTO orders SELECT order_id, status, amount_cents, updated_at FROM latest WHERE op <> 'D'; COMMIT; Deletes arrive as a change record, so the DELETE removes the old row and the INSERT skips it. Updates become delete-plus-insert, which suits a columnar store far better than row-by-row updates. In the worked example, 12 million changes a day split into 6.6 million inserts, 4.8 million updates and 0.6 million deletes (55%, 40% and 5%). Batching those is not optional.
5. Alert on the slope, not the level
Average lag is a comfortable lie. Here’s the arithmetic for the example. The table sees 12 million changes a day, about 139 a second on average and roughly 1,100 a second in the busiest hour (I assumed an 8x peak). Suppose the apply side can sustain 3,000 changes a second. That’s 2.7 times the peak. Healthy.
Now somebody runs a backfill that updates 40 million rows in an hour. That adds about 11,100 changes a second, for a total near 11,250 against capacity of 3,000. The surplus is 8,250 a second.

Using lag ≈ backlog ÷ apply rate as a rough estimate, a 5-minute target is breached after about 109 seconds, because the backlog passes 900,000 changes. By the end of the job the backlog is 29.7 million and lag peaks near 165 minutes. Draining it at the 2,861 a second of headroom takes another 173 minutes, so the pipeline is back to normal about 293 minutes after the job started.
A backfill that takes an hour at the source can cost you five hours of staleness downstream.
Two habits fix most of this. Alert when lag is rising for ten minutes, not when it crosses a line, so you hear about it early. And put source-side bulk jobs on a shared calendar, so the pipeline owner knows a surge is coming before the pager does. In DMS, watch the source and target latency metrics separately; they point to different bottlenecks (check the troubleshooting guide for your version).
6. Reconcile with checksums, not samples
The usual response to “counts aren’t enough” is to compare a random sample of rows. It feels rigorous. It isn’t, and the maths is short. If N is the table size, n the sample size and k the number of corrupted rows, the chance of catching at least one is about 1 − (1 − n/N)^k.

In the example, 480 million rows and 120 bad ones (0.000025% of the table). A 1-million-row sample finds at least one bad row 22% of the time. A 10-million-row sample finds one 92% of the time, and costs ten times as much. Checksums over the whole table find it every time, because every row is counted in some bucket.
So I bucket the keys, compute cheap aggregates per bucket on both sides, and diff the results. Here’s a query that runs unchanged on Oracle and Redshift (untested; adapt types to your schema):
SELECT MOD(order_id, 4096) AS bucket, COUNT(*) AS n, SUM(amount_cents) AS amt, SUM(CASE status WHEN 'NEW' THEN 1 WHEN 'PAID' THEN 2 WHEN 'SHIPPED' THEN 3 ELSE 0 END) AS st, MAX(updated_at) AS max_upd FROM orders WHERE updated_at <= :cutoff GROUP BY MOD(order_id, 4096); With 4,096 buckets, each holds about 117,000 rows. The 120 bad rows can touch at most 120 buckets, so the drill-down scans at most 14 million rows, 2.9% of the table. Two details matter more than the SQL:
- Same cut-off on both sides. Compare the source as of a commit point and the target after it has applied everything up to that point. Otherwise in-flight changes show up as false mismatches and the team learns to ignore the report.
- Portable aggregates. Hash functions differ between engines, so I compare counts, sums and maxima on normalised columns. For text columns, canonicalise first: trim, case, and above all the empty-string question (see the pitfalls).
7. A cutover runbook with gates

The template I’d steal: each step has an action and a gate, and the gate is a number somebody can check. “Three clean reconciliation nights in a row” beats “looks good.” The T+7 row matters too. Keep the reverse path warm for a week, because mismatches that survive three clean nights tend to be the slow ones: month-end jobs, rare code paths, the table nobody remembered.
8. Where I’d bet you’ll trip
- Empty string versus NULL. Oracle treats an empty string as NULL. Redshift doesn’t. Your counts match and your WHERE clauses disagree.
- Large objects. Check how your tool treats LOB columns. Some modes cap the size and truncate silently, which is exactly the defect counts can’t see.
- Retention. If the source purges its logs before the pipeline reads them, you’re back to a full reload. Set the retention for the worst outage you can imagine, not the average week.
- Schema changes mid-stream. A column added on the source on Thursday breaks something on Friday. Freeze DDL before cutover and test one change in rehearsal.
- Timestamps. Precision, time zones and daylight-saving boundaries. Compare them explicitly; they rarely fail loudly.
- No owner for reconciliation. A report nobody reads is the same as no report. Give it a name, a schedule and a threshold that pages someone.
The short version, again
Counts are a smoke test. Land changes append-only and apply the latest per key. Watch the slope of lag and know your bulk jobs. Reconcile with bucketed checksums at a shared cut-off, and give every cutover step a gate that is a number.


![Best Apple Black Friday deals: AirPods, MacBook, Apple Watch, AirTag 2, more [Updated]](https://9to5mac.com/wp-content/uploads/sites/6/2026/11/Best-Black-Friday-Apple-deals-2026.jpg?quality=82&strip=all&w=1600)

