Scalability & High Availability
Cloud computing's real power comes down to two things: handling growth and staying online no matter what.
π Scalability: Handling More Load
Scalability is a system's ability to handle increasing demand. There are two ways to achieve it.
<div class="infographic-vertical-scaling">
<style>
.infographic-vertical-scaling {
--ink: #1a1a1a;
--ink-soft: #5c5c5c;
--paper: #ffffff;
--paper-alt: #f0ece4;
--accent: #2563eb;
--accent-soft:#e3ebfd;
--line: #ddd6c9;
--error: #c0392b;
--error-soft: #fbe9e7;
--display-font: 'Georgia', 'Iowan Old Style', serif;
--mono-font: 'SF Mono', 'Menlo', monospace;
background: var(--paper);
color: var(--ink);
border: 1px solid var(--line);
border-radius: 4px;
padding: clamp(1.25rem, 4vw, 2.5rem);
max-width: 640px;
margin: 1.5rem auto;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
box-sizing: border-box;
}
.infographic-vertical-scaling[data-theme="dark"] {
--ink: #e8e6e1;
--ink-soft: #9a968c;
--paper: #121212;
--paper-alt: #1e1e26;
--accent: #5b8def;
--accent-soft:#202942;
--line: #2c313d;
--error: #e57373;
--error-soft: #3a2222;
}
.infographic-vertical-scaling * { box-sizing: border-box; }
.ig-header { text-align: center; margin-bottom: 1.5rem; }
.ig-eyebrow {
font-family: var(--mono-font); font-size: 0.72rem; letter-spacing: 0.12em;
text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 0.4rem;
}
.ig-title {
font-family: var(--display-font); font-size: clamp(1.4rem, 4vw, 1.8rem);
margin: 0; color: var(--ink);
}
/* ---- Stage ---- */
.stage {
position: relative;
height: 300px;
background: var(--paper-alt);
border: 1px solid var(--line);
border-radius: 4px;
overflow: hidden;
display: flex;
align-items: flex-end;
justify-content: center;
margin-bottom: 1.25rem;
}
.ceiling {
position: absolute; top: 0; left: 0; right: 0; height: 6px;
background: repeating-linear-gradient(45deg, var(--error) 0 6px, transparent 6px 12px);
opacity: 0.15; transition: opacity 0.3s ease;
}
.ceiling.is-active { opacity: 1; }
.ceiling-label {
position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
font-size: 0.72rem; font-family: var(--mono-font); color: var(--error);
background: var(--error-soft); padding: 0.2rem 0.6rem; border-radius: 3px;
opacity: 0; transition: opacity 0.3s ease; white-space: nowrap;
}
.ceiling-label.is-active { opacity: 1; }
.calls-layer {
position: absolute; top: 30px; left: 0; right: 0; height: 90px;
display: flex; align-items: center; justify-content: center;
flex-wrap: wrap; gap: 0.4rem; padding: 0 1rem;
pointer-events: none;
}
.call-icon {
font-size: 1.15rem; opacity: 0; transform: translateY(-6px) scale(0.5);
transition: opacity 0.25s ease, transform 0.25s ease;
}
.call-icon.is-in { opacity: 1; transform: translateY(0) scale(1); }
.figure-wrap {
position: relative;
display: flex; flex-direction: column; align-items: center;
transform: scale(var(--scale, 0.7));
transform-origin: bottom center;
transition: transform 0.25s ease;
margin-bottom: 18px;
}
.figure-wrap.hit-ceiling { animation: bump 0.35s ease; }
@keyframes bump {
0%, 100% { transform: scale(var(--scale, 1.8)) translateY(0); }
30% { transform: scale(var(--scale, 1.8)) translateY(3px); }
60% { transform: scale(var(--scale, 1.8)) translateY(-2px); }
}
.headset {
width: 34px; height: 18px; border: 4px solid var(--accent);
border-bottom: none; border-radius: 20px 20px 0 0; margin-bottom: -4px;
}
.head {
width: 30px; height: 30px; border-radius: 50%;
background: var(--accent); z-index: 1;
}
.body {
width: 54px; height: 40px; border-radius: 10px 10px 0 0;
background: var(--accent); margin-top: -2px;
}
.desk {
width: 90px; height: 12px; background: var(--ink-soft);
opacity: 0.35; border-radius: 2px; margin-top: 4px;
}
.gauge {
position: absolute; right: 14px; top: 14px; bottom: 14px; width: 10px;
background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
overflow: hidden;
}
.gauge-fill {
position: absolute; bottom: 0; left: 0; right: 0;
background: var(--accent); height: 0%;
transition: height 0.2s ease, background 0.2s ease;
}
.gauge-fill.is-maxed { background: var(--error); }
/* ---- Controls ---- */
.controls { text-align: center; }
.scale-slider {
width: 100%; accent-color: var(--accent); margin-bottom: 0.9rem; cursor: pointer;
}
.tier-readout {
display: flex; align-items: baseline; justify-content: center; gap: 0.5rem;
flex-wrap: wrap; margin-bottom: 0.3rem;
}
.tier-name {
font-family: var(--mono-font); font-size: 1.15rem; color: var(--accent); font-weight: 600;
}
.tier-specs { font-size: 0.82rem; color: var(--ink-soft); }
.tier-role {
font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 0.9rem;
}
.calls-readout {
font-size: 0.78rem; color: var(--ink-soft);
}
.calls-readout strong { color: var(--ink); font-family: var(--mono-font); }
.limit-note {
margin-top: 0.6rem; font-size: 0.78rem; color: var(--error);
opacity: 0; transition: opacity 0.3s ease; min-height: 1.1em;
}
.limit-note.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
.infographic-vertical-scaling *, .infographic-vertical-scaling *::before, .infographic-vertical-scaling *::after {
animation-duration: 0.001ms !important; transition-duration: 0.001ms !important;
}
}
</style>
<div class="ig-header">
<span class="ig-eyebrow">βοΈ Vertical Scaling</span>
<h3 class="ig-title">Same instance, more power</h3>
</div>
<div class="stage">
<div class="ceiling" id="ceiling"></div>
<div class="ceiling-label" id="ceilingLabel">β Hardware limit</div>
<div class="calls-layer" id="callsLayer"></div>
<div class="figure-wrap" id="figureWrap">
<div class="headset"></div>
<div class="head"></div>
<div class="body"></div>
<div class="desk"></div>
</div>
<div class="gauge"><div class="gauge-fill" id="gaugeFill"></div></div>
</div>
<div class="controls">
<input type="range" min="0" max="100" value="0" step="1"
class="scale-slider" id="scaleSlider"
aria-label="Instance size">
<div class="tier-readout">
<span class="tier-name" id="tierName">t3.micro</span>
<span class="tier-specs" id="tierSpecs">2 vCPU Β· 1 GB RAM</span>
</div>
<div class="tier-role" id="tierRole">Junior operator</div>
<div class="calls-readout">handling <strong id="callsCount">1</strong> call at once</div>
<div class="limit-note" id="limitNote">Can't scale up any further β time to scale out instead.</div>
</div>
<script>
(function () {
var wrapper = document.currentScript.closest('.infographic-vertical-scaling');
// ---- dark mode detection ----
var bodyAttr = document.body.getAttribute('data-darkmode');
var dark;
if (bodyAttr === 'true') { dark = true; }
else if (bodyAttr === 'false') { dark = false; }
else {
var match = document.cookie.match(/(?:^|;\s*)darkMode=([^;]+)/);
dark = match ? match[1] === 'true' : false;
}
if (dark) wrapper.setAttribute('data-theme', 'dark');
// ---- tiers ----
var tiers = [
{ max: 24, name: 't3.micro', specs: '2 vCPU Β· 1 GB RAM', role: 'Junior operator πΆ' },
{ max: 49, name: 't3.large', specs: '2 vCPU Β· 8 GB RAM', role: 'Associate operator π§' },
{ max: 74, name: 'm5.2xlarge', specs: '8 vCPU Β· 32 GB RAM', role: 'Senior operator π§βπΌ' },
{ max: 99, name: 'm5.12xlarge', specs: '48 vCPU Β· 192 GB RAM',role: 'Lead operator π¨βπΌ' },
{ max: 100, name: 'u-12tb1.metal', specs: '448 vCPU Β· 12 TB RAM',role: 'Maxed out β no bigger box exists π«' }
];
var slider = wrapper.querySelector('#scaleSlider');
var figureWrap = wrapper.querySelector('#figureWrap');
var tierName = wrapper.querySelector('#tierName');
var tierSpecs = wrapper.querySelector('#tierSpecs');
var tierRole = wrapper.querySelector('#tierRole');
var callsCount = wrapper.querySelector('#callsCount');
var callsLayer = wrapper.querySelector('#callsLayer');
var gaugeFill = wrapper.querySelector('#gaugeFill');
var ceiling = wrapper.querySelector('#ceiling');
var ceilingLabel = wrapper.querySelector('#ceilingLabel');
var limitNote = wrapper.querySelector('#limitNote');
var lastCallCount = -1;
function tierFor(v) {
for (var i = 0; i < tiers.length; i++) {
if (v <= tiers[i].max) return tiers[i];
}
return tiers[tiers.length - 1];
}
function renderCalls(n) {
if (n === lastCallCount) return;
lastCallCount = n;
callsLayer.innerHTML = '';
for (var i = 0; i < n; i++) {
var span = document.createElement('span');
span.className = 'call-icon';
span.textContent = 'βοΈ';
callsLayer.appendChild(span);
}
requestAnimationFrame(function () {
callsLayer.querySelectorAll('.call-icon').forEach(function (el) {
el.classList.add('is-in');
});
});
}
function update(v) {
var t = tierFor(v);
var scale = 0.7 + (v / 100) * 1.1;
var isMax = v >= 100;
figureWrap.style.setProperty('--scale', scale.toFixed(2));
tierName.textContent = t.name;
tierSpecs.textContent = t.specs;
tierRole.textContent = t.role;
var calls = 1 + Math.floor(v / 15);
if (calls > 7) calls = 7;
callsCount.textContent = calls;
renderCalls(calls);
gaugeFill.style.height = v + '%';
gaugeFill.classList.toggle('is-maxed', isMax);
ceiling.classList.toggle('is-active', isMax);
ceilingLabel.classList.toggle('is-active', isMax);
limitNote.classList.toggle('is-active', isMax);
if (isMax) {
figureWrap.classList.remove('hit-ceiling');
void figureWrap.offsetWidth; // restart animation
figureWrap.classList.add('hit-ceiling');
}
}
slider.addEventListener('input', function () { update(Number(slider.value)); });
update(Number(slider.value));
})();
</script>
</div>.demo {
font-family: system-ui, sans-serif;
padding: 16px;
}
.demo h1 {
color: #2563eb;
margin: 0 0 8px;
}
.demo p {
color: #4b5563;
margin: 0;
}document.querySelector('.demo h1')?.addEventListener('click', () => {
alert('Hello from live preview!');
});βοΈ Vertical Scaling (Scale Up/Down)
Make a single instance more powerful.
Call center analogy: Same operator, but upgraded β junior operator β senior operator. One person, handling more calls.
AWS example: Resize an instance, e.g.
t3.microβt3.largeGood for: Non-distributed systems like databases β just give the database more power.
Limitation: There's always a hardware ceiling. Eventually you can't scale up any further.
<div class="infographic-horizontal-scaling">
<style>
.infographic-horizontal-scaling {
--ink: #1a1a1a;
--ink-soft: #5c5c5c;
--paper: #ffffff;
--paper-alt: #f0ece4;
--accent: #2563eb;
--accent-soft:#e3ebfd;
--line: #ddd6c9;
--display-font: 'Georgia', 'Iowan Old Style', serif;
--mono-font: 'SF Mono', 'Menlo', monospace;
background: var(--paper);
color: var(--ink);
border: 1px solid var(--line);
border-radius: 4px;
padding: clamp(1.25rem, 4vw, 2.5rem);
max-width: 640px;
margin: 1.5rem auto;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
box-sizing: border-box;
}
.infographic-horizontal-scaling[data-theme="dark"] {
--ink: #e8e6e1;
--ink-soft: #9a968c;
--paper: #121212;
--paper-alt: #1e1e26;
--accent: #5b8def;
--accent-soft:#202942;
--line: #2c313d;
}
.infographic-horizontal-scaling * { box-sizing: border-box; }
.ig-header { text-align: center; margin-bottom: 1.5rem; }
.ig-eyebrow {
font-family: var(--mono-font); font-size: 0.72rem; letter-spacing: 0.12em;
text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 0.4rem;
}
.ig-title {
font-family: var(--display-font); font-size: clamp(1.4rem, 4vw, 1.8rem);
margin: 0; color: var(--ink);
}
/* ---- Stage ---- */
.stage {
position: relative;
background: var(--paper-alt);
border: 1px solid var(--line);
border-radius: 4px;
padding: 1.5rem 1rem 1.25rem;
margin-bottom: 1.25rem;
}
.lb-row { display: flex; justify-content: center; margin-bottom: 4px; }
.lb {
background: var(--accent); color: var(--paper);
font-family: var(--mono-font); font-size: 0.72rem; font-weight: 600;
padding: 0.35rem 0.9rem; border-radius: 4px; letter-spacing: 0.04em;
position: relative; z-index: 2;
}
.lb-label {
text-align: center; font-size: 0.68rem; color: var(--ink-soft);
margin-bottom: 0.5rem;
}
.conn-svg { display: block; width: 100%; height: 70px; }
.conn-line {
stroke: var(--accent); stroke-width: 1.5; fill: none;
opacity: 0.15; transition: opacity 0.3s ease;
}
.conn-line.is-active {
opacity: 0.9;
animation: pulse-line 1.4s ease-in-out infinite;
}
@keyframes pulse-line {
0%, 100% { opacity: 0.55; }
50% { opacity: 0.95; }
}
.asg {
position: relative;
border: 1.5px dashed var(--line);
border-radius: 6px;
padding: 1.1rem 0.5rem 0.6rem;
}
.asg-label {
position: absolute; top: -0.6rem; left: 0.7rem;
background: var(--paper-alt); padding: 0 0.4rem;
font-size: 0.65rem; font-family: var(--mono-font);
color: var(--ink-soft); letter-spacing: 0.04em;
}
.instances {
display: grid; grid-template-columns: repeat(6, 1fr);
gap: 0.25rem; align-items: end;
}
.instance {
display: flex; flex-direction: column; align-items: center;
opacity: 0.18; transform: scale(0.75);
transition: opacity 0.3s ease, transform 0.3s ease;
}
.instance.is-active {
opacity: 1; transform: scale(1);
}
.instance.is-entering { animation: pop-in 0.4s ease; }
@keyframes pop-in {
0% { transform: scale(0.5); }
60% { transform: scale(1.12); }
100% { transform: scale(1); }
}
.inst-head { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); }
.inst-body { width: 26px; height: 18px; border-radius: 5px 5px 0 0; background: var(--accent); margin-top: -1px; }
.inst-base { width: 32px; height: 4px; background: var(--ink-soft); opacity: 0.35; border-radius: 2px; margin-top: 2px; }
/* ---- Controls ---- */
.controls { text-align: center; }
.load-slider {
width: 100%; accent-color: var(--accent); margin-bottom: 0.9rem; cursor: pointer;
}
.readout {
display: flex; align-items: baseline; justify-content: center; gap: 0.5rem;
flex-wrap: wrap; margin-bottom: 0.3rem;
}
.readout-count {
font-family: var(--mono-font); font-size: 1.15rem; color: var(--accent); font-weight: 600;
}
.readout-label { font-size: 0.82rem; color: var(--ink-soft); }
.sub-readout { font-size: 0.78rem; color: var(--ink-soft); }
.sub-readout strong { color: var(--ink); font-family: var(--mono-font); }
@media (max-width: 480px) {
.inst-body { width: 20px; }
.inst-base { width: 24px; }
}
@media (prefers-reduced-motion: reduce) {
.infographic-horizontal-scaling *, .infographic-horizontal-scaling *::before, .infographic-horizontal-scaling *::after {
animation-duration: 0.001ms !important; transition-duration: 0.001ms !important;
}
}
</style>
<div class="ig-header">
<span class="ig-eyebrow">βοΈ Horizontal Scaling</span>
<h3 class="ig-title">More instances, same size</h3>
</div>
<div class="stage">
<div class="lb-row"><div class="lb">LOAD BALANCER</div></div>
<div class="lb-label">routes each call to a free instance</div>
<svg class="conn-svg" id="connSvg" viewBox="0 0 120 70" preserveAspectRatio="none">
<!-- lines injected by JS -->
</svg>
<div class="asg">
<span class="asg-label">Auto Scaling Group</span>
<div class="instances" id="instances">
<!-- 6 fixed instance slots injected by JS -->
</div>
</div>
</div>
<div class="controls">
<input type="range" min="0" max="100" value="10" step="1"
class="load-slider" id="loadSlider"
aria-label="Incoming call volume">
<div class="readout">
<span class="readout-count" id="instanceCount">1</span>
<span class="readout-label" id="instanceWord">instance active</span>
</div>
<div class="sub-readout">~<strong id="perInstance">10</strong> calls routed per instance</div>
</div>
<script>
(function () {
var wrapper = document.currentScript.closest('.infographic-horizontal-scaling');
// ---- dark mode detection ----
var bodyAttr = document.body.getAttribute('data-darkmode');
var dark;
if (bodyAttr === 'true') { dark = true; }
else if (bodyAttr === 'false') { dark = false; }
else {
var match = document.cookie.match(/(?:^|;\s*)darkMode=([^;]+)/);
dark = match ? match[1] === 'true' : false;
}
if (dark) wrapper.setAttribute('data-theme', 'dark');
var TOTAL = 6;
var slider = wrapper.querySelector('#loadSlider');
var instancesEl = wrapper.querySelector('#instances');
var connSvg = wrapper.querySelector('#connSvg');
var instanceCount = wrapper.querySelector('#instanceCount');
var instanceWord = wrapper.querySelector('#instanceWord');
var perInstance = wrapper.querySelector('#perInstance');
// build fixed instance slots
var slots = [];
for (var i = 0; i < TOTAL; i++) {
var el = document.createElement('div');
el.className = 'instance';
el.innerHTML = '<div class="inst-head"></div><div class="inst-body"></div><div class="inst-base"></div>';
instancesEl.appendChild(el);
slots.push(el);
}
// build connector lines (SVG coords 0-120 x, 0-70 y), top center to each slot x
var lines = [];
for (var j = 0; j < TOTAL; j++) {
var x = (j + 0.5) * (120 / TOTAL);
var line = document.createElementNS('http://www.w3.org/2000/svg', 'path');
var d = 'M 60 2 C 60 30, ' + x + ' 20, ' + x + ' 66';
line.setAttribute('d', d);
line.setAttribute('class', 'conn-line');
connSvg.appendChild(line);
lines.push(line);
}
var lastCount = 0;
function activeCountFor(v) {
var n = Math.ceil((v / 100) * TOTAL);
if (n < 1) n = 1;
if (n > TOTAL) n = TOTAL;
return n;
}
function update(v) {
var n = activeCountFor(v);
slots.forEach(function (el, idx) {
var shouldBeActive = idx < n;
var wasActive = el.classList.contains('is-active');
el.classList.toggle('is-active', shouldBeActive);
if (shouldBeActive && !wasActive) {
el.classList.remove('is-entering');
void el.offsetWidth;
el.classList.add('is-entering');
}
});
lines.forEach(function (line, idx) {
line.classList.toggle('is-active', idx < n);
});
instanceCount.textContent = n;
instanceWord.textContent = n === 1 ? 'instance active' : 'instances active';
perInstance.textContent = Math.max(1, Math.round(v / n));
lastCount = n;
}
slider.addEventListener('input', function () { update(Number(slider.value)); });
update(Number(slider.value));
})();
</script>
</div>.demo {
font-family: system-ui, sans-serif;
padding: 16px;
}
.demo h1 {
color: #2563eb;
margin: 0 0 8px;
}
.demo p {
color: #4b5563;
margin: 0;
}document.querySelector('.demo h1')?.addEventListener('click', () => {
alert('Hello from live preview!');
});βοΈ Horizontal Scaling (Scale Out/In)
Add more instances instead of making one bigger.
Call center analogy: 1 operator β 6 operators, all working in parallel.
AWS example: Add more EC2 instances.
Requires: A distributed system architecture.
Common in: Modern web apps, paired with Auto Scaling Groups and Load Balancers.
π€ High Availability
<div class="infographic-high-availability">
<style>
.infographic-high-availability {
--ink: #1a1a1a;
--ink-soft: #5c5c5c;
--paper: #ffffff;
--paper-alt: #f0ece4;
--accent: #2563eb;
--accent-soft:#e3ebfd;
--line: #ddd6c9;
--error: #c0392b;
--error-soft: #fbe9e7;
--display-font: 'Georgia', 'Iowan Old Style', serif;
--mono-font: 'SF Mono', 'Menlo', monospace;
background: var(--paper);
color: var(--ink);
border: 1px solid var(--line);
border-radius: 4px;
padding: clamp(1.25rem, 4vw, 2.5rem);
max-width: 640px;
margin: 1.5rem auto;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
box-sizing: border-box;
}
.infographic-high-availability[data-theme="dark"] {
--ink: #e8e6e1;
--ink-soft: #9a968c;
--paper: #121212;
--paper-alt: #1e1e26;
--accent: #5b8def;
--accent-soft:#202942;
--line: #2c313d;
--error: #e57373;
--error-soft: #3a2222;
}
.infographic-high-availability * { box-sizing: border-box; }
.ig-header { text-align: center; margin-bottom: 1.5rem; }
.ig-eyebrow {
font-family: var(--mono-font); font-size: 0.72rem; letter-spacing: 0.12em;
text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 0.4rem;
}
.ig-title {
font-family: var(--display-font); font-size: clamp(1.4rem, 4vw, 1.8rem);
margin: 0; color: var(--ink);
}
/* ---- Stage ---- */
.stage {
position: relative;
background: var(--paper-alt);
border: 1px solid var(--line);
border-radius: 4px;
padding: 1.5rem 1rem 1.5rem;
margin-bottom: 1.1rem;
}
.lb-row { display: flex; justify-content: center; }
.lb {
background: var(--accent); color: var(--paper);
font-family: var(--mono-font); font-size: 0.72rem; font-weight: 600;
padding: 0.35rem 0.9rem; border-radius: 4px; letter-spacing: 0.04em;
position: relative; z-index: 2;
}
.conn-svg { display: block; width: 100%; height: 46px; }
.conn-line {
stroke: var(--accent); stroke-width: 2; fill: none;
transition: stroke 0.35s ease, opacity 0.35s ease;
animation: pulse-line 1.6s ease-in-out infinite;
}
.conn-line.is-down {
stroke: var(--error); stroke-dasharray: 4 5; opacity: 0.6; animation: none;
}
@keyframes pulse-line {
0%, 100% { opacity: 0.55; }
50% { opacity: 0.95; }
}
.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.zone {
position: relative;
background: var(--paper);
border: 1.5px solid var(--line);
border-radius: 6px;
padding: 0.9rem 0.7rem 0.7rem;
text-align: center;
overflow: hidden;
transition: border-color 0.3s ease, opacity 0.3s ease;
}
.zone.is-thriving { border-color: var(--accent); }
.zone.is-down { opacity: 0.5; }
.zone-tag {
font-family: var(--mono-font); font-size: 0.62rem; color: var(--ink-soft);
letter-spacing: 0.06em; margin-bottom: 0.15rem;
}
.zone-name {
font-size: 0.88rem; font-weight: 600; margin-bottom: 0.55rem;
}
.zone-instances {
display: flex; justify-content: center; gap: 0.35rem; margin-bottom: 0.65rem;
min-height: 34px; align-items: flex-end;
}
.zi-head { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.zi-body { width: 20px; height: 14px; border-radius: 4px 4px 0 0; background: var(--accent); margin-top: -1px; }
.zone-inst {
display: flex; flex-direction: column; align-items: center;
transition: transform 0.3s ease;
}
.zone.is-thriving .zone-inst { animation: busy-pulse 1.1s ease-in-out infinite; }
@keyframes busy-pulse {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-2px); }
}
.outage-stamp {
position: absolute; inset: 0;
background: repeating-linear-gradient(-45deg, var(--error-soft) 0 8px, transparent 8px 16px);
display: flex; align-items: center; justify-content: center;
opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.zone.is-down .outage-stamp { opacity: 1; }
.outage-stamp span {
background: var(--error); color: var(--paper);
font-family: var(--mono-font); font-size: 0.68rem; font-weight: 700;
letter-spacing: 0.06em; padding: 0.25rem 0.6rem; border-radius: 3px;
transform: rotate(-6deg);
}
.zone.hit-down { animation: zone-shake 0.4s ease; }
@keyframes zone-shake {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(-3px); }
50% { transform: translateX(3px); }
75% { transform: translateX(-2px); }
}
.zone-btn {
font: inherit; font-size: 0.7rem; font-family: var(--mono-font);
background: var(--paper); border: 1px solid var(--line); color: var(--ink);
padding: 0.3rem 0.6rem; border-radius: 3px; cursor: pointer;
transition: border-color 0.15s ease, opacity 0.15s ease;
}
.zone-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.zone-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.zone.is-down .zone-btn { border-color: var(--error); color: var(--error); }
/* ---- Status ---- */
.status {
text-align: center; font-size: 0.82rem; color: var(--ink-soft);
min-height: 1.3em;
}
.status strong { color: var(--ink); }
.status.is-alert strong { color: var(--error); }
.status.is-good strong { color: var(--accent); }
@media (max-width: 420px) {
.zone-name { font-size: 0.78rem; }
}
@media (prefers-reduced-motion: reduce) {
.infographic-high-availability *, .infographic-high-availability *::before, .infographic-high-availability *::after {
animation-duration: 0.001ms !important; transition-duration: 0.001ms !important;
}
}
</style>
<div class="ig-header">
<span class="ig-eyebrow">π€ High Availability</span>
<h3 class="ig-title">One zone down, zero downtime</h3>
</div>
<div class="stage">
<div class="lb-row"><div class="lb">LOAD BALANCER</div></div>
<svg class="conn-svg" id="connSvg" viewBox="0 0 120 46" preserveAspectRatio="none">
<path id="lineNY" class="conn-line" d="M 60 2 C 60 20, 25 15, 25 44" />
<path id="lineSF" class="conn-line" d="M 60 2 C 60 20, 95 15, 95 44" />
</svg>
<div class="zones">
<div class="zone" id="zoneNY">
<div class="outage-stamp"><span>OUTAGE</span></div>
<div class="zone-tag">AZ Β· us-east-1a</div>
<div class="zone-name">New York</div>
<div class="zone-instances" id="instNY"></div>
<button class="zone-btn" id="btnNY" type="button">β‘ Fail this zone</button>
</div>
<div class="zone" id="zoneSF">
<div class="outage-stamp"><span>OUTAGE</span></div>
<div class="zone-tag">AZ Β· us-west-1b</div>
<div class="zone-name">San Francisco</div>
<div class="zone-instances" id="instSF"></div>
<button class="zone-btn" id="btnSF" type="button">β‘ Fail this zone</button>
</div>
</div>
</div>
<div class="controls">
<div class="status is-good" id="status">β
Traffic split across <strong>both zones</strong></div>
</div>
<script>
(function () {
var wrapper = document.currentScript.closest('.infographic-high-availability');
// ---- dark mode detection ----
var bodyAttr = document.body.getAttribute('data-darkmode');
var dark;
if (bodyAttr === 'true') { dark = true; }
else if (bodyAttr === 'false') { dark = false; }
else {
var match = document.cookie.match(/(?:^|;\s*)darkMode=([^;]+)/);
dark = match ? match[1] === 'true' : false;
}
if (dark) wrapper.setAttribute('data-theme', 'dark');
var zoneNY = wrapper.querySelector('#zoneNY');
var zoneSF = wrapper.querySelector('#zoneSF');
var btnNY = wrapper.querySelector('#btnNY');
var btnSF = wrapper.querySelector('#btnSF');
var lineNY = wrapper.querySelector('#lineNY');
var lineSF = wrapper.querySelector('#lineSF');
var instNY = wrapper.querySelector('#instNY');
var instSF = wrapper.querySelector('#instSF');
var status = wrapper.querySelector('#status');
function buildInstances(container, n) {
for (var i = 0; i < n; i++) {
var el = document.createElement('div');
el.className = 'zone-inst';
el.innerHTML = '<div class="zi-head"></div><div class="zi-body"></div>';
container.appendChild(el);
}
}
buildInstances(instNY, 3);
buildInstances(instSF, 3);
var downZone = null; // null | 'ny' | 'sf'
function render() {
var nyDown = downZone === 'ny';
var sfDown = downZone === 'sf';
zoneNY.classList.toggle('is-down', nyDown);
zoneSF.classList.toggle('is-down', sfDown);
zoneNY.classList.toggle('is-thriving', sfDown);
zoneSF.classList.toggle('is-thriving', nyDown);
lineNY.classList.toggle('is-down', nyDown);
lineSF.classList.toggle('is-down', sfDown);
btnNY.textContent = nyDown ? 'βΊ Restore New York' : 'β‘ Fail this zone';
btnSF.textContent = sfDown ? 'βΊ Restore San Francisco' : 'β‘ Fail this zone';
// don't allow knocking out the only remaining zone
btnNY.disabled = !nyDown && sfDown;
btnSF.disabled = !sfDown && nyDown;
if (downZone === null) {
status.className = 'status is-good';
status.innerHTML = 'β
Traffic split across <strong>both zones</strong>';
} else if (nyDown) {
status.className = 'status is-alert';
status.innerHTML = 'β οΈ New York is down β <strong>San Francisco</strong> is serving 100% of traffic';
} else {
status.className = 'status is-alert';
status.innerHTML = 'β οΈ San Francisco is down β <strong>New York</strong> is serving 100% of traffic';
}
}
function shake(zoneEl) {
zoneEl.classList.remove('hit-down');
void zoneEl.offsetWidth;
zoneEl.classList.add('hit-down');
}
btnNY.addEventListener('click', function () {
if (downZone === 'ny') { downZone = null; }
else if (downZone === null) { downZone = 'ny'; shake(zoneNY); }
render();
});
btnSF.addEventListener('click', function () {
if (downZone === 'sf') { downZone = null; }
else if (downZone === null) { downZone = 'sf'; shake(zoneSF); }
render();
});
render();
})();
</script>
</div>.demo {
font-family: system-ui, sans-serif;
padding: 16px;
}
.demo h1 {
color: #2563eb;
margin: 0 0 8px;
}
.demo p {
color: #4b5563;
margin: 0;
}document.querySelector('.demo h1')?.addEventListener('click', () => {
alert('Hello from live preview!');
});High availability usually goes hand-in-hand with horizontal scaling. The idea: run your system across multiple Availability Zones (AZs) β at least two.
Call center analogy: A New York office and a San Francisco office. If one goes down, the other keeps taking calls.
AWS implementation: Deploy across multiple AZs using Auto Scaling Groups + Load Balancers.
Goal: Survive power outages, natural disasters, or a data center failure entirely.
π Quick Reference
Concept | What it means | AWS tools |
|---|---|---|
Vertical Scaling | Bigger instance ( | Resize instance |
Horizontal Scaling | More instances | Auto Scaling Group, Load Balancer |
High Availability | Same app running across multiple AZs | Multi-AZ deployment |
Scalability vs. Elasticity vs. Agility
Scalability β the ability to handle more load, by scaling up (bigger hardware) or scaling out (more nodes).
Elasticity β once a system is scalable, elasticity is the automation on top: it scales itself up/down based on real-time demand. This is what makes cloud "pay-per-use" β you only pay for what you need, when you need it.
Agility (unrelated to scalability β just a bonus concept) β new resources are a click away, cutting provisioning time from weeks to minutes.