Change data capture

변경 데이터 캡처

Changes in a database log become events delivered to other systems.

···
html
<div class="demo"><div class="head"><b>CHANGE DATA CAPTURE</b><span>UPDATE #51</span></div><div class="stage pipeline"><div class="cell">row</div><i>→</i><div class="cell">log</div><i>→</i><div class="cell">event</div><i>→</i><div class="cell">index</div></div><div class="foot"><span id="cdcstatus">row changed</span><span>downstream sync</span></div></div>
css
*{box-sizing:border-box}.demo{width:min(96vw,820px);height:min(94vh,350px);padding:clamp(8px,2vmin,18px);border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--fg);display:flex;flex-direction:column;gap:clamp(5px,1.5vmin,12px);font:600 clamp(12px,3.5vmin,15px)/1.25 var(--font-sans),sans-serif;overflow:hidden}.head,.foot,.row{display:flex;justify-content:space-between;align-items:center;gap:8px}.head b{color:var(--accent)}.head span,.foot,.muted{color:var(--muted)}.stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;gap:8px}.cell,.pill{border:1px solid var(--line);border-radius:8px;background:var(--bg);padding:clamp(4px,1.2vmin,9px);text-align:center}.pill{border-radius:999px}.on{border-color:var(--accent)!important;background:color-mix(in srgb,var(--accent) 17%,var(--surface))!important;color:var(--fg)!important}.bad{border-color:#e16a5d!important;background:color-mix(in srgb,#e16a5d 18%,var(--surface))!important}.foot{font-size:clamp(12px,3vmin,14px)}.pipeline{justify-content:space-around;gap:3px}.pipeline .cell{min-width:18%;padding:clamp(3px,1vmin,8px)}.pipeline i{font-style:normal;color:var(--accent)}
js
let n=0;const labels=['row changed','log captured','event delivered','index refreshed'];function tick(){document.querySelectorAll('.pipeline .cell').forEach((e,i)=>e.classList.toggle('on',i<=n));document.getElementById('cdcstatus').textContent=labels[n];n=(n+1)%4}tick();const t=setInterval(tick,700);document.querySelector('.demo').onclick=()=>{clearInterval(t);tick()}

CDC reads inserts, updates, and deletes from a change log or similar source instead of repeatedly polling tables. It can feed a search index, analytics store, or cache.

The demo sends an updated row through the log and event stream into a search index. Consumers should handle duplicate delivery and possible ordering issues.

When to use

Use it when another store needs a near-real-time copy of source database changes.

Open as page ↗