Canary deployment

카나리 배포

A new version receives a small share of traffic first, then more as its metrics are checked.

···
html
<div class="demo"><div class="head"><b>CANARY ROLLOUT</b><span id="phase">observe</span></div><div class="scene"><div class="label">TRAFFIC <strong>100%</strong></div><div class="bar"><div id="new" class="new"></div></div><div class="legend"><span>OLD <b id="oldPct">95%</b></span><span>NEW <b id="newPct">5%</b></span></div><div class="steps"><i id="s0"></i><i id="s1"></i><i id="s2"></i><i id="s3"></i></div></div><div class="foot"><span>measure → promote or roll back</span><span>tap to advance</span></div></div>
css
.demo{width:min(94vw,690px);height:min(86vh,310px);padding:clamp(10px,2.4vmin,20px);border:1px solid var(--line);border-radius:14px;background:var(--surface);display:flex;flex-direction:column;gap:clamp(7px,2vmin,14px);font:600 clamp(9px,2.5vmin,15px)/1.3 ui-monospace,monospace}.head,.foot{display:flex;justify-content:space-between;gap:8px}.head b{color:var(--accent)}.head span,.foot{color:var(--muted)}.foot{font-size:.82em}.scene{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;gap:clamp(8px,2vmin,17px)}.label,.legend{display:flex;justify-content:space-between}.label strong{color:var(--accent)}.bar{height:clamp(20px,7vmin,45px);border:1px solid var(--line);border-radius:8px;background:var(--accent-2);overflow:hidden}.new{height:100%;width:5%;background:var(--accent);margin-left:auto;transition:width .5s}.legend span:last-child{color:var(--accent)}.steps{display:flex;gap:5px}.steps i{height:clamp(3px,1vmin,6px);flex:1;background:var(--line);border-radius:9px}.steps i.on{background:var(--accent)}
js
const shares=[5,25,50,100];let step=0;function advance(){const share=shares[step];document.getElementById('new').style.width=share+'%';document.getElementById('oldPct').textContent=(100-share)+'%';document.getElementById('newPct').textContent=share+'%';document.getElementById('phase').textContent=share===100?'released':'observe · '+share+'%';for(let i=0;i<4;i++)document.getElementById('s'+i).classList.toggle('on',i<=step);step=(step+1)%4}advance();const timer=setInterval(advance,1050);document.querySelector('.demo').addEventListener('pointerdown',()=>{clearInterval(timer);advance()})

A canary deployment keeps the old version running while gradually increasing the share sent to a new one. At each step, operators inspect error rate and latency, and reduce the new share if it misbehaves.

The demo moves the new version through 5%, 25%, 50%, and 100% of traffic. Promotion criteria should use user-facing metrics and enough observation time for a meaningful comparison.

When to use

Use it when a release needs a small live trial and a quick path back to the old version.

Open as page ↗