Files
nexus/sreweekly/articles/79/04-scalability-high-availability.html
2026-09-12 17:23:01 +08:00

1920 lines
222 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE HTML>
<html xmlns:ng="http://angularjs.org" id="ng-app" lang="en" ng-app="TH">
<head ng-controller="DZHeadController">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" ng-attr-content="{{ service.description }}" content="Scalability and Availability are mentioned so often that often it is difficult to know what they actually mean in each case. They are often interchanged and create confusion that results in poorly managed expectations and unrealistic metrics. This DZone Refcard provides you with the tools to define these terms so that your team can implement mission-critical systems with well-understood performance goals. This Refcard also covers: An Overview of Scalability and High Availability, Implementing Scalable Systems, Caching Strategies, Clustering, Redundancy and Fault Tolerance, Hot Tips, and More.">
<meta name="keywords" ng-attr-content="{{ service.keywords }}" content="architecture,performance,deployment,scalability,high availability,infrastructure,reliability,refcard">
<meta property="og:description" ng-attr-content="{{ service.description }}" content="Scalability and Availability are mentioned so often that often it is difficult to know what they actually mean in each case. They are often interchanged and create confusion that results in poorly managed expectations and unrealistic metrics. This DZone Refcard provides you with the tools to define these terms so that your team can implement mission-critical systems with well-understood performance goals. This Refcard also covers: An Overview of Scalability and High Availability, Implementing Scalable Systems, Caching Strategies, Clustering, Redundancy and Fault Tolerance, Hot Tips, and More.">
<meta ng-attr-content="{{ service.noIndex ? 'noindex' : '' }}" ng-attr-name="{{ service.noIndex ? 'robots' : '' }}"
name="" content="">
<meta property="og:site_name" ng-attr-content="{{ service.siteName }}" content="dzone.com">
<meta property="og:title" ng-attr-content="{{ service.metaTitle ? service.metaTitle : service.title }}" content="Scalability and High Availability - DZone Refcards">
<meta property="og:url" ng-attr-content="{{ service.canonical }}" content="https://dzone.com/refcardz/scalability">
<meta ng-if="service.img" ng-attr-content="{{ service.img }}" property="og:image" content="https://dz2cdn1.dzone.com/storage/rc-covers/5747748-refcard-cover43.jpg">
<meta ng-if="service.type" ng-attr-content="{{ service.type }}" property="og:type" content="article">
<meta name="twitter:site" content="@DZoneInc">
<meta ng-if="service.twitterImage" ng-attr-content="{{ service.twitterImage }}" name="twitter:image" content="https://dz2cdn1.dzone.com/storage/rc-covers/5747748-refcard-cover43.jpg">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:description" ng-attr-content="{{ service.description }}" content="Scalability and Availability are mentioned so often that often it is difficult to know what they actually mean in each case. They are often interchanged and create confusion that results in poorly managed expectations and unrealistic metrics. This DZone Refcard provides you with the tools to define these terms so that your team can implement mission-critical systems with well-understood performance goals. This Refcard also covers: An Overview of Scalability and High Availability, Implementing Scalable Systems, Caching Strategies, Clustering, Redundancy and Fault Tolerance, Hot Tips, and More.">
<meta name="twitter:title" ng-attr-content="{{ service.metaTitle ? service.metaTitle : service.title }}" content="Scalability and High Availability - DZone Refcards">
<meta ng-if="service.wordCount" property="article:wordcount" ng-attr-content="{{service.wordCount}}" content="86">
<meta name="referrer" content="origin">
<meta name="google-site-verification" content="kndbhxcupfEqWmZclhCpB6vlgOs7QSmx2UHAGGnP2mA">
<link rel="dns-prefetch" href="//www.googletagservices.com">
<link rel="dns-prefetch" href="//www.google-analytics.com">
<link rel="dns-prefetch" href="//a.optnmstr.com">
<link rel="dns-prefetch" href="//ajax.googleapis.com">
<link rel="dns-prefetch" href="//csi.gstatic.com">
<link rel="image_src" ng-href="{{ service.img }}" href="https://dz2cdn1.dzone.com/storage/rc-covers/5747748-refcard-cover43.jpg">
<link ng-if="service.prevPage" rel="prev" ng-href="{{ service.prevPage }}" href="">
<link ng-if="service.nextPage" rel="next" ng-href="{{ service.nextPage }}" href="">
<link rel="icon" type="image/x-icon" href="/themes/dz20/images/favicon.png">
<link rel="canonical" href="https://dzone.com/refcardz/scalability" ng-href="{{service.canonical}}">
<title ng-bind="service.metaTitle ? service.metaTitle : service.title">
Scalability and High Availability - DZone Refcards
</title>
<meta name="df-verify" content="df0d76632b4543">
<link rel="stylesheet" type="text/css" href="https://dz2cdn1.dzone.com/storage/pub/19198148-combined.css" charset="utf-8"/><link rel="stylesheet" type="text/css" href="https://dz2cdn1.dzone.com/storage/pub/19198150-combined.css" charset="utf-8"/></head>
<body>
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-K25QL22"
height="0" width="0" style="display:none;visibility:hidden">
</iframe>
</noscript>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"url": "https://dzone.com",
"name": "DZone",
"description": "DZone.com is one of the world's largest online communities and leading publisher of knowledge resources for software engineering professionals. Every day, thousands of developers come to DZone.com to read about the latest technology trends and learn about new technologies, methodologies, and best practices through shared knowledge.",
"address": {
"@type": "PostalAddress",
"streetAddress": "3343 Perimeter Hill Drive, Suite 215",
"addressLocality": "Nashville",
"addressRegion": "TN",
"addressCountry": "US",
"postalCode": "37211"
},
"contactPoint": {
"email": "support@dzone.com",
"contactType": "Support"
},
"sameAs": [
"https://www.linkedin.com/company/dzone",
"https://twitter.com/DZoneInc",
"https://www.facebook.com/DZoneInc",
"https://www.youtube.com/c/dzone"
],
"logo": {
"@type": "ImageObject",
"url": "https://dz2cdn1.dzone.com/themes/dz20/images/dz_logo_2021_cropped.png",
"caption": "DZone"
}
}
</script>
<div class="container-fluid header" th-element="header" th-element-groups="[]" ng-hide="$root.isHidden('header')" data-th-element-name="header"><div class="row mainHeaderRow" th-element="mainHeaderRow" th-element-groups="['header']" ng-hide="$root.isHidden('mainHeaderRow')" data-th-element-name="mainHeaderRow"><div class="col-md-12 mainHeader headerHeaderV2 oUhbWOfRPSwBoUhM" th-element="mainHeader" th-element-groups="['header','mainHeaderRow']" ng-hide="$root.isHidden('mainHeader')" data-th-element-name="mainHeader" data-th-widget="header.headerV2" data-widget-header-header-v2="" ng-controller="mainHeader">
<script type="text/ng-template" id="like-article.html">
<div class="dz-like"
ng-class='{liked: status.liked}'
ng-click='like()'
<a href="#">
<i ng-class="{'icon-thumbs-up-alt': status.liked, 'icon-thumbs-up liked': !status.liked}"></i>
<span>Like ({{ status.score }})</span>
</a>
</div>
</script>
<script type="text/ng-template" id="refcard-save.html">
<button type="button" ng-class="{'icon-star gold': status.saved, 'icon-star-empty': !status.saved}"
ng-click="save()" class="btn btn-save btn-lg"><span class="save-title">Save</span><span ng-if="status.saved"
class="d-letter">D</span>
</button>
</script>
<header id="ftl-header">
<div class="header-top">
<div class="header-container">
<div class="pull-left logo-container">
<div class="logo">
<a class="inner" href="/">
<picture>
<source srcset="https://dz2cdn1.dzone.com/themes/dz20/images/dz_logo_2021_cropped.webp" type="image/webp">
<source srcset="https://dz2cdn1.dzone.com/themes/dz20/images/dz_logo_2021_cropped.png" type="image/png">
<img src="https://dz2cdn1.dzone.com/themes/dz20/images/dz_logo_2021_cropped.png" width="181" height="56" alt="DZone">
</picture>
</a>
</div>
</div>
<div class="pull-right login-and-search">
<div id="authenticated-block" class="logged-in">
<div class="welcome-back">Thanks for visiting DZone today,</div>
<div id="user-header" class="user-info">
<button class="user-avatar">
<span id="header-username" class="username"></span>
<img id="header-avatar" src="" alt="user avatar">
</button>
<div id="user-dropdown" class="browse-user-menu">
<div class="user-content">
<a id="header-user-plug" href="#" class="user-description"></a>
<a id="header-user-edit" href="#" class="edit-profile">Edit Profile</a>
</div>
<ul class="user-actions">
<li id="first-user-action">
<a id="header-dropdown-manage-email" href="#">Manage Email Subscriptions</a>
</li>
<li>
<a href="/articles/how-to-submit-a-post-to-dzone?utm_source=DZone&utm_medium=user_dropdown&utm_campaign=how_to_post">
How to Post to DZone
</a>
</li>
<li>
<a href="/articles/dzones-article-submission-guidelines">
Article Submission Guidelines
</a>
</li>
</ul>
<div class="bottom">
<a href="/users/logout.html" class="sign-out">Sign Out</a>
<a id="dropdown-view-profile" href="#" class="view-profile">View Profile</a>
</div>
</div>
</div>
<div class="post-content">
<button id="post-button" class="post-content--button">
<span class="post-class">Post</span>
<i class="icon-plus"></i>
</button>
<div id="post-menu" class="posting-links">
<div class="posting-links-menu">
<ul>
<li>
<img src="https://dz2cdn1.dzone.com/themes/dz20/images/dz-postarticle.svg" width="15" height="18" style="width: 15px; height: 18px;">
<a href="/content/article/post.html">Post an Article</a>
</li>
<li>
<a id="drafts-link" href="#">Manage My Drafts</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="unauthenticated-block">
<div class="dz-intro">Over 2 million developers have joined DZone.</div>
<div class="mobile-invisible sign-in-join">
<a href="/users/login.html">Log In</a>
<span class="dz-intro-span">/</span>
<a href="/static/registration.html">Join</a>
</div>
<a class="join-icon" href="/users/login.html" aria-label="User">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide svg-user lucide-user-icon lucide-user">
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
</a>
</div>
<script>
document.addEventListener('alpine:init', () => {
Alpine.data('searchDrawer', () => ({
open: false,
query: '',
minCharsMet: false,
toggleVisibility() {
this.open = !this.open;
if (this.open) {
this.$nextTick(() => {
this.$refs.query.focus();
});
}
},
updateSearchValue() {
if (!this.query || !this.query.length || this.query.length < 3) {
this.minCharsMet = false;
return;
}
this.minCharsMet = true;
localStorage.setItem('ls.searchValue', this.query);
},
searchSite() {
if (this.minCharsMet) {
window.location = '/search';
}
}
}));
});
</script>
<div class="headerSearch" x-data="searchDrawer()" x-cloak>
<button class="btn-search dropdown-toggle" x-on:click="toggleVisibility()" aria-label="Search">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide svg-search lucide-search-icon lucide-search">
<path d="m21 21-4.34-4.34"></path>
<circle cx="11" cy="11" r="8"></circle>
</svg>
</button>
<template x-teleport=".header-container">
<div id="search-drawer" x-show="open" x-on:click.outside="open = false" x-transition>
<div class="search-input">
<input type="text"
placeholder="Search"
autofocus="autofocus"
x-model="query"
x-ref="query"
x-on:input.change="updateSearchValue()"
x-on:keyup.enter="searchSite()"
>
<button x-on:click="searchSite()" x-bind:disabled="!minCharsMet">
<span>Search</span>
</button>
</div>
<div class="search-footer">
Please enter at least three characters to search
</div>
</div>
</template>
</div>
</div>
</div> </div>
<div class="header-bottom">
<div class="header-bottom-container">
<a class="resource-link" href="/refcardz">Refcards</a>
<a class="resource-link" href="/trendreports">Trend Reports</a>
<div class="resource-link link-menu">
<a href="/events">Events</a>
<a href="/events/video-library">Video Library</a>
</div>
</div>
</div>
<nav class="header-menu-bar">
<div class="header-menu resource-category">
<a href="/refcardz">Refcards</a>
</div>
<div class="header-menu-separator resource-category-separator"></div>
<div class="header-menu resource-category">
<a href="/trendreports">Trend Reports</a>
</div>
<div class="header-menu-separator resource-category-separator"></div>
<div class="header-menu resource-category no-bottom-radius" data-click-activation>
<p class="menu-label">Events</p>
<div class="header-menu-items">
<div class="header-menu-columns">
<a class="header-menu-item" href="/events">View Events</a>
<a class="header-menu-item" href="/events/video-library">Video Library</a>
</div>
</div>
</div>
<div class="header-menu zone-menu" data-click-activation>
<p class="menu-label">Zones <i class="icon-down-dir icon-closed"></i><i class="icon-right-dir icon-open"></i></p>
<div class="header-menu-items">
<div class="header-menu-columns">
<div class="header-menu-column-item">
<a class="header-menu-item" href="/culture-and-methodologies">Culture and Methodologies</a>
<a class="header-menu-item" href="/agile">Agile</a>
<a class="header-menu-item" href="/career-development">Career Development</a>
<a class="header-menu-item" href="/methodologies">Methodologies</a>
<a class="header-menu-item" href="/team-management">Team Management</a>
</div>
<div class="header-menu-column-item">
<a class="header-menu-item" href="/data-engineering">Data Engineering</a>
<a class="header-menu-item" href="/ai-ml">AI/ML</a>
<a class="header-menu-item" href="/big-data">Big Data</a>
<a class="header-menu-item" href="/data">Data</a>
<a class="header-menu-item" href="/databases">Databases</a>
<a class="header-menu-item" href="/iot">IoT</a>
</div>
<div class="header-menu-column-item">
<a class="header-menu-item" href="/software-design-and-architecture">Software Design and Architecture</a>
<a class="header-menu-item" href="/cloud-architecture">Cloud Architecture</a>
<a class="header-menu-item" href="/containers">Containers</a>
<a class="header-menu-item" href="/integration">Integration</a>
<a class="header-menu-item" href="/microservices">Microservices</a>
<a class="header-menu-item" href="/performance">Performance</a>
<a class="header-menu-item" href="/security">Security</a>
</div>
<div class="header-menu-column-item">
<a class="header-menu-item" href="/coding">Coding</a>
<a class="header-menu-item" href="/frameworks">Frameworks</a>
<a class="header-menu-item" href="/java">Java</a>
<a class="header-menu-item" href="/javascript">JavaScript</a>
<a class="header-menu-item" href="/languages">Languages</a>
<a class="header-menu-item" href="/tools">Tools</a>
</div>
<div class="header-menu-column-item">
<a class="header-menu-item" href="/testing-deployment-and-maintenance">Testing, Deployment, and Maintenance</a>
<a class="header-menu-item" href="/deployment">Deployment</a>
<a class="header-menu-item" href="/devops-and-cicd">DevOps and CI/CD</a>
<a class="header-menu-item" href="/maintenance">Maintenance</a>
<a class="header-menu-item" href="/monitoring-and-observability">Monitoring and Observability</a>
<a class="header-menu-item" href="/testing-tools-and-frameworks">Testing, Tools, and Frameworks</a>
</div>
<div class="header-menu-column-item sponsored">
<a class="header-menu-item" href="javascript:void(0)">Partner Zones</a>
<a class="header-menu-item" href="/hubs/build-ai-agents-that-are-ready-for-production/">Build AI Agents That Are Ready for Production</a>
</div>
</div>
</div>
</div>
<div class="header-menu parent-category" tabindex="1">
<a href="/culture-and-methodologies">Culture and Methodologies</a>
<div class="header-menu-items">
<a class="header-menu-item" href="/agile">Agile</a>
<a class="header-menu-item" href="/career-development">Career Development</a>
<a class="header-menu-item" href="/methodologies">Methodologies</a>
<a class="header-menu-item" href="/team-management">Team Management</a>
</div>
</div>
<div class="header-menu-separator parent-category-separator"></div>
<div class="header-menu parent-category" tabindex="2">
<a href="/data-engineering">Data Engineering</a>
<div class="header-menu-items">
<a class="header-menu-item" href="/ai-ml">AI/ML</a>
<a class="header-menu-item" href="/big-data">Big Data</a>
<a class="header-menu-item" href="/data">Data</a>
<a class="header-menu-item" href="/databases">Databases</a>
<a class="header-menu-item" href="/iot">IoT</a>
</div>
</div>
<div class="header-menu-separator parent-category-separator"></div>
<div class="header-menu parent-category" tabindex="3">
<a href="/software-design-and-architecture">Software Design and Architecture</a>
<div class="header-menu-items">
<a class="header-menu-item" href="/cloud-architecture">Cloud Architecture</a>
<a class="header-menu-item" href="/containers">Containers</a>
<a class="header-menu-item" href="/integration">Integration</a>
<a class="header-menu-item" href="/microservices">Microservices</a>
<a class="header-menu-item" href="/performance">Performance</a>
<a class="header-menu-item" href="/security">Security</a>
</div>
</div>
<div class="header-menu-separator parent-category-separator"></div>
<div class="header-menu parent-category" tabindex="4">
<a href="/coding">Coding</a>
<div class="header-menu-items">
<a class="header-menu-item" href="/frameworks">Frameworks</a>
<a class="header-menu-item" href="/java">Java</a>
<a class="header-menu-item" href="/javascript">JavaScript</a>
<a class="header-menu-item" href="/languages">Languages</a>
<a class="header-menu-item" href="/tools">Tools</a>
</div>
</div>
<div class="header-menu-separator parent-category-separator"></div>
<div class="header-menu parent-category" tabindex="5">
<a href="/testing-deployment-and-maintenance">Testing, Deployment, and Maintenance</a>
<div class="header-menu-items">
<a class="header-menu-item" href="/deployment">Deployment</a>
<a class="header-menu-item" href="/devops-and-cicd">DevOps and CI/CD</a>
<a class="header-menu-item" href="/maintenance">Maintenance</a>
<a class="header-menu-item" href="/monitoring-and-observability">Monitoring and Observability</a>
<a class="header-menu-item" href="/testing-tools-and-frameworks">Testing, Tools, and Frameworks</a>
</div>
</div>
<div class="header-menu-separator parent-category-separator"></div>
<div class="header-menu parent-category sponsored" tabindex="6">
<a href="javascript:void(0)">Partner Zones</a>
<div class="header-menu-items sponsored">
<a class="header-menu-item" href="/hubs/build-ai-agents-that-are-ready-for-production/">Build AI Agents That Are Ready for Production</a>
</div>
</div>
<div class="header-menu-separator parent-category-separator"></div>
</nav>
</header>
<script>
const csrf = {
parameter: 'TH_CSRF',
header: 'X-TH-CSRF',
token: '-1182395294902280484'
}; // set csrf for auth-status script
</script>
<script>
addEventListener('DOMContentLoaded', function() {
handleRedirects();
handleMenus();
handleMobileMenuHeights();
handleGotoLinks();
});
function isHidden(element) {
try {
return window.getComputedStyle(element).display === 'none';
} catch (_) {
return false;
}
}
function getLink(element) {
if (element.hasAttribute('data-goto')) {
return element.getAttribute('data-goto');
}
return element.href;
}
function isLeftClick(event) {
if (event.altKey || event.shiftKey) {
return false;
} else if ('buttons' in event || 'which' in event) {
return event.buttons === 1 || event.which === 1;
} else {
return (event.button === 1 || (event.type === 'click'));
}
}
function handleRedirects() {
const redirections = [...document.querySelectorAll('[data-activate-menu]'), ...document.querySelectorAll('[data-click-target]')];
redirections.forEach(function(element) {
const menuSelector = element.getAttribute('data-activate-menu') || element.getAttribute('data-click-target');
const redirectingElement = document.querySelector(menuSelector);
if (redirectingElement) {
element.style.cursor = 'pointer';
const redirect = function(e) {
if (redirectingElement.hasAttribute('href') || redirectingElement.hasAttribute('data-goto')) {
if (redirectingElement.hasAttribute('data-new-window') || e.ctrlKey || e.metaKey) {
window.open(getLink(redirectingElement), '_blank');
} else {
window.open(getLink(redirectingElement), '_self');
}
} else {
const evt = new e.constructor(e.type, e);
redirectingElement.dispatchEvent(evt);
}
};
element.addEventListener('mouseup', redirect);
element.addEventListener('mousedown', (e) => e.preventDefault());
element.addEventListener('click', (e) => e.preventDefault());
}
});
}
function handleMenus() {
const menuElements = [
...document.querySelectorAll('.header-menu > a'),
...document.querySelectorAll('.header-menu > p.menu-label')
];
let scrollYMemory = -1;
function scrollToMemory() {
if (scrollYMemory !== -1) {
setTimeout(function() {
window.scrollTo(0, scrollYMemory);
scrollYMemory = -1;
}, 10);
}
}
function hideMenus() {
// unfocus menus & items, and set the menus to non-visible.
menuElements.forEach(function (element) {
element.blur();
element.parentElement.blur();
element.parentElement.classList.remove('menu-opened');
const menuItems = element.parentElement.querySelector('.header-menu-items');
if (menuItems) {
menuItems.style.display = 'none';
}
});
const wasHidden = document.body.style.overflowY === 'hidden';
document.body.style.overflowY = 'auto';
if (wasHidden) {
scrollToMemory();
}
}
function isEventOutsideMenu(e) {
return e.target.closest && !e.target.closest('.header-menu') && !e.target.closest('[data-activate-menu]');
}
// Handle mobile menu toggling
menuElements.forEach(function(element) {
const menu = element.parentElement;
const headerItems = menu.querySelector('.header-menu-items');
const menuEntries = headerItems ? headerItems.querySelectorAll('.header-menu-item') : [];
const focus = function() {
menu.focus();
menu.classList.add('menu-opened');
if (headerItems) {
headerItems.style.display = 'block';
}
if (menu.classList.contains('zone-menu')) {
scrollYMemory = window.scrollY;
document.body.style.overflowY = 'hidden';
} else {
scrollYMemory = -1;
}
};
const unfocus = function() {
menu.blur();
menu.classList.remove('menu-opened');
if (headerItems) {
headerItems.style.display = 'none';
}
const wasHidden = document.body.style.overflowY === 'hidden';
document.body.style.overflowY = 'auto';
if (wasHidden) {
scrollToMemory();
}
};
const toggleMenuVisibility = function(e) {
if ((e.type === 'click' || e.type === 'mouseup') && !isLeftClick(e)) {
e.preventDefault();
return;
}
const hidden = isHidden(headerItems);
if (menu.hasAttribute('data-click-activation')) { // handle click activated toggling
if (hidden) {
hideMenus(); // hide other open menus first
focus();
} else {
unfocus();
}
e.preventDefault();
} else if (hidden) {
hideMenus(); // hide other open menus first
focus();
e.preventDefault(); // prevent 'click' event from firing when menu is hidden
}
};
element.addEventListener('touchend', toggleMenuVisibility);
element.addEventListener('mouseup', toggleMenuVisibility);
// Add hover events to non-click-activated menus, even though CSS should cover it.
if (!menu.hasAttribute('data-click-activation')) {
menu.addEventListener('mouseover', function () {
hideMenus(); // hide other open menus first
focus();
});
menu.addEventListener('mouseout', function (e) {
if (isEventOutsideMenu(e)) {
unfocus();
}
});
}
// Hide menu when child is clicked
menuEntries.forEach(function(menuEntry) {
const linkToItem = function(e) {
if (e.type === 'mousedown' || e.type === 'click') {
e.preventDefault();
return;
}
if (e.type === 'mouseup' && !isLeftClick(e)) {
e.preventDefault();
return;
}
window.open(getLink(menuEntry), (e.ctrlKey || e.metaKey) ? '_blank' : (menuEntry.target || '_self'));
unfocus();
e.preventDefault();
};
const linkToMobileItem = function(e) {
if (e.type === 'touchstart') {
menuEntry.setAttribute('data-touchmove', false);
} else if (e.type === 'touchmove') {
menuEntry.setAttribute('data-touchmove', true);
} else if (e.type === 'touchend' && (!menuEntry.hasAttribute('data-touchmove') || menuEntry.getAttribute('data-touchmove').toLowerCase() === 'false')) {
window.open(getLink(menuEntry), (e.ctrlKey || e.metaKey) ? '_blank' : (menuEntry.target || '_self'));
unfocus();
e.preventDefault();
}
};
menuEntry.addEventListener('mousedown', linkToItem);
menuEntry.addEventListener('mouseup', linkToItem);
menuEntry.addEventListener('click', linkToItem);
menuEntry.addEventListener('touchstart', linkToMobileItem);
menuEntry.addEventListener('touchmove', linkToMobileItem);
menuEntry.addEventListener('touchend', linkToMobileItem);
});
});
function hideIfNonMenuBounds(e) {
if (isEventOutsideMenu(e)) {
hideMenus();
}
}
addEventListener('mousemove', hideIfNonMenuBounds);
addEventListener('touchend', hideIfNonMenuBounds);
addEventListener('mouseup', hideIfNonMenuBounds);
addEventListener('mousedown', hideIfNonMenuBounds);
addEventListener('click', hideIfNonMenuBounds);
}
function handleMobileMenuHeights() {
function setAppHeight() {
document.documentElement.style.setProperty('--app-height', window.innerHeight + 'px');
}
addEventListener('resize', function() {
setAppHeight();
});
setAppHeight();
}
function handleGotoLinks() {
// Add anchor mimicking to elements with data-goto attributes
// This addresses SEO concerns of linking to noindex pages by allowing JS to handle the URL
const anchorElements = document.querySelectorAll('*[data-goto]');
anchorElements.forEach((anchorElement) => {
anchorElement.addEventListener('mouseover', () => {
anchorElement.style.cursor = 'pointer';
anchorElement.style.textDecoration = 'underline';
});
anchorElement.addEventListener('mouseout', () => {
anchorElement.style.cursor = 'unset';
anchorElement.style.textDecoration = 'unset';
});
anchorElement.addEventListener('mouseup', (e) => {
e.preventDefault();
});
anchorElement.addEventListener('mousedown', (e) => {
e.preventDefault();
});
anchorElement.addEventListener('click', (e) => {
e.preventDefault();
const anchorHref = anchorElement.getAttribute('data-goto');
if (anchorElement.hasAttribute('data-new-window') || e.ctrlKey || e.metaKey) {
window.open(anchorHref, '_blank');
} else {
window.open(anchorHref, '_self');
}
});
});
}
</script><script>
const authenticatedBlock = document.querySelector('#authenticated-block');
const unauthenticatedBlock = document.querySelector('#unauthenticated-block');
let authenticated = {
isAuthenticated: false,
isAdmin: false,
user: {
id: null,
name: null,
url: null,
profileImage: null,
}
};
fetch('/services/internal/data/articles-getAuthenticationStatus', {
headers: {
'Accept': 'application/json'
}
})
.then(function (result) {
return result.json()
})
.then(function (result) {
const res = result.result.data
if (!res.authenticated) {
unauthenticatedBlock.classList.add('shown')
} else {
authenticated.user.id = res.id;
authenticated.user.name = res.realName;
authenticated.user.url = res.profileUrl;
authenticated.user.profileImage = res.avatar;
authenticated.user.jobTitle = res.jobTitle;
authenticated.user.companyName = res.companyName;
bindProps('#header-username', null, null, (res.firstName || res.username), null)
bindProps('#header-avatar', null, res.avatar, null, null)
bindProps('#header-user-plug', res.profileUrl, null, res.realName, null)
bindProps('#header-user-edit', '/users/' + res.id + '/edit.html', null, null, null)
bindProps('#header-dropdown-manage-email', '/newsletters/' + res.id + '/manage.html', null, null, null)
bindProps('#dropdown-view-profile', res.profileUrl, null, null, null)
bindProps('#drafts-link', '/users/' + res.id + '/drafts.html', null, null, null)
if (res.isAdmin) {
// Construct backwards so the #after call places elements in the correct order
const firstUserAction = document.querySelector('#first-user-action')
const adminConsoleItem = document.createElement('li')
const adminConsoleLink = createLink('/dzone/staff/index.html', 'Admin Console')
adminConsoleItem.appendChild(adminConsoleLink)
firstUserAction.after(adminConsoleItem)
const moderationItem = document.createElement('li')
const moderationLink = createLink('/moderation/list.html', 'Moderation')
moderationItem.appendChild(moderationLink)
firstUserAction.after(moderationItem)
const bountyModerationItem = document.createElement('li')
const bountyModerationLink = createLink('/moderation/bounties', 'Bounty Moderation')
bountyModerationItem.appendChild(bountyModerationLink)
firstUserAction.after(bountyModerationItem)
}
authenticated.isAuthenticated = res.authenticated;
authenticated.isAdmin = res.isAdmin;
authenticatedBlock.classList.add('shown')
}
}).catch(function (result) {
console.error(result)
})
/**
* Binds different properties to the selected element.
*
* @param selector - Selector to select the element
* @param href - href attribute value
* @param src - src attribute value
* @param innerHTML - innerHTML property value
* @param innerText - innerText property value
*/
function bindProps(selector, href, src, innerHTML, innerText) {
const element = document.querySelector(selector)
if (element) {
if (href) element.href = href
if (src) element.src = src
if (innerHTML) element.innerHTML = innerHTML
if (innerText) element.innerText = innerText
}
}
/**
* Creates a new link element.
*
* @param href - href attribute value
* @param innerText - innerText property value
* @returns {HTMLAnchorElement} The generated link element
*/
function createLink(href, innerText) {
const link = document.createElement('a')
link.href = href
link.innerText = innerText
return link
}
</script><script>
const userHeader = document.querySelector('#user-header')
const userDropdown = document.querySelector('#user-dropdown')
const postDropdown = document.querySelector('#post-button')
const postMenu = document.querySelector('#post-menu')
let userDropdownOpen = false
let postDropdownOpen = false
document.addEventListener('click', function(event) {
if (postDropdown && postDropdown.contains(event.target)) {
setUserDropdown(false)
setPostDropdown(!postDropdownOpen)
} else if (userHeader && userHeader.contains(event.target)) {
setPostDropdown(false)
setUserDropdown(!userDropdownOpen)
} else {
setUserDropdown(false)
setPostDropdown(false)
}
})
function setUserDropdown(value) {
userDropdownOpen = value
if (userDropdownOpen) {
if (userDropdown) {
userDropdown.classList.add('open')
}
} else {
if (userDropdown) {
userDropdown.classList.remove('open')
}
}
}
function setPostDropdown(value) {
postDropdownOpen = value
if (postDropdownOpen) {
if (postMenu) {
postMenu.classList.add('open')
}
} else {
if (postMenu) {
postMenu.classList.remove('open')
}
}
}
</script><script>
document.addEventListener("alpine:init", () => {
Alpine.store('global', {
executeHttp(path, body, method) {
const options = {
method: method,
headers: {
[csrf.header]: csrf.token
}
};
if (method !== 'GET') {
options.body = JSON.stringify(body);
options.headers = {
...options.headers,
'Content-Type': 'application/json; charset=UTF-8'
};
}
return new Promise((resolve, reject) => {
fetch(path, options)
.then(res => {
if (!res.ok) {
reject(res);
} else {
resolve(res);
}
})
.catch(err => reject(err));
});
},
getFromService(path) {
return this.executeHttp(path, null, 'GET');
},
postToService(path, body = {}) {
return this.executeHttp(path, body, 'POST');
},
putToService(path, body = {}) {
return this.executeHttp(path, body, 'PUT');
}
});
});
</script></div></div></div><div class="container announcementBarContainer" th-element="announcementBarContainer" th-element-groups="[]" ng-hide="$root.isHidden('announcementBarContainer')" data-th-element-name="announcementBarContainer"><div class="col-md-12 announcementBar1 announcementBar oUhbYlrRaqMaoUhM" th-element="announcementBar1" th-element-groups="['announcementBarContainer']" ng-hide="$root.isHidden('announcementBar1')" data-th-element-name="announcementBar1" data-th-widget="announcementBar" data-widget-announcement-bar="" ng-controller="announcementBar1">
<div id="announcement-container-outer">
<div id="announcement-previous">
<i class="icon-angle-left"></i>
</div>
<div id="announcement-next">
<i class="icon-angle-right"></i>
</div>
<div id="announcement-container">
<div class="announcement announcement-count-1"
data-position="1">
<div class="body"><p><strong>Could your team report a vulnerability within 24 hours? </strong>Find out on September 23.</p></div>
<div class="spacer"></div>
<a href="https://cvent.me/O32zXR?utm_source=Announcements&amp;utm_medium=DzoneWeb&amp;utm_campaign=QtGroup-0923" target="_blank">
<button>Assess Your CRA Readiness</button>
</a>
</div>
</div>
</div>
<script type="text/javascript" async>
(function() {
let announcementPosition = 1;
let minAnnouncementPosition = -1;
let maxAnnouncementPosition = -1;
const announcementPrevBtn = document.querySelector('#announcement-previous');
const announcementNextBtn = document.querySelector('#announcement-next');
function withAnnouncements(callback) {
const announcements = document.querySelectorAll('#announcement-container .announcement');
for (let announcement of announcements) {
callback(announcement);
}
}
function initAnnouncementVars() {
document.querySelector(':root').style.setProperty('--mobile-announcement-separator-width', '1px');
withAnnouncements(function(announcement) {
const pos = parseInt(announcement.getAttribute('data-position'));
minAnnouncementPosition = minAnnouncementPosition === -1 ? pos : Math.min(minAnnouncementPosition, pos);
maxAnnouncementPosition = maxAnnouncementPosition === -1 ? pos : Math.max(maxAnnouncementPosition, pos);
});
if (document.querySelector('.announcementBarContainer')) {
document.querySelector(':root').style.setProperty('--body-top-padding', '0');
}
if (maxAnnouncementPosition <= 0) {
document.querySelector(':root').style.setProperty('--body-top-padding', '0');
}
sizeToFullWhenOneEntryOnMobile();
}
function setAnnouncementPosition(position) {
if (window.outerWidth >= 890) {
return; // we do not need to change the position, since we can display everything on desktop.
}
// Make the announcement cyclical
if (minAnnouncementPosition !== -1 && maxAnnouncementPosition !== -1) {
if (position > maxAnnouncementPosition) {
position = minAnnouncementPosition; // overflow to the first announcement
} else if (position < minAnnouncementPosition) {
position = maxAnnouncementPosition; // underflow to the last announcement
}
announcementPosition = position;
}
const shownAnnouncements = [];
let reverseFlex = false; // should only be true when the first and last items are showing
// Now that the position is valid, apply the transforms
withAnnouncements(function(announcement) {
const pos = parseInt(announcement.getAttribute('data-position'));
const isWrapped = position === maxAnnouncementPosition && pos === minAnnouncementPosition; // showing first + last at same time
const doesNextQualify = window.outerWidth >= 500 && (pos === position + 1 || isWrapped);
if (pos === position || doesNextQualify) {
shownAnnouncements.push(announcement);
} else {
announcement.style.display = 'none';
}
announcement.style.opacity = 0.0;
if (isWrapped) {
reverseFlex = true;
}
});
for (let announcement of shownAnnouncements) {
announcement.style.display = 'flex';
announcement.style.opacity = 1.0;
}
const announcementContainer = document.querySelector('#announcement-container');
if (announcementContainer) {
announcementContainer.style.flexDirection = reverseFlex ? 'row-reverse' : 'row';
}
}
function resetAnnouncements() {
announcementPosition = 1;
const announcementContainer = document.querySelector('#announcement-container');
if (announcementContainer) {
announcementContainer.style.flexDirection = 'row';
}
withAnnouncements(function(announcement) {
announcement.style.opacity = 1.0;
announcement.style.display = 'flex';
});
}
function sizeToFullWhenOneEntryOnMobile() {
if (maxAnnouncementPosition <= 2 && announcementPrevBtn && announcementNextBtn) {
announcementPrevBtn.style.display = maxAnnouncementPosition === 2 && window.outerWidth < 500 ? 'flex' : 'none';
announcementNextBtn.style.display = maxAnnouncementPosition === 2 && window.outerWidth < 500 ? 'flex' : 'none';
}
if (maxAnnouncementPosition === 1 && window.outerWidth >= 500 && window.outerWidth < 890) {
document.querySelector(':root').style.setProperty('--mobile-announcement-separator-width', '0');
document.querySelector('#announcement-container .announcement').style.maxWidth = '100%';
}
}
function resetAnnouncementsOnResize() {
announcementPosition = 1; // we want to reset the announcement position every resize
if (window.outerWidth >= 890) { // 4 announcements can be shown (215px * 4) + separator padding
resetAnnouncements();
} else { // if we're still on mobile, set the position to normalize things after resize
setAnnouncementPosition(announcementPosition);
sizeToFullWhenOneEntryOnMobile();
}
}
window.addEventListener('resize', resetAnnouncementsOnResize);
initAnnouncementVars();
setAnnouncementPosition(announcementPosition); // sets the min & max positions as well as initializes transforms
if (announcementPrevBtn) {
announcementPrevBtn.onclick = function() {
setAnnouncementPosition(announcementPosition - 1);
};
}
if (announcementNextBtn) {
announcementNextBtn.onclick = function() {
setAnnouncementPosition(announcementPosition + 1);
};
}
})(); </script>
</div></div><div class="container-fluid body" th-element="body" th-element-groups="[]" ng-hide="$root.isHidden('body')" data-th-element-name="body"><div class="row mainContentRow" th-element="mainContentRow" th-element-groups="['body']" ng-hide="$root.isHidden('mainContentRow')" data-th-element-name="mainContentRow"><div class="col-md-12 refcardzTopHeaderV34 layout-card refcardzTopHeaderV3 oUhbfSbmcnWOfYfWVcC" th-element="refcardzTopHeaderV34" th-element-groups="['body','mainContentRow']" ng-hide="$root.isHidden('refcardzTopHeaderV34')" data-th-element-name="refcardzTopHeaderV34" data-th-widget="refcardz.topHeaderV3" data-widget-refcardz-top-header-v3="" ng-controller="refcardzTopHeaderV34">
<div class="refcardz-header">
<script type="text/ng-template" id="asset-save.html">
<button type="button"
class="btn btn-save btn-lg "
ng-class="{'icon-star gold': status.saved, 'icon-star-empty': !status.saved}"
ng-click="save()">
<span class="save-title">{{ status.saved ? 'saved' : 'save' }}</span>
</button>
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "DZone",
"item": "https://dzone.com"
},
{
"@type": "ListItem",
"position": 2,
"name": "Refcards",
"item": "https://dzone.com/refcardz"
},
{
"@type": "ListItem",
"position": 3,
"name": "Scalability and High Availability",
"item": "https://dzone.com/refcardz/scalability"
}
]
}
</script>
<div class="row asset-details no-mobile">
<div class="header-background col-xs-12" style="background: url('https://dz2cdn1.dzone.com/storage/rc-covers/7864743-refcard-header43.png') no-repeat center center; background-size: cover;">
<div class="breadcrumb-container row">
<div class="col-xs-12">
<ol class="breadcrumb">
<li class="server"><a href="https://dzone.com">DZone</a></li>
<li class="server"><a href="https://dzone.com/refcardz">Refcards</a></li>
<li class="active server">Scalability and High Availability</li>
</ol>
</div>
</div>
<div class="row">
<div class="cog-area">
</div>
<div class="mobile-image col-xs-12">
<img class="cover" src="https://dz2cdn1.dzone.com/storage/rc-covers/5747748-refcard-cover43.jpg" alt="refcard cover">
</div>
</div>
<div class="row info-zone">
<div class="col-xs-12 col-sm-8">
<span class="asset-number">Refcard #043</span>
<h1 class="asset-title">Scalability and High Availability</h1>
</div>
</div>
</div>
<div class="header-info-container col-xs-12">
<div class="row info-zone">
<div class="asset-sub-details col-xs-12 col-sm-8">
<h2 class="subtitle">Performing Well at Any Scale</h2>
<p class="asset-description">Provides the tools to define Scalability and High Availability, so your team can implement critical systems with well-understood performance goals.</p>
<div class="button-container">
<div class="download-save">
<div class="asset-buttons no-campaign">
<dz-download asset="'/asset/download/169039'" user="false" cta="'Refcard'"></dz-download>
<div class="download-label">Free PDF for Easy Reference</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-4 asset-authors-zone">
<a type="button" class="cover-download" ng-click="$root.user.authenticated ? showDownload() : showRegistration()">
<img class="cover" src="https://dz2cdn1.dzone.com/storage/rc-covers/5747748-refcard-cover43.jpg" alt="refcard cover">
</a>
<div class="row">
<div class="col-xs-12 asset-authors">
<div class="col-xs-12 writing-by">
<p>Written By</p>
</div>
<div class="col-xs-12 asset-authors">
<div class="asset-author">
<a class="asset-author-avatar" href="/users/2915751/mrasband.html">
<img src="https://dz2cdn1.dzone.com/storage/user-avatar/5723604-thumb.jpg" alt="author avatar" class="avatar" width="40">
</a>
<span class="asset-author-info">
<a href="/users/2915751/mrasband.html" class="asset-author-name" th-popup="users.profile.mini" popup-data="{user: 2915751}" data-core-user="false">
Matt Rasband
</a>
<div>Senior Software Engineer, </div>
</span>
</div>
<div class="asset-author">
<a class="asset-author-avatar" href="/users/281543/ciurana.html">
<img src="https://secure.gravatar.com/avatar/89a88ae47bd15341520996482c8e321c?d=identicon&r=PG" alt="author avatar" class="avatar" width="40">
</a>
<span class="asset-author-info">
<a href="/users/281543/ciurana.html" class="asset-author-name" th-popup="users.profile.mini" popup-data="{user: 281543}" data-core-user="false">
Eugene Ciurana
</a>
<div>Chief Architect, CIME Software Labs</div>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 separator"></div>
</div>
</div>
</div></div><div class="col-md-12 assetsContentChapters5 layout-card assetsContentChapters oUhbcgvMlhqMSsfboUhM" th-element="assetsContentChapters5" th-element-groups="['body','mainContentRow']" ng-hide="$root.isHidden('assetsContentChapters5')" data-th-element-name="assetsContentChapters5" data-th-widget="assets.content.chapters" data-widget-assets-content-chapters="" ng-controller="assetsContentChapters5"><div class="refcard-details row">
<div class="refcard-content row">
<div class="col-xs-12">
<div id="table-contents">
<div class="tc-title">
<span class="tc-blue">Table of Contents</span>
<span class="tc-separator"></span>
</div>
<div class="chapter-index">
<a class="tc-chapter-title" ng-click="scrollTo($event, '#section-1')" href="#section-1">
<span aria-hidden="true">&#9658;</span>
Overview
</a>
<a class="tc-chapter-title" ng-click="scrollTo($event, '#section-2')" href="#section-2">
<span aria-hidden="true">&#9658;</span>
Implementing Scalable Systems
</a>
<a class="tc-chapter-title" ng-click="scrollTo($event, '#section-3')" href="#section-3">
<span aria-hidden="true">&#9658;</span>
Caching Strategies
</a>
<a class="tc-chapter-title" ng-click="scrollTo($event, '#section-4')" href="#section-4">
<span aria-hidden="true">&#9658;</span>
Clustering
</a>
<a class="tc-chapter-title" ng-click="scrollTo($event, '#section-5')" href="#section-5">
<span aria-hidden="true">&#9658;</span>
Redundancy and Fault Tolerance
</a>
<a class="tc-chapter-title" ng-click="scrollTo($event, '#section-6')" href="#section-6">
<span aria-hidden="true">&#9658;</span>
System Performance
</a>
</div>
</div>
<div class="content">
<div id="section-1" class="chapter-box tc-blue">Section 1</div>
<h2 class="chapter-title">Overview</h2>
<div class="content-html" dz-code-container ng-non-bindable>
<h3>Scalability, High Availability, and Performance</h3><p pid="3">The terms scalability, high availability, performance, and mission-critical can mean different things to different organizations, or to different departments within an organization. They are often interchanged and create confusion that results in poorly managed expectations, implementation delays, or unrealistic metrics. This Refcard provides you with the tools to define these terms so that your team can implement mission-critical systems with well understood performance goals.</p><h3>Scalability</h3><p pid="4">It's the property of a system or application to handle bigger amounts of work, or to be easily expanded, in response to increased demand for network, processing, database access or file system resources.</p><h4 pid="5"><strong>Horizontal scalability</strong></h4><p pid="5">A system scales horizontally, or out, when it's expanded by adding new nodes with identical functionality to existing ones, redistributing the load among all of them. SOA systems and web servers scale out by adding more servers to a load-balanced network so that incoming requests may be distributed among all of them. Cluster is a common term for describing a scaled out processing system.</p><p pid="6"><img alt="Clustering" class="fr-fil fr-dib" src="/storage/temp/5747694-picture1.png"></p><p pid="7"><small><strong>Figure 1:&nbsp;</strong>Clustering</small></p><h4 pid="8"><strong>Vertical scalability</strong></h4><p pid="8">A system scales vertically, or up, when it's expanded by adding processing, main memory, storage, or network interfaces to a node to satisfy more requests per system. Hosting services companies scale up by increasing the number of processors or the amount of main memory to host more virtual servers in the same hardware.</p><p pid="10"><img alt="Virtualization" class="fr-fil fr-dib" src="/storage/temp/5747695-picture2.png"></p><p pid="11"><small><strong>Figure 2:</strong>Virtualization</small></p><h3>High Availability</h3><p pid="12">Availability describes how well a system provides useful resources over a set period of time. High availability guarantees an absolute degree of functional continuity within a time window expressed as the relationship between uptime and downtime.</p><p pid="13">A = 100 – (100*D/U), D ::= unplanned downtime, U ::= uptime; D, U expressed in minutes</p><p pid="14">Uptime and availability don't mean the same thing. A system may be up for a complete measuring period, but may be unavailable due to network outages or downtime in related support systems. Downtime and unavailability are synonymous.</p><h4 pid="15"><strong>Measuring Availability</strong></h4><p pid="15">Vendors define availability as a given number of "nines" like in Table 1, which also describes the number of minutes or seconds of estimated downtime in relation to the number of minutes in a 365-day year, or 525,600, making U a constant for their marketing purposes.</p><table cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="dark_blue"><strong>Availability %</strong></td>
<td class="dark_cream"><strong>Downtime in Minutes</strong></td>
<td class="dark_blue"><strong>Downtime per Year</strong></td>
<td class="dark_cream"><strong>Vendor Jargon</strong></td>
</tr>
<tr>
<td class="light_blue">90</td>
<td class="light_cream">52,560.00</td>
<td class="light_blue">36.5 days</td>
<td class="light_cream">one nine</td>
</tr>
<tr>
<td class="light_blue">99</td>
<td class="light_cream">5,256.00</td>
<td class="light_blue">4 days</td>
<td class="light_cream">two nines</td>
</tr>
<tr>
<td class="light_blue">99.9</td>
<td class="light_cream">525.60</td>
<td class="light_blue">8.8 hours</td>
<td class="light_cream">three nines</td>
</tr>
<tr>
<td class="light_blue">99.99</td>
<td class="light_cream">52.56</td>
<td class="light_blue">53 minutes</td>
<td class="light_cream">four nines</td>
</tr>
<tr>
<td class="light_blue">99.999</td>
<td class="light_cream">5.26</td>
<td class="light_blue">5.3 minutes</td>
<td class="light_cream">five nines</td>
</tr>
<tr>
<td class="light_blue">99.9999</td>
<td class="light_cream">0.53</td>
<td class="light_blue">32 seconds</td>
<td class="light_cream">six nines</td>
</tr>
</tbody>
</table><p pid="16"><small><strong>Table 1:&nbsp;</strong>Availability as a Percentage of Total Yearly Uptime</small></p><h4 pid="17"><strong>Analysis</strong></h4><p pid="17">High availability depends on the expected uptime defined for system requirements; don't be misled by vendor figures. The meaning of having a highly available system and its measurable uptime are a direct function of a Service Level Agreement. Availability goes up when factoring planned downtime, such as a monthly 8-hour maintenance window. The cost of each additional nine of availability can grow exponentially. Availability is a function of scaling the systems up or out and implementing system, network, and storage redundancy.</p><h3>Service Level Agreement (SLA)</h3><p pid="18">SLAs are the negotiated terms that outline the obligations of the two parties involved in delivering and using a system, like:</p><ul>
<li>System type (virtual or dedicated servers, shared hosting)</li>
<li>Levels of availability
<ul>
<li>Minimum</li>
<li>Target</li>
</ul></li>
<li>Uptime
<ul>
<li>Network</li>
<li>Power</li>
<li>Maintenance windows</li>
</ul></li>
<li>Serviceability</li>
<li>Performance and Metrics</li>
<li>Billing</li>
</ul><p pid="19">SLAs can bind obligations between two internal organizations (e.g. the IT and e-commerce departments), or between the organization and an outsourced services provider. The SLA establishes the metrics for evaluating the system performance, and provides the definitions for availability and the scalability targets. It makes no sense to talk about any of these topics unless an SLA is being drawn or one already exists.</p><h3 pid="77"><strong>Elasticity</strong></h3><p pid="78">Elasticity is the ability to dynamically add and remove resources in a system in response to demand, and is a specialized implementation of scaling horizontally or vertically.</p><p pid="79">As requests increase during a busy period, more nodes can be automatically added to a cluster to scale out and removed when the demand has faded – similar to seasonal hiring at brick and mortar retailers. Additionally, system resources can be re-allocated to better support a system for scaling up dynamically.</p>
</div>
</div>
<div class="content">
<div id="section-2" class="chapter-box tc-blue">Section 2</div>
<h2 class="chapter-title">Implementing Scalable Systems</h2>
<div class="content-html" dz-code-container ng-non-bindable>
<p pid="20">SLAs determine whether systems must scale up or out. They also drive the growth timeline. A stock trading system must scale in real-time within minimum and maximum availability levels. An e-commerce system, in contrast, may scale in during the "slow" months of the year, and scale out during the retail holiday season to satisfy much larger demand.</p><h3>Load Balancing</h3><p pid="21">Load balancing is a technique for minimizing response time and maximizing throughput by spreading requests among two or more resources. Load balancers may be implemented in dedicated hardware devices, or in software. Figure 3 shows how load-balanced systems appear to the resource consumers as a single resource exposed through a well-known address. The load balancer is responsible for routing requests to available systems based on a scheduling rule.</p><p pid="22"><img alt="Load Balancer" class="fr-fil fr-dib" src="/storage/temp/5747708-picture3.png"></p><p pid="23"><small><strong>Figure 3:</strong> Availability as percentage of Total Yearly Uptime</small></p><p pid="80">Scheduling rules are algorithms for determining which server must service a request. Web applications and services are typically balanced by following round robin scheduling rules, but can also balance based on least-connected, IP-hash, or a number of other options. Caching pools are balanced by applying frequency rules and expiration algorithms. Applications where stateless requests arrive with a uniform probability for any number of servers may use a pseudo-random scheduler. Applications like music stores, where some content is statistically more popular, may use asymmetric load balancers to shift the larger number popular requests to higher performance systems, serving the rest of the requests from less powerful systems or clusters.</p><h4 pid="25"><strong>Persistent Load Balancers</strong></h4><p pid="25">Stateful applications require persistent or sticky load balancing, where a consumer is guaranteed to maintain a session with a specific server from the pool. Figure 4 shows a sticky balancer that maintains sessions from multiple clients. Figure 5 shows how the cluster maintains sessions by sharing data using a database.</p><p pid="26"><img alt="Sticky Load Balancer" class="fr-fil fr-dib" src="/storage/temp/5747709-picture4.png"></p><p pid="27"><small><strong>Figure 4:&nbsp;</strong>Sticky Load Balancer</small></p><h4 pid="28"><strong>Common Features of a Load Balancer</strong></h4><p pid="28">Asymmetric load distribution – assigns some servers to handle a bigger load than others</p><ul>
<li>Content filtering: Inbound or outbound.</li>
<li>Distributed Denial of Services (DDoS) attack protection</li>
<li>Firewall.</li>
<li>Payload switching: Sends requests to different servers based on URI, port, and/or protocol.</li>
<li>Priority activation: Adds standing by servers to the pool.</li>
<li>Rate shaping: Ability to give different priority to different traffic.</li>
<li>Scripting: Reduces human interaction by implementing programming rules or actions.</li>
<li>SSL termination: Hardware-assisted encryption frees web server resources.</li>
<li>TCP buffering and offloading: Throttle requests to servers in the pool.</li>
<li>GZIP compression: Decreases transfer bandwidth utilization.</li>
</ul><p pid="29"><img alt="DatabaseSessions" class="fr-fil fr-dib" src="/storage/temp/5747710-picture5.png"></p><p pid="30"><small><strong>Figure 5:</strong> Database Sessions</small></p>
</div>
</div>
<div class="content">
<div id="section-3" class="chapter-box tc-blue">Section 3</div>
<h2 class="chapter-title">Caching Strategies</h2>
<div class="content-html" dz-code-container ng-non-bindable>
<p pid="31">Stateful load balancing techniques require data sharing among the service providers. Caching is a technique for sharing data among multiple consumers or servers that are expensive to either compute or fetch. Data are stored and retrieved in a subsystem that provides quick access to a copy of the frequently accessed data.</p><p pid="32">Caches are implemented as an indexed table where a unique key is used for referencing some datum. Consumers access data by checking (hitting) the cache first and retrieving the datum from it. If it's not there (cache miss), then the costlier retrieval operation takes place and the consumer or a subsystem inserts the datum to the cache.</p><h3>Write Policy</h3><p pid="33">The cache may become stale if the backing store changes without updating the cache. A write policy for the cache defines how cached data are refreshed. Some common write policies include:</p><ul>
<li>Write-through: Every write to the cache follows a synchronous write to the backing store.</li>
<li>Write-behind: Updated entries are marked in the cache table as dirty and it's updated only when a dirty datum is requested.</li>
<li>No-write allocation: Only read requests are cached under the assumption that the data won't change over time but it's expensive to retrieve.</li>
</ul><h3>Application Caching</h3><ul>
<li>Implicit caching happens when there is little or no programmer participation in implementing the caching. The program executes queries and updates using its native API and the caching layer automatically caches the requests independently of the application. Example: Terracotta (<a href="https://www.terracotta.org/">https://www.terracotta.org/</a>).</li>
<li>Explicit caching happens when the programmer participates in implementing the caching API and may also implement the caching policies. The program must import the caching API into its flow in order to use it. Examples: memcached (<a href="http://www.danga.com/memcached">http://www.danga.com/memcached</a>), Redis (<a href="https://redis.io">https://redis.io</a>), and Oracle Coherence (<a href="http://coherence.oracle.com">http://coherence.oracle.com</a>).</li>
</ul><p pid="81">In general, implicit caching systems are specific to a platform or language. Terracotta, for example, only works with Java and JVM-hosted languages like Groovy or Kotlin. Explicit caching systems may be used with many programming languages and across multiple platforms at the same time. Memcached and Redis work with every major programming language, and Coherence works with Java, .Net, and native C++ applications.</p><h3>Web Caching</h3><p pid="35">Web caching is used for storing documents or portions of documents (‘particles') to reduce server load, bandwidth usage and lag for web applications. Web caching can exist on the browser (user cache) or on the server, the topic of this section. Web caches are invisible to the client may be classified in any of these categories:</p><ul>
<li><strong>Web accelerators:</strong> they operate on behalf of the server of origin. Used for expediting access to heavy resources, like media files, and are often geolocated closer to intended recipients. Content distribution networks (CDNs) are an example of web acceleration caches; Akamai, Amazon S3, Nirvanix are examples of this technology.</li>
<li><strong>Proxy caches:</strong> they serve requests to a group of clients that may all have access to the same resources. They can be used for content filtering and for reducing bandwidth usage. Squid, Apache, Amazon Cloud Front, ISA server are examples of this technology.</li>
</ul><h3>Distributed Caching</h3><p pid="82">Caching techniques can be implemented across multiple systems that serve requests for multiple consumers and from multiple resources. These are known as distributed caches, like the setup in Figure 6. Akamai is an example of a distributed web cache, and memcached is an example of a distributed application cache.</p><p pid="37"><img alt="Distributed Cache" class="fr-fil fr-dib" src="/storage/temp/5747711-picture6.png"></p><p pid="38"><strong>Figure 6:&nbsp;</strong>Distributed Cache</p>
</div>
</div>
<div class="content">
<div id="section-4" class="chapter-box tc-blue">Section 4</div>
<h2 class="chapter-title">Clustering</h2>
<div class="content-html" dz-code-container ng-non-bindable>
<p pid="83">A cluster is a group of computer systems that work together to form what appears to the user as a single system. Clusters are deployed to improve services availability or to increase computational or data manipulation performance. In terms of equivalent computing power, a cluster is more cost-effective than a monolithic system with the same performance characteristics.</p><p pid="40">The systems in a cluster are interconnected over high-speed local area networks like gigabit Ethernet, fiber distributed data interface (FDDI), Infiniband, Myrinet, or other technologies.</p><p pid="41"><img alt="Load Balancing Cluster" class="fr-fil fr-dib" src="/storage/temp/5747712-picture7.png"></p><p pid="42">Figure 7: Load Balancing Cluster</p><p pid="84"><strong>Load-balancing cluster (active/active)</strong>: Distribute the load among multiple back-end, redundant nodes. All nodes in the cluster offer full-service capabilities to the consumers and are active at the same time.</p><p pid="85"><strong>High availability cluster (active/passive)</strong>: Improve services availability by providing uninterrupted service through redundant clusters that eliminate single points of failure. High availability clusters require two nodes at a minimum, a "heartbeat" to detect that all nodes are ready, and a routing mechanism that will automatically switch traffic, or fail over, if the main cluster fails.</p><p pid="44"><img alt="Load Balancing Cluster" class="fr-fil fr-dib" src="/storage/temp/5747713-picture8.png"></p><p pid="45"><strong>Figure 8:</strong> Cluster Failover</p><p pid="49"><strong>Grid:</strong> Process workloads defined as independent jobs that don't require data sharing among processes. Storage or network may be shared across all nodes of the grid, but intermediate results have no bearing on other jobs progress or on other nodes in the grid, such as a Cloudera Map Reduce cluster (<a href="https://www.cloudera.com">http://www.cloudera.com</a>).</p><p pid="50"><img alt="Figure 11" class="fr-fin fr-dib" src="/storage/temp/5747720-picture9.png"></p><p pid="51"><strong>Figure 9:</strong> Computational Clusters</p><p pid="86"><strong>Computational clusters</strong>: Execute processes that require raw computational power instead of executing transactional operations like web or database clusters. The nodes are tightly coupled, homogeneous, and in close physical proximity. They often replace supercomputers.</p>
</div>
</div>
<div class="content">
<div id="section-5" class="chapter-box tc-blue">Section 5</div>
<h2 class="chapter-title">Redundancy and Fault Tolerance</h2>
<div class="content-html" dz-code-container ng-non-bindable>
<p pid="53">Redundant system design depends on the expectation that any system component failure is independent of failure in the other components.</p><p pid="87">Fault tolerant systems continue to operate in the event of component or subsystem failure; throughput may decrease but overall system availability remains constant. Faults in hardware or software are handled through component redundancy or safe fallbacks, if one can be made in software. Fault tolerance in software is often implemented as a fallback method if a dependent system is unavailable. Fault tolerance requirements are derived from SLAs. The implementation depends on the hardware and software components, and on the rules by which they interact.</p><h3>Fault Tolerance SLA Requirements</h3><ul>
<li><strong>No single point of failure</strong>: Redundant components ensure continuous operation and allow repairs without disruption of service.</li>
<li><strong>Fault isolation</strong>: Problem detection must pinpoint the specific faulty component</li>
<li><strong>Fault propagation containment</strong>: Faults in one component must not cascade to others.</li>
<li><strong>Reversion mode</strong>: Set the system back to a known state.</li>
</ul><p pid="88">Redundant clustered systems can provide higher availability, better throughput, and fault tolerance. The A/A cluster in Figure 10 provides uninterrupted service for a scalable, stateless application.</p><p pid="56"><img alt="Figure 12" class="fr-fin fr-dib" height="177" src="/storage/rc-covers/14943-thumb.png" width="748"></p><p pid="89"><strong>Figure 10: </strong>A/A full tolerance and recovery</p><p pid="90">Some stateful applications may only scale up; the A/P cluster in Figure 11 provides uninterrupted service and disaster recovery for such an application. Active/Active configurations provide failure transparency. Active/Passive configurations may provide failure transparency at a much higher cost because automatic failure detection and reconfiguration are implemented through a feedback control system, which is more expensive and trickier to implement.</p><p pid="59"><img alt="Figure13" class="fr-fin fr-dib" src="/storage/rc-covers/14944-thumb.png" width="583"></p><p pid="91"><strong>Figure 11: </strong>A/P fault tolerance and recovery</p><p pid="92">Enterprise systems most commonly implement A/P fault tolerance and recovery through fault transparency by diverting services to the passive system and bringing it on-line as soon as possible. Robotics and life-critical systems may implement probabilistic, linear model, fault hiding, and optimization control systems instead.</p><h3 pid="93"><strong>Multi-Region</strong></h3><p pid="94">Redundant systems often span multiple regions in order to isolate geographic phenomenon, provide failover capabilities, and deliver content as close to the consumer as possible. These redundancies cascade down through the system into all services, and a single scalable system may have a number of load balanced clusters throughout.</p><h3>Cloud Computing</h3><p pid="62">Cloud computing describes applications running on distributed, computing resources owned and operated by a third-party.</p><p pid="63">End-user apps are the most common examples. They utilize the Software as a Service (SaaS) and Platform as a Service (PaaS) computing models.</p><p pid="64"><img alt="Figure 14" class="fr-fin fr-dib" src="/storage/rc-covers/14945-thumb.png" width="612"></p><p pid="65"><strong>Figure 12: </strong>Cloud computing configuration</p><h3 pid="96"><strong>Cloud Services Types</strong></h3><ul>
<li><strong>Web services</strong>: Salesforce com, USPS, Google Maps.</li>
<li><strong>Service platforms</strong>: Google App Engine, Amazon Web Services (EC2, S3, Cloud Front), Nirvanix, Akamai, MuleSource.</li>
</ul><h3 pid="97"><strong>Fault Detection Methods</strong></h3><p pid="98">Fault detection methods must provide enough information to isolate the fault and execute automatic or assisted failover action. Some of the most common fault detection methods include:</p><ul>
<li>Built-in diagnostics.</li>
<li>Protocol sniffers.</li>
<li>Sanity checks.</li>
<li>Watchdog checks.</li>
</ul><p pid="67">Criticality is defined as the number of consecutive faults reported by two or more detection mechanisms over a fixed time period. A fault detection mechanism is useless if it reports every single glitch (noise) or if it fails to report a real fault over a number of monitoring periods.</p>
</div>
</div>
<div class="content">
<div id="section-6" class="chapter-box tc-blue">Section 6</div>
<h2 class="chapter-title">System Performance</h2>
<div class="content-html" dz-code-container ng-non-bindable>
<p pid="99">Performance refers to the system throughput and latency under a particular workload for a defined period of time. Performance testing validates implementation decisions about the system throughput, scalability, reliability, and resource usage. Performance engineers work with the development and deployment teams to ensure that the system's non-functional requirements like SLAs are implemented as part of the system development lifecycle. System performance encompasses hardware, software, and networking optimizations.</p><p pid="100"><strong>Tip</strong>: Performance testing efforts must begin at the same time as the development project and continue through deployment. Testing should be performed against a mirror of the production environment, if possible.</p><p pid="102">The performance engineer's objective is to detect bottlenecks early and to collaborate with the development and deployment teams on eliminating them.</p><h3 pid="103"><strong>System Performance Tests</strong></h3><p pid="104">Performance specifications are documented along with the SLA and with the system design. Performance troubleshooting includes these types of testing:</p><ul>
<li><strong>Endurance testing</strong>: Identifies resource leaks under the continuous, expected load.</li>
<li><strong>Load testing</strong>: Determines the system behavior under a specific load.</li>
<li><strong>Spike testing</strong>: Shows how the system operates in response to dramatic changes in load.</li>
<li><strong>Stress testing</strong>: Identifies the breaking point for the application under dramatic load changes for extended periods of time.</li>
</ul><h3 pid="105"><strong>Software Testing Tools</strong></h3><p pid="106">There are many software performance testing tools in the market. Some of the best are released as open-source software. A comprehensive list of those is available from DZone.</p><p pid="107">These include Java, native, PHP, .Net, and other languages and platforms.</p>
</div>
</div>
<div class="row">
<div class="related col-xs-12">
<h3>Like This Refcard? Read More From DZone</h3>
<div class="relateddiv">
<div class="related-container">
<a href="/articles/data-observability-doesnt-just-create-savings-it-d?fromrel=true">
<img class="relatedimg"
src="https://dz2cdn1.dzone.com/thumbnail?fid=15780921&w=120"
loading="lazy"
alt="related article thumbnail"
width="60">
</a>
<a href="/articles/data-observability-doesnt-just-create-savings-it-d?fromrel=true" class="relatedres-text">
<p class="relatedres">DZone Article</p>
<div>Data Observability Doesn't Just Create Savings — It Drives Revenue, Too</div>
</a>
</div>
<div class="related-container">
<a href="/articles/monitor-kubernetes-events-with-falco-for-free?fromrel=true">
<img class="relatedimg"
src="https://dz2cdn1.dzone.com/thumbnail?fid=15770317&w=120"
loading="lazy"
alt="related article thumbnail"
width="60">
</a>
<a href="/articles/monitor-kubernetes-events-with-falco-for-free?fromrel=true" class="relatedres-text">
<p class="relatedres">DZone Article</p>
<div>Monitor Kubernetes Events With Falco For Free</div>
</a>
</div>
<div class="related-container">
<a href="/articles/sre-vs-platform-engineering-the-key-differences-ex?fromrel=true">
<img class="relatedimg"
src="https://dz2cdn1.dzone.com/thumbnail?fid=15770054&w=120"
loading="lazy"
alt="related article thumbnail"
width="60">
</a>
<a href="/articles/sre-vs-platform-engineering-the-key-differences-ex?fromrel=true" class="relatedres-text">
<p class="relatedres">DZone Article</p>
<div>SRE vs. Platform Engineering: The Key Differences, Explained</div>
</a>
</div>
<div class="related-container">
<a href="/articles/why-a-site-reliability-engineer-is-important-to-yo?fromrel=true">
<img class="relatedimg"
src="https://dz2cdn1.dzone.com/thumbnail?fid=15764017&w=120"
loading="lazy"
alt="related article thumbnail"
width="60">
</a>
<a href="/articles/why-a-site-reliability-engineer-is-important-to-yo?fromrel=true" class="relatedres-text">
<p class="relatedres">DZone Article</p>
<div>Why a Site Reliability Engineer Is Important to Your CI/CD Pipeline</div>
</a>
</div>
<div class="related-container">
<a href="/refcardz/full-stack-observability-essentials?fromrel=true">
<img class="relatedimg"
src="https://dz2cdn1.dzone.com/thumbnail?fid=16058286&w=120"
loading="lazy"
alt="related refcard thumbnail"
width="60">
</a>
<a href="/refcardz/full-stack-observability-essentials?fromrel=true" class="relatedres-text">
<p class="relatedres">Free DZone Refcard</p>
<div>Full-Stack Observability Essentials</div>
</a>
</div>
<div class="related-container">
<a href="/refcardz/log-management?fromrel=true">
<img class="relatedimg"
src="https://dz2cdn1.dzone.com/thumbnail?fid=15919639&w=120"
loading="lazy"
alt="related refcard thumbnail"
width="60">
</a>
<a href="/refcardz/log-management?fromrel=true" class="relatedres-text">
<p class="relatedres">Free DZone Refcard</p>
<div>Getting Started With Log Management</div>
</a>
</div>
<div class="related-container">
<a href="/refcardz/observability-maturity-model?fromrel=true">
<img class="relatedimg"
src="https://dz2cdn1.dzone.com/thumbnail?fid=16195234&w=120"
loading="lazy"
alt="related refcard thumbnail"
width="60">
</a>
<a href="/refcardz/observability-maturity-model?fromrel=true" class="relatedres-text">
<p class="relatedres">Free DZone Refcard</p>
<div>Observability Maturity Model</div>
</a>
</div>
<div class="related-container">
<a href="/refcardz/getting-started-with-opentelemetry?fromrel=true">
<img class="relatedimg"
src="https://dz2cdn1.dzone.com/thumbnail?fid=16142534&w=120"
loading="lazy"
alt="related refcard thumbnail"
width="60">
</a>
<a href="/refcardz/getting-started-with-opentelemetry?fromrel=true" class="relatedres-text">
<p class="relatedres">Free DZone Refcard</p>
<div>Getting Started With OpenTelemetry</div>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></div></div><div class="container-fluid footerOuter" th-element="footerOuter" th-element-groups="[]" ng-hide="$root.isHidden('footerOuter')" data-th-element-name="footerOuter"><div class="row row2" th-element="row2" th-element-groups="['footerOuter']" ng-hide="$root.isHidden('row2')" data-th-element-name="row2"><div class="col-md-12 container3" th-element="container3" th-element-groups="['footerOuter','row2']" ng-hide="$root.isHidden('container3')" data-th-element-name="container3"><div class="container container3" th-element="container3" th-element-groups="['footerOuter','row2','container3']" ng-hide="$root.isHidden('container3')" data-th-element-name="container3"><div class="row footer" th-element="footer" th-element-groups="['footerOuter','row2','container3','container3']" ng-hide="$root.isHidden('footer')" data-th-element-name="footer"><div class="col-md-12 footerFooterV26 footerFooterV2 oUhbdrfPmhwBdrfXM" th-element="footerFooterV26" th-element-groups="['footerOuter','row2','container3','container3','footer']" ng-hide="$root.isHidden('footerFooterV26')" data-th-element-name="footerFooterV26" data-th-widget="footer.footerV2" data-widget-footer-footer-v2="" ng-controller="footerFooterV26"><div class="row footerContainer" >
<div class="left col-xs-12 col-sm-7">
<div class="col-xs-12 social-media-icons footer-mobile">
<ul class="icons-only">
<li class="rss-icon" id="rss-footer-1">
<a href="/pages/feeds" target="_blank" rel="noreferrer noopener">
<svg role="img" viewBox="0 0 24 24" class="w-4 h-4 mt-1.75 fill-current" aria-label="Follow our RSS feeds">
<title>RSS</title>
<path d="M19.199 24C19.199 13.467 10.533 4.8 0 4.8V0c13.165 0 24 10.835 24 24h-4.801zM3.291 17.415c1.814 0 3.293 1.479 3.293 3.295 0 1.813-1.485 3.29-3.301 3.29C1.47 24 0 22.526 0 20.71s1.475-3.294 3.291-3.295zM15.909 24h-4.665c0-6.169-5.075-11.245-11.244-11.245V8.09c8.727 0 15.909 7.184 15.909 15.91z"></path>
</svg>
</a>
</li>
<li class="twitter-icon">
<a href="https://twitter.com/DZoneInc" target="_blank" rel="noreferrer noopener">
<svg role="img" viewBox="0 0 24 24" aria-label="Follow us on X">
<title>X</title>
<path d="M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"></path>
</svg>
</a>
</li>
<li class="facebook-icon">
<a href="https://www.facebook.com/DZoneInc" target="_blank" rel="noreferrer noopener">
<svg role="img" viewBox="0 0 24 24" aria-label="Follow us on Facebook">
<title>Facebook</title>
<path d="M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"></path>
</svg>
</a>
</li>
<li class="linkedin-icon">
<a href="https://www.linkedin.com/company/dzone/" target="_blank" rel="noreferrer noopener">
<svg viewBox="0 0 24 25" fill="none" aria-label="Follow us on LinkedIn">
<path d="M6.20062 21.2143H1.84688V7.194H6.20062V21.2143ZM4.02141 5.2815C2.62922 5.2815 1.5 4.12838 1.5 2.73619C1.5 2.06747 1.76565 1.42614 2.2385 0.953285C2.71136 0.48043 3.35269 0.214783 4.02141 0.214783C4.69012 0.214783 5.33145 0.48043 5.80431 0.953285C6.27716 1.42614 6.54281 2.06747 6.54281 2.73619C6.54281 4.12838 5.413 5.2815 4.02141 5.2815ZM22.4953 21.2143H18.1509V14.3893C18.1509 12.7628 18.1181 10.6768 15.8873 10.6768C13.6237 10.6768 13.2769 12.444 13.2769 14.2721V21.2143H8.92781V7.194H13.1034V9.1065H13.1644C13.7456 8.00494 15.1655 6.84244 17.2838 6.84244C21.69 6.84244 22.5 9.744 22.5 13.5128V21.2143H22.4953Z" fill="currentColor"></path>
</svg>
</a>
</li>
</ul>
</div>
<div class="top-section col-xs-12">
<div class="col-xs-12 col-sm-6">
<p class="section-header">ABOUT US</p>
<ul class="link-group">
<li><a href="/pages/about" rel="noreferrer noopener">About DZone</a></li>
<li><a href="/cdn-cgi/l/email-protection#4b383e3b3b24393f0b2f3124252e65282426" rel="noreferrer noopener">Support and feedback</a></li>
<li><a href="/pages/dzone-community-research">Community research</a></li>
</ul>
</div>
<div class="col-xs-12 col-sm-6">
<p class="section-header">ADVERTISE</p>
<ul class="link-group">
<li><a href="https://advertise.dzone.com" target="_blank" rel="noreferrer noopener">Advertise with DZone</a></li>
</ul>
</div>
</div>
<div class="bottom-section col-xs-12">
<div class="col-xs-12 col-sm-6">
<p class="section-header">CONTRIBUTE ON DZONE</p>
<ul class="bottom-top-list link-group">
<li><a href="/articles/dzones-article-submission-guidelines">Article Submission Guidelines</a></li>
<li><a href="/pages/contribute" rel="noreferrer noopener">Become a Contributor</a></li>
<li><a href="/pages/core" rel="noreferrer noopener">Core Program</a></li>
<li><a href="/writers-zone" rel="noreferrer noopener">Visit the Writers' Zone</a></li>
</ul>
<p class="section-header">LEGAL</p>
<ul class="link-group">
<li><a href="https://technologyadvice.com/terms-conditions/" target="_blank" rel="noreferrer noopener">Terms of Service</a></li>
<li><a href="https://technologyadvice.com/privacy-policy/" target="_blank" rel="noreferrer noopener">Privacy Policy</a></li>
</ul>
</div>
<div class="col-xs-12 col-sm-6">
<p class="section-header">CONTACT US</p>
<ul class="link-group">
<li>3343 Perimeter Hill Drive</li>
<li>Suite 215</li>
<li>Nashville, TN 37211</li>
<li><a href="/cdn-cgi/l/email-protection#11626461617e636551756b7e7f743f727e7c" rel="noreferrer noopener"><span class="__cf_email__" data-cfemail="64171114140b161024001e0b0a014a070b09">[email&#160;protected]</span></a></li>
</ul>
</div>
</div>
</div>
<div class="right col-xs-12 col-sm-5">
<p class="connect-text">Let's be friends:</p>
<div class="col-xs-12 social-media-icons footer-wide">
<ul class="icons-only">
<li class="rss-icon" id="rss-footer-1">
<a href="/pages/feeds" target="_blank" rel="noreferrer noopener">
<svg role="img" viewBox="0 0 24 24" aria-label="Follow our RSS feeds">
<title>RSS</title>
<path d="M19.199 24C19.199 13.467 10.533 4.8 0 4.8V0c13.165 0 24 10.835 24 24h-4.801zM3.291 17.415c1.814 0 3.293 1.479 3.293 3.295 0 1.813-1.485 3.29-3.301 3.29C1.47 24 0 22.526 0 20.71s1.475-3.294 3.291-3.295zM15.909 24h-4.665c0-6.169-5.075-11.245-11.244-11.245V8.09c8.727 0 15.909 7.184 15.909 15.91z"></path>
</svg>
</a>
</li>
<li class="twitter-icon">
<a href="https://twitter.com/DZoneInc" target="_blank" rel="noreferrer noopener">
<svg role="img" viewBox="0 0 24 24" aria-label="Follow us on X">
<title>X</title>
<path d="M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"></path>
</svg>
</a>
</li>
<li class="facebook-icon">
<a href="https://www.facebook.com/DZoneInc" target="_blank" rel="noreferrer noopener">
<svg role="img" viewBox="0 0 24 24" aria-label="Follow us on Facebook">
<title>Facebook</title>
<path d="M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"></path>
</svg>
</a>
</li>
<li class="linkedin-icon">
<a href="https://www.linkedin.com/company/dzone/" target="_blank" rel="noreferrer noopener">
<a href="https://www.linkedin.com/company/dzone/" target="_blank"
rel="noreferrer noopener">
<svg viewBox="0 0 24 25" fill="none" aria-label="Follow us on LinkedIn">
<path d="M6.20062 21.2143H1.84688V7.194H6.20062V21.2143ZM4.02141 5.2815C2.62922 5.2815 1.5 4.12838 1.5 2.73619C1.5 2.06747 1.76565 1.42614 2.2385 0.953285C2.71136 0.48043 3.35269 0.214783 4.02141 0.214783C4.69012 0.214783 5.33145 0.48043 5.80431 0.953285C6.27716 1.42614 6.54281 2.06747 6.54281 2.73619C6.54281 4.12838 5.413 5.2815 4.02141 5.2815ZM22.4953 21.2143H18.1509V14.3893C18.1509 12.7628 18.1181 10.6768 15.8873 10.6768C13.6237 10.6768 13.2769 12.444 13.2769 14.2721V21.2143H8.92781V7.194H13.1034V9.1065H13.1644C13.7456 8.00494 15.1655 6.84244 17.2838 6.84244C21.69 6.84244 22.5 9.744 22.5 13.5128V21.2143H22.4953Z" fill="currentColor"></path>
</svg>
</a>
</a>
</li>
</ul>
</div>
</div>
</div>
</div></div></div></div></div></div>
<script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script>
let body = document.getElementsByClassName("body")[0];
window.addEventListener('resize', () => {
setBarWidth();
});
function setBarWidth() {
let container = document.getElementById("announcement-container");
if (container) {
let bodyStyle = getComputedStyle(body);
let marginLeft = bodyStyle.marginLeft;
let marginRight = bodyStyle.marginRight;
container.style.marginRight = "-" + marginRight;
container.style.marginLeft = "-" + marginLeft;
}
}
setBarWidth();
</script>
<div class="row">
<a href="#" class="back-to-top"><i class="icon-up-big"></i></a>
</div>
<script type="text/ng-template" id="recaptcha.html"><script async defer src="https://www.google.com/recaptcha/api.js?render=6LevLMUUAAAAAIHR_NiM-0FV6xtDGFZSQ0IHuKK8"></script></script><script type="text/ng-template" id="dzlike.html">
<div class="dz-like " ng-class="{liked: status.liked}" ng-click="like()">
<a href="#">
<i class="icon-up-dir"></i>
<span>{{ status.score }}</span>
</a>
</div>
</script><script type="text/ng-template" id="dztopicselect.html"><ui-select ng-if="canAddTopics" ng-model="editing.topics" theme="bootstrap" multiple tagging tagging-label="(add topic)"
tagging-tokens=",">
<ui-select-match class="input-tags"><div class="topics-tag">{{ $item }}</div></ui-select-match>
<ui-select-choices
refresh="topicsRefresh($select.search)"
refresh-delay="250"
repeat="topic in foundTopics | filter: $select.search">
<div ng-bind-html="topic | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
<ui-select ng-if="!canAddTopics" ng-model="editing.topics" theme="bootstrap" multiple>
<ui-select-match><div class="topics-tag">{{ $item }}</div></ui-select-match>
<ui-select-choices
refresh="topicsRefresh($select.search)"
refresh-delay="250"
repeat="topic in foundTopics | filter: $select.search">
<div ng-bind-html="topic | highlight: $select.search"></div>
</ui-select-choices>
</ui-select></script><script type="text/ng-template" id="dzsave.html"><i class="icon-star-empty" ng-class="{'icon-star gold': status.saved, 'icon-star-empty': !status.saved}" tooltip-html-unsafe="{{status.saved ? 'Saved' : 'Save'}}" ng-click="save()"></i>
<!--<span ng-class="{'gold count': status.saved}">{{ status.count }}</span>--></script><script type="text/ng-template" id="overlay.html"><div class="ngdialog th-overlay">
<div class="ngdialog-overlay">
<div class="overlay-box">
<i class="icon-spin5 animate-spin"></i>
<p>{{ message }}</p>
</div>
</div>
</div></script><script type="text/ng-template" id="inline-editable.html"><div class="inline-editable" ng-if="!status.editing" ng-click="edit()" ng-transclude></div>
<div class="inline-editor-wrapper" ng-if="status.editing">
<textarea class="inline-editor" ng-model="status.editValue" ng-if="type == 'textarea'"></textarea>
<input class="inline-editor" ng-model="status.editValue" ng-if="type == 'input'"></textarea>
<div class="inline-editor-tools">
<button class="btn select-ok" ng-disabled="!status.editValue" ng-click="save()"><i class="icon-check-1"></i></button>
<button class="btn select-cancel" ng-disabled="!editable" ng-click="cancel()"><i class="icon-cancel-1"></i></button>
</div>
</div></script><script type="text/ng-template" id="dzupload.html"><span class="btn btn-upload">
<div ng-bind-html="label"></div>
<div class="progress-container" ng-style="{ 'visibility': uploading ? 'visible' : 'hidden' }">
<progressbar max="100" value="progress"><span>{{ progress }}</span></progressbar>
</div>
<input type="file" ng-file-drop ng-file-select ng-file-change="upload($files)">
</span>
<span class="icon-minus-circled-1 remove-file" ng-show="isRemovable()" ng-click="remove()"></span></script><script type="text/ng-template" id="dzphoto.html"><i class="icon-camera-alt photo" type="file" ng-file-drop ng-file-select ng-file-change="upload($files)"></i></script><script type="text/ng-template" id="dialog.confirm.html"><p>{{ message }}</p></script><script type="text/ng-template" id="dialog.reject-node.html"><p>{{ message }}</p>
<label for="modal-textarea" style="font-weight: 200; margin-top: 1em;">Editor's feedback:</label>
<textarea id="modal-textarea" class="form-control" placeholder="Optional" rows="3" maxlength="8000" style="height: auto; font-weight: 200;"></textarea></script><script type="text/ng-template" id="dialog.confirm-custom.html"><p ng-bind-html="trustAsHtml(message)"></p></script><script type="text/ng-template" id="dialog.confirm-select.html"><select class="confirm-select"
ng-ref="dialogConfirmSelect"
ng-model="selected"
ng-init="selected = options[0]"
ng-options="option.label for option in options">
</select></script><script type="text/ng-template" id="dialog.skeleton.html"><div class="dialog-title">
<h1 ng-if="$dialog.title" ng-class="{ error: $dialog.type === 'error' }">{{ $dialog.title }}</h1>
</div>
<div class="dialog-body {{ $dialog.extraClass }}" ng-include="$dialog.template"></div>
<div class="dialog-footer">
<div class="dialog-buttons" ng-if="$dialog.buttons">
<button ng-repeat="button in $dialog.buttons" ng-hide="$dialog.isButtonHidden(button)" ng-disabled="button.disabled || $dialog.executing"
class="btn btn-{{ button.type || 'info' }}" ng-click="$dialog.runAction(button)">
<span class="icon-spin6 animate-spin" ng-if="button.executing"></span>{{ button.label || button.name }}</button>
</div>
</div></script><script type="text/ng-template" id="dialog.message.html"><div class="message-icon">
<i class="icon-{{ icon }}"></i>
</div>
<div class="message-text">
<p class="message-title" ng-bind-html="trustAsHtml(title)"></p>
<p ng-bind-html="trustAsHtml(message)"></p>
</div>
</script>
<script type="text/javascript">
var TH_CORE_VARS = {};
try {
TH_CORE_VARS.additional = {};
TH_CORE_VARS.additional['matchedUrl'] = {"name":"refcard:view","mapping":"/refcardz/**","mappingPatterns":{}};TH_CORE_VARS.additional['request'] = [{"site":{"keywords":"","name":"DZone.com","description":"Enterprise solution for all your Social Q&A needs.","id":7,"title":"DZone: Programming & DevOps news, tutorials & tools"},"dev":false,"context":"","theme":"dz20","cdn":["dz2cdn1.dzone.com"],"env":"prod","user":{"realName":null,"authenticated":false,"profile":"/users/2500002/anon-user.html","jobTitle":null,"companyName":null,"name":"Anonymous","jobRole":"","GDPRStatus":null,"id":2500002,"avatar":"https://secure.gravatar.com/avatar/?d=identicon&r=PG","companySize":""}}];TH_CORE_VARS.additional['loadedScripts'] = [["/lib/jquery/jquery.js","/lib/lodash/lodash.js","/lib/moment/moment.js","/scripts/utils.js","/lib/angular/angular.js","/lib/angular/angular-sanitize.js","/lib/local-storage/angular-local-storage.js","/lib/bootstrap/dropdown.js","/lib/angular-ui/bootstrap.js","/lib/angular-ui/select.js","/lib/bootstrap-switch/bootstrap-switch.js","/lib/ngDialog/js/ngDialog.js","/lib/angular-moment/angular-moment.js","/scripts/app.js","/scripts/socket.js","/scripts/services.js","/scripts/ui-services.js","/scripts/directives.js","/scripts/filters.js","/lib/angular/angular-cookies.js","/lib/angulartics/angulartics.js","/lib/angulartics/angulartics-ga.js","/lib/angular-touch/angular-touch.min.js","/lib/elastic/elastic.js","/lib/ng-file-upload/angular-file-upload-all.js","/lib/static/ads/consent.js","/scripts/ads.js","/scripts/head.js","/scripts/utilities/ad-manager.js","/scripts/utilities/ad-service.js","/scripts/utilities/directives.js","/scripts/utilities/editor.js","/scripts/utilities/recaptcha.js","/scripts/utilities/services.js","/lib/bootstrap-slider/bootstrap-slider.js","/lib/bootstrap-slider/directive.js","/lib/lazysizes.min.js","/widgets/header/headerV2/resize.js"]];TH_CORE_VARS.additional['botInfo'] = [{"isRenderBot":false}];TH_CORE_VARS.additional['portals'] = [[{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"agile","color":"red","name":"Agile","topic":8,"id":2,"shortTitle":"agile-methodology-training-tools-news","url":"/agile-methodology-training-tools-news"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"ai","color":"purple","name":"AI","topic":2551,"id":4001,"shortTitle":"artificial-intelligence-tutorials-tools-news","url":"/artificial-intelligence-tutorials-tools-news"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"big-data","color":"green","name":"Big Data","topic":6129,"id":3,"shortTitle":"big-data-analytics-tutorials-tools-news","url":"/big-data-analytics-tutorials-tools-news"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"cloud","color":"orange","name":"Cloud","topic":30,"id":4,"shortTitle":"cloud-computing-tutorials-tools-news","url":"/cloud-computing-tutorials-tools-news"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"database","color":"purple","name":"Database","topic":59,"id":5,"shortTitle":"database-sql-nosql-tutorials-tools-news","url":"/database-sql-nosql-tutorials-tools-news"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"devops","color":"yellow","name":"DevOps","topic":31,"id":6,"shortTitle":"devops-tutorials-tools-news","url":"/devops-tutorials-tools-news"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"integration","color":"green","name":"Integration","topic":1138,"id":7,"shortTitle":"enterprise-integration-training-tools-news","url":"/enterprise-integration-training-tools-news"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"iot","color":"orange","name":"IoT","topic":48,"id":8,"shortTitle":"iot-developer-tutorials-tools-news-reviews","url":"/iot-developer-tutorials-tools-news-reviews"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"java","color":"purple","name":"Java","topic":1,"id":1,"shortTitle":"java-jdk-development-tutorials-tools-news","url":"/java-jdk-development-tutorials-tools-news"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"microservices","color":"green","name":"Microservices","topic":13268,"id":6001,"shortTitle":"microservices-news-tutorials-tools","url":"/microservices-news-tutorials-tools"},{"hideFromHomepageWidgets":true,"hideFromNav":true,"code":"mobile","color":"yellow","name":"Mobile","topic":29,"id":9,"shortTitle":"mobile-app-developer-tutorials-tools-news","url":"/mobile-app-developer-tutorials-tools-news"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"open-source","color":"purple","name":"Open Source","topic":75,"id":7001,"shortTitle":"open-source-news-tutorials-tools","url":"/open-source-news-tutorials-tools"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"performance","color":"red","name":"Performance","topic":653,"id":10,"shortTitle":"apm-tools-performance-monitoring-optimization","url":"/apm-tools-performance-monitoring-optimization"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"security","color":"green","name":"Security","topic":85,"id":2001,"shortTitle":"application-web-network-security","url":"/application-web-network-security"},{"hideFromHomepageWidgets":false,"hideFromNav":false,"code":"webdev","color":"orange","name":"Web Dev","topic":35,"id":11,"shortTitle":"web-development-programming-tutorials-tools-news","url":"/web-development-programming-tutorials-tools-news"},{"hideFromHomepageWidgets":true,"hideFromNav":true,"code":"inspiration-station ","color":"purple","name":"Writers","topic":16873,"id":3001,"shortTitle":"writers-zone","url":"/writers-zone"}]];TH_CORE_VARS.additional['csrf'] = {"headerName":"X-TH-CSRF","parameterName":"TH_CSRF","token":"-1182395294902280484"};TH_CORE_VARS.additional['loadedStyles'] = [["/lib/bootstrap/bootstrap.less","/lib/fontello/css/fontello.css","/lib/fontello/css/animation.css","/lib/angular-ui/select.css","/lib/ngDialog/css/ngDialog.css","/less/ngDialog-theme.less","/less/container.less","/lib/bootstrap-switch/bootstrap-switch.css","/less/dzone20.less","/ftl/colors.css","/lib/bootstrap-slider/bootstrap-slider.css","/lib/codemirror/lib/codemirror.css","/less/layout.less","/widgets/announcementBar/widget.less","/widgets/assets/content/chapters/widget.less","/widgets/footer/footerV2/footerV2.less","/widgets/header/headerV2/widget.less","/widgets/refcardz/topHeaderV3/widget.less"]];TH_CORE_VARS.additional['model'] = [{"metaData":{"title":"Scalability and High Availability - DZone Refcards","description":"Scalability and Availability are mentioned so often that often it is difficult to know what they actually mean in each case. They are often interchanged and create confusion that results in poorly managed expectations and unrealistic metrics. This DZone Refcard provides you with the tools to define these terms so that your team can implement mission-critical systems with well-understood performance goals. This Refcard also covers: An Overview of Scalability and High Availability, Implementing Scalable Systems, Caching Strategies, Clustering, Redundancy and Fault Tolerance, Hot Tips, and More.","keywords":"architecture,performance,deployment,scalability,high availability,infrastructure,reliability,refcard","siteName":"dzone.com","url":"/refcardz/scalability","img":"https://dz2cdn1.dzone.com/storage/rc-covers/5747748-refcard-cover43.jpg","imgprop":"og:image","twitterImage":"https://dz2cdn1.dzone.com/storage/rc-covers/5747748-refcard-cover43.jpg","type":"article","wordCount":86,"canonical":"https://dzone.com/refcardz/scalability","noIndex":false,"noFollow":false,"showCanonical":true,"sponsored":false,"prevPage":null,"nextPage":null,"pubDate":null,"id":520129,"author":"null,null","section":null,"useEscapedFragment":false,"useNoSiteLinkSearchBox":false,"isProd":true,"robots":false,"robotsTag":""},"chapters":[{"title":"Overview","content":"<h3>Scalability, High Availability, and Performance</h3><p pid=\"3\">The terms scalability, high availability, performance, and mission-critical can mean different things to different organizations, or to different departments within an organization. They are often interchanged and create confusion that results in poorly managed expectations, implementation delays, or unrealistic metrics. This Refcard provides you with the tools to define these terms so that your team can implement mission-critical systems with well understood performance goals.</p><h3>Scalability</h3><p pid=\"4\">It's the property of a system or application to handle bigger amounts of work, or to be easily expanded, in response to increased demand for network, processing, database access or file system resources.</p><h4 pid=\"5\"><strong>Horizontal scalability</strong></h4><p pid=\"5\">A system scales horizontally, or out, when it's expanded by adding new nodes with identical functionality to existing ones, redistributing the load among all of them. SOA systems and web servers scale out by adding more servers to a load-balanced network so that incoming requests may be distributed among all of them. Cluster is a common term for describing a scaled out processing system.</p><p pid=\"6\"><img alt=\"Clustering\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747694-picture1.png\"></p><p pid=\"7\"><small><strong>Figure 1:&nbsp;</strong>Clustering</small></p><h4 pid=\"8\"><strong>Vertical scalability</strong></h4><p pid=\"8\">A system scales vertically, or up, when it's expanded by adding processing, main memory, storage, or network interfaces to a node to satisfy more requests per system. Hosting services companies scale up by increasing the number of processors or the amount of main memory to host more virtual servers in the same hardware.</p><p pid=\"10\"><img alt=\"Virtualization\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747695-picture2.png\"></p><p pid=\"11\"><small><strong>Figure 2:</strong>Virtualization</small></p><h3>High Availability</h3><p pid=\"12\">Availability describes how well a system provides useful resources over a set period of time. High availability guarantees an absolute degree of functional continuity within a time window expressed as the relationship between uptime and downtime.</p><p pid=\"13\">A = 100 – (100*D/U), D ::= unplanned downtime, U ::= uptime; D, U expressed in minutes</p><p pid=\"14\">Uptime and availability don't mean the same thing. A system may be up for a complete measuring period, but may be unavailable due to network outages or downtime in related support systems. Downtime and unavailability are synonymous.</p><h4 pid=\"15\"><strong>Measuring Availability</strong></h4><p pid=\"15\">Vendors define availability as a given number of \"nines\" like in Table 1, which also describes the number of minutes or seconds of estimated downtime in relation to the number of minutes in a 365-day year, or 525,600, making U a constant for their marketing purposes.</p><table cellpadding=\"0\" cellspacing=\"0\">\n <tbody>\n <tr>\n <td class=\"dark_blue\"><strong>Availability %</strong></td>\n <td class=\"dark_cream\"><strong>Downtime in Minutes</strong></td>\n <td class=\"dark_blue\"><strong>Downtime per Year</strong></td>\n <td class=\"dark_cream\"><strong>Vendor Jargon</strong></td>\n </tr>\n <tr>\n <td class=\"light_blue\">90</td>\n <td class=\"light_cream\">52,560.00</td>\n <td class=\"light_blue\">36.5 days</td>\n <td class=\"light_cream\">one nine</td>\n </tr>\n <tr>\n <td class=\"light_blue\">99</td>\n <td class=\"light_cream\">5,256.00</td>\n <td class=\"light_blue\">4 days</td>\n <td class=\"light_cream\">two nines</td>\n </tr>\n <tr>\n <td class=\"light_blue\">99.9</td>\n <td class=\"light_cream\">525.60</td>\n <td class=\"light_blue\">8.8 hours</td>\n <td class=\"light_cream\">three nines</td>\n </tr>\n <tr>\n <td class=\"light_blue\">99.99</td>\n <td class=\"light_cream\">52.56</td>\n <td class=\"light_blue\">53 minutes</td>\n <td class=\"light_cream\">four nines</td>\n </tr>\n <tr>\n <td class=\"light_blue\">99.999</td>\n <td class=\"light_cream\">5.26</td>\n <td class=\"light_blue\">5.3 minutes</td>\n <td class=\"light_cream\">five nines</td>\n </tr>\n <tr>\n <td class=\"light_blue\">99.9999</td>\n <td class=\"light_cream\">0.53</td>\n <td class=\"light_blue\">32 seconds</td>\n <td class=\"light_cream\">six nines</td>\n </tr>\n </tbody>\n</table><p pid=\"16\"><small><strong>Table 1:&nbsp;</strong>Availability as a Percentage of Total Yearly Uptime</small></p><h4 pid=\"17\"><strong>Analysis</strong></h4><p pid=\"17\">High availability depends on the expected uptime defined for system requirements; don't be misled by vendor figures. The meaning of having a highly available system and its measurable uptime are a direct function of a Service Level Agreement. Availability goes up when factoring planned downtime, such as a monthly 8-hour maintenance window. The cost of each additional nine of availability can grow exponentially. Availability is a function of scaling the systems up or out and implementing system, network, and storage redundancy.</p><h3>Service Level Agreement (SLA)</h3><p pid=\"18\">SLAs are the negotiated terms that outline the obligations of the two parties involved in delivering and using a system, like:</p><ul>\n <li>System type (virtual or dedicated servers, shared hosting)</li>\n <li>Levels of availability\n <ul>\n <li>Minimum</li>\n <li>Target</li>\n </ul></li>\n <li>Uptime\n <ul>\n <li>Network</li>\n <li>Power</li>\n <li>Maintenance windows</li>\n </ul></li>\n <li>Serviceability</li>\n <li>Performance and Metrics</li>\n <li>Billing</li>\n</ul><p pid=\"19\">SLAs can bind obligations between two internal organizations (e.g. the IT and e-commerce departments), or between the organization and an outsourced services provider. The SLA establishes the metrics for evaluating the system performance, and provides the definitions for availability and the scalability targets. It makes no sense to talk about any of these topics unless an SLA is being drawn or one already exists.</p><h3 pid=\"77\"><strong>Elasticity</strong></h3><p pid=\"78\">Elasticity is the ability to dynamically add and remove resources in a system in response to demand, and is a specialized implementation of scaling horizontally or vertically.</p><p pid=\"79\">As requests increase during a busy period, more nodes can be automatically added to a cluster to scale out and removed when the demand has faded – similar to seasonal hiring at brick and mortar retailers. Additionally, system resources can be re-allocated to better support a system for scaling up dynamically.</p>"},{"title":"Implementing Scalable Systems","content":"<p pid=\"20\">SLAs determine whether systems must scale up or out. They also drive the growth timeline. A stock trading system must scale in real-time within minimum and maximum availability levels. An e-commerce system, in contrast, may scale in during the \"slow\" months of the year, and scale out during the retail holiday season to satisfy much larger demand.</p><h3>Load Balancing</h3><p pid=\"21\">Load balancing is a technique for minimizing response time and maximizing throughput by spreading requests among two or more resources. Load balancers may be implemented in dedicated hardware devices, or in software. Figure 3 shows how load-balanced systems appear to the resource consumers as a single resource exposed through a well-known address. The load balancer is responsible for routing requests to available systems based on a scheduling rule.</p><p pid=\"22\"><img alt=\"Load Balancer\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747708-picture3.png\"></p><p pid=\"23\"><small><strong>Figure 3:</strong> Availability as percentage of Total Yearly Uptime</small></p><p pid=\"80\">Scheduling rules are algorithms for determining which server must service a request. Web applications and services are typically balanced by following round robin scheduling rules, but can also balance based on least-connected, IP-hash, or a number of other options. Caching pools are balanced by applying frequency rules and expiration algorithms. Applications where stateless requests arrive with a uniform probability for any number of servers may use a pseudo-random scheduler. Applications like music stores, where some content is statistically more popular, may use asymmetric load balancers to shift the larger number popular requests to higher performance systems, serving the rest of the requests from less powerful systems or clusters.</p><h4 pid=\"25\"><strong>Persistent Load Balancers</strong></h4><p pid=\"25\">Stateful applications require persistent or sticky load balancing, where a consumer is guaranteed to maintain a session with a specific server from the pool. Figure 4 shows a sticky balancer that maintains sessions from multiple clients. Figure 5 shows how the cluster maintains sessions by sharing data using a database.</p><p pid=\"26\"><img alt=\"Sticky Load Balancer\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747709-picture4.png\"></p><p pid=\"27\"><small><strong>Figure 4:&nbsp;</strong>Sticky Load Balancer</small></p><h4 pid=\"28\"><strong>Common Features of a Load Balancer</strong></h4><p pid=\"28\">Asymmetric load distribution – assigns some servers to handle a bigger load than others</p><ul>\n <li>Content filtering: Inbound or outbound.</li>\n <li>Distributed Denial of Services (DDoS) attack protection</li>\n <li>Firewall.</li>\n <li>Payload switching: Sends requests to different servers based on URI, port, and/or protocol.</li>\n <li>Priority activation: Adds standing by servers to the pool.</li>\n <li>Rate shaping: Ability to give different priority to different traffic.</li>\n <li>Scripting: Reduces human interaction by implementing programming rules or actions.</li>\n <li>SSL termination: Hardware-assisted encryption frees web server resources.</li>\n <li>TCP buffering and offloading: Throttle requests to servers in the pool.</li>\n <li>GZIP compression: Decreases transfer bandwidth utilization.</li>\n</ul><p pid=\"29\"><img alt=\"DatabaseSessions\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747710-picture5.png\"></p><p pid=\"30\"><small><strong>Figure 5:</strong> Database Sessions</small></p>"},{"title":"Caching Strategies","content":"<p pid=\"31\">Stateful load balancing techniques require data sharing among the service providers. Caching is a technique for sharing data among multiple consumers or servers that are expensive to either compute or fetch. Data are stored and retrieved in a subsystem that provides quick access to a copy of the frequently accessed data.</p><p pid=\"32\">Caches are implemented as an indexed table where a unique key is used for referencing some datum. Consumers access data by checking (hitting) the cache first and retrieving the datum from it. If it's not there (cache miss), then the costlier retrieval operation takes place and the consumer or a subsystem inserts the datum to the cache.</p><h3>Write Policy</h3><p pid=\"33\">The cache may become stale if the backing store changes without updating the cache. A write policy for the cache defines how cached data are refreshed. Some common write policies include:</p><ul>\n <li>Write-through: Every write to the cache follows a synchronous write to the backing store.</li>\n <li>Write-behind: Updated entries are marked in the cache table as dirty and it's updated only when a dirty datum is requested.</li>\n <li>No-write allocation: Only read requests are cached under the assumption that the data won't change over time but it's expensive to retrieve.</li>\n</ul><h3>Application Caching</h3><ul>\n <li>Implicit caching happens when there is little or no programmer participation in implementing the caching. The program executes queries and updates using its native API and the caching layer automatically caches the requests independently of the application. Example: Terracotta (<a href=\"https://www.terracotta.org/\">https://www.terracotta.org/</a>).</li>\n <li>Explicit caching happens when the programmer participates in implementing the caching API and may also implement the caching policies. The program must import the caching API into its flow in order to use it. Examples: memcached (<a href=\"http://www.danga.com/memcached\">http://www.danga.com/memcached</a>), Redis (<a href=\"https://redis.io\">https://redis.io</a>), and Oracle Coherence (<a href=\"http://coherence.oracle.com\">http://coherence.oracle.com</a>).</li>\n</ul><p pid=\"81\">In general, implicit caching systems are specific to a platform or language. Terracotta, for example, only works with Java and JVM-hosted languages like Groovy or Kotlin. Explicit caching systems may be used with many programming languages and across multiple platforms at the same time. Memcached and Redis work with every major programming language, and Coherence works with Java, .Net, and native C++ applications.</p><h3>Web Caching</h3><p pid=\"35\">Web caching is used for storing documents or portions of documents (‘particles') to reduce server load, bandwidth usage and lag for web applications. Web caching can exist on the browser (user cache) or on the server, the topic of this section. Web caches are invisible to the client may be classified in any of these categories:</p><ul>\n <li><strong>Web accelerators:</strong> they operate on behalf of the server of origin. Used for expediting access to heavy resources, like media files, and are often geolocated closer to intended recipients. Content distribution networks (CDNs) are an example of web acceleration caches; Akamai, Amazon S3, Nirvanix are examples of this technology.</li>\n <li><strong>Proxy caches:</strong> they serve requests to a group of clients that may all have access to the same resources. They can be used for content filtering and for reducing bandwidth usage. Squid, Apache, Amazon Cloud Front, ISA server are examples of this technology.</li>\n</ul><h3>Distributed Caching</h3><p pid=\"82\">Caching techniques can be implemented across multiple systems that serve requests for multiple consumers and from multiple resources. These are known as distributed caches, like the setup in Figure 6. Akamai is an example of a distributed web cache, and memcached is an example of a distributed application cache.</p><p pid=\"37\"><img alt=\"Distributed Cache\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747711-picture6.png\"></p><p pid=\"38\"><strong>Figure 6:&nbsp;</strong>Distributed Cache</p>"},{"title":"Clustering","content":"<p pid=\"83\">A cluster is a group of computer systems that work together to form what appears to the user as a single system. Clusters are deployed to improve services availability or to increase computational or data manipulation performance. In terms of equivalent computing power, a cluster is more cost-effective than a monolithic system with the same performance characteristics.</p><p pid=\"40\">The systems in a cluster are interconnected over high-speed local area networks like gigabit Ethernet, fiber distributed data interface (FDDI), Infiniband, Myrinet, or other technologies.</p><p pid=\"41\"><img alt=\"Load Balancing Cluster\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747712-picture7.png\"></p><p pid=\"42\">Figure 7: Load Balancing Cluster</p><p pid=\"84\"><strong>Load-balancing cluster (active/active)</strong>: Distribute the load among multiple back-end, redundant nodes. All nodes in the cluster offer full-service capabilities to the consumers and are active at the same time.</p><p pid=\"85\"><strong>High availability cluster (active/passive)</strong>: Improve services availability by providing uninterrupted service through redundant clusters that eliminate single points of failure. High availability clusters require two nodes at a minimum, a \"heartbeat\" to detect that all nodes are ready, and a routing mechanism that will automatically switch traffic, or fail over, if the main cluster fails.</p><p pid=\"44\"><img alt=\"Load Balancing Cluster\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747713-picture8.png\"></p><p pid=\"45\"><strong>Figure 8:</strong> Cluster Failover</p><p pid=\"49\"><strong>Grid:</strong> Process workloads defined as independent jobs that don't require data sharing among processes. Storage or network may be shared across all nodes of the grid, but intermediate results have no bearing on other jobs progress or on other nodes in the grid, such as a Cloudera Map Reduce cluster (<a href=\"http://www.cloudera.com\">http://www.cloudera.com</a>).</p><p pid=\"50\"><img alt=\"Figure 11\" class=\"fr-fin fr-dib\" src=\"/storage/temp/5747720-picture9.png\"></p><p pid=\"51\"><strong>Figure 9:</strong> Computational Clusters</p><p pid=\"86\"><strong>Computational clusters</strong>: Execute processes that require raw computational power instead of executing transactional operations like web or database clusters. The nodes are tightly coupled, homogeneous, and in close physical proximity. They often replace supercomputers.</p>"},{"title":"Redundancy and Fault Tolerance","content":"<p pid=\"53\">Redundant system design depends on the expectation that any system component failure is independent of failure in the other components.</p><p pid=\"87\">Fault tolerant systems continue to operate in the event of component or subsystem failure; throughput may decrease but overall system availability remains constant. Faults in hardware or software are handled through component redundancy or safe fallbacks, if one can be made in software. Fault tolerance in software is often implemented as a fallback method if a dependent system is unavailable. Fault tolerance requirements are derived from SLAs. The implementation depends on the hardware and software components, and on the rules by which they interact.</p><h3>Fault Tolerance SLA Requirements</h3><ul>\n <li><strong>No single point of failure</strong>: Redundant components ensure continuous operation and allow repairs without disruption of service.</li>\n <li><strong>Fault isolation</strong>: Problem detection must pinpoint the specific faulty component</li>\n <li><strong>Fault propagation containment</strong>: Faults in one component must not cascade to others.</li>\n <li><strong>Reversion mode</strong>: Set the system back to a known state.</li>\n</ul><p pid=\"88\">Redundant clustered systems can provide higher availability, better throughput, and fault tolerance. The A/A cluster in Figure 10 provides uninterrupted service for a scalable, stateless application.</p><p pid=\"56\"><img alt=\"Figure 12\" class=\"fr-fin fr-dib\" height=\"177\" src=\"/storage/rc-covers/14943-thumb.png\" width=\"748\"></p><p pid=\"89\"><strong>Figure 10: </strong>A/A full tolerance and recovery</p><p pid=\"90\">Some stateful applications may only scale up; the A/P cluster in Figure 11 provides uninterrupted service and disaster recovery for such an application. Active/Active configurations provide failure transparency. Active/Passive configurations may provide failure transparency at a much higher cost because automatic failure detection and reconfiguration are implemented through a feedback control system, which is more expensive and trickier to implement.</p><p pid=\"59\"><img alt=\"Figure13\" class=\"fr-fin fr-dib\" src=\"/storage/rc-covers/14944-thumb.png\" width=\"583\"></p><p pid=\"91\"><strong>Figure 11: </strong>A/P fault tolerance and recovery</p><p pid=\"92\">Enterprise systems most commonly implement A/P fault tolerance and recovery through fault transparency by diverting services to the passive system and bringing it on-line as soon as possible. Robotics and life-critical systems may implement probabilistic, linear model, fault hiding, and optimization control systems instead.</p><h3 pid=\"93\"><strong>Multi-Region</strong></h3><p pid=\"94\">Redundant systems often span multiple regions in order to isolate geographic phenomenon, provide failover capabilities, and deliver content as close to the consumer as possible. These redundancies cascade down through the system into all services, and a single scalable system may have a number of load balanced clusters throughout.</p><h3>Cloud Computing</h3><p pid=\"62\">Cloud computing describes applications running on distributed, computing resources owned and operated by a third-party.</p><p pid=\"63\">End-user apps are the most common examples. They utilize the Software as a Service (SaaS) and Platform as a Service (PaaS) computing models.</p><p pid=\"64\"><img alt=\"Figure 14\" class=\"fr-fin fr-dib\" src=\"/storage/rc-covers/14945-thumb.png\" width=\"612\"></p><p pid=\"65\"><strong>Figure 12: </strong>Cloud computing configuration</p><h3 pid=\"96\"><strong>Cloud Services Types</strong></h3><ul>\n <li><strong>Web services</strong>: Salesforce com, USPS, Google Maps.</li>\n <li><strong>Service platforms</strong>: Google App Engine, Amazon Web Services (EC2, S3, Cloud Front), Nirvanix, Akamai, MuleSource.</li>\n</ul><h3 pid=\"97\"><strong>Fault Detection Methods</strong></h3><p pid=\"98\">Fault detection methods must provide enough information to isolate the fault and execute automatic or assisted failover action. Some of the most common fault detection methods include:</p><ul>\n <li>Built-in diagnostics.</li>\n <li>Protocol sniffers.</li>\n <li>Sanity checks.</li>\n <li>Watchdog checks.</li>\n</ul><p pid=\"67\">Criticality is defined as the number of consecutive faults reported by two or more detection mechanisms over a fixed time period. A fault detection mechanism is useless if it reports every single glitch (noise) or if it fails to report a real fault over a number of monitoring periods.</p>"},{"title":"System Performance","content":"<p pid=\"99\">Performance refers to the system throughput and latency under a particular workload for a defined period of time. Performance testing validates implementation decisions about the system throughput, scalability, reliability, and resource usage. Performance engineers work with the development and deployment teams to ensure that the system's non-functional requirements like SLAs are implemented as part of the system development lifecycle. System performance encompasses hardware, software, and networking optimizations.</p><p pid=\"100\"><strong>Tip</strong>: Performance testing efforts must begin at the same time as the development project and continue through deployment. Testing should be performed against a mirror of the production environment, if possible.</p><p pid=\"102\">The performance engineer's objective is to detect bottlenecks early and to collaborate with the development and deployment teams on eliminating them.</p><h3 pid=\"103\"><strong>System Performance Tests</strong></h3><p pid=\"104\">Performance specifications are documented along with the SLA and with the system design. Performance troubleshooting includes these types of testing:</p><ul>\n <li><strong>Endurance testing</strong>: Identifies resource leaks under the continuous, expected load.</li>\n <li><strong>Load testing</strong>: Determines the system behavior under a specific load.</li>\n <li><strong>Spike testing</strong>: Shows how the system operates in response to dramatic changes in load.</li>\n <li><strong>Stress testing</strong>: Identifies the breaking point for the application under dramatic load changes for extended periods of time.</li>\n</ul><h3 pid=\"105\"><strong>Software Testing Tools</strong></h3><p pid=\"106\">There are many software performance testing tools in the market. Some of the best are released as open-source software. A comprehensive list of those is available from DZone.</p><p pid=\"107\">These include Java, native, PHP, .Net, and other languages and platforms.</p>"}],"enableThreadedComments":true,"contentType":"refcard","content":{"id":"520129","type":"refcard","creationDate":1498771179000,"creationDateFormatted":"06/29/2017 09:19 PM","title":"Scalability and High Availability","body":"<h2 class=\"author_name\" pid=\"2\">Overview</h2><h3>Scalability, High Availability, and Performance</h3><p pid=\"3\">The terms scalability, high availability, performance, and mission-critical can mean different things to different organizations, or to different departments within an organization. They are often interchanged and create confusion that results in poorly managed expectations, implementation delays, or unrealistic metrics. This Refcard provides you with the tools to define these terms so that your team can implement mission-critical systems with well understood performance goals.</p><h3>Scalability</h3><p pid=\"4\">It's the property of a system or application to handle bigger amounts of work, or to be easily expanded, in response to increased demand for network, processing, database access or file system resources.</p><h4 pid=\"5\"><strong>Horizontal scalability</strong></h4><p pid=\"5\">A system scales horizontally, or out, when it's expanded by adding new nodes with identical functionality to existing ones, redistributing the load among all of them. SOA systems and web servers scale out by adding more servers to a load-balanced network so that incoming requests may be distributed among all of them. Cluster is a common term for describing a scaled out processing system.</p><p pid=\"6\"><img alt=\"Clustering\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747694-picture1.png\"></p><p pid=\"7\"><small><strong>Figure 1:&nbsp;</strong>Clustering</small></p><h4 pid=\"8\"><strong>Vertical scalability</strong></h4><p pid=\"8\">A system scales vertically, or up, when it's expanded by adding processing, main memory, storage, or network interfaces to a node to satisfy more requests per system. Hosting services companies scale up by increasing the number of processors or the amount of main memory to host more virtual servers in the same hardware.</p><p pid=\"10\"><img alt=\"Virtualization\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747695-picture2.png\"></p><p pid=\"11\"><small><strong>Figure 2:</strong>Virtualization</small></p><h3>High Availability</h3><p pid=\"12\">Availability describes how well a system provides useful resources over a set period of time. High availability guarantees an absolute degree of functional continuity within a time window expressed as the relationship between uptime and downtime.</p><p pid=\"13\">A = 100 – (100*D/U), D ::= unplanned downtime, U ::= uptime; D, U expressed in minutes</p><p pid=\"14\">Uptime and availability don't mean the same thing. A system may be up for a complete measuring period, but may be unavailable due to network outages or downtime in related support systems. Downtime and unavailability are synonymous.</p><h4 pid=\"15\"><strong>Measuring Availability</strong></h4><p pid=\"15\">Vendors define availability as a given number of \"nines\" like in Table 1, which also describes the number of minutes or seconds of estimated downtime in relation to the number of minutes in a 365-day year, or 525,600, making U a constant for their marketing purposes.</p><table cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td class=\"dark_blue\"><strong>Availability %</strong></td><td class=\"dark_cream\"><strong>Downtime in Minutes</strong></td><td class=\"dark_blue\"><strong>Downtime per Year</strong></td><td class=\"dark_cream\"><strong>Vendor Jargon</strong></td></tr><tr><td class=\"light_blue\">90</td><td class=\"light_cream\">52,560.00</td><td class=\"light_blue\">36.5 days</td><td class=\"light_cream\">one nine</td></tr><tr><td class=\"light_blue\">99</td><td class=\"light_cream\">5,256.00</td><td class=\"light_blue\">4 days</td><td class=\"light_cream\">two nines</td></tr><tr><td class=\"light_blue\">99.9</td><td class=\"light_cream\">525.60</td><td class=\"light_blue\">8.8 hours</td><td class=\"light_cream\">three nines</td></tr><tr><td class=\"light_blue\">99.99</td><td class=\"light_cream\">52.56</td><td class=\"light_blue\">53 minutes</td><td class=\"light_cream\">four nines</td></tr><tr><td class=\"light_blue\">99.999</td><td class=\"light_cream\">5.26</td><td class=\"light_blue\">5.3 minutes</td><td class=\"light_cream\">five nines</td></tr><tr><td class=\"light_blue\">99.9999</td><td class=\"light_cream\">0.53</td><td class=\"light_blue\">32 seconds</td><td class=\"light_cream\">six nines</td></tr></tbody></table><p pid=\"16\"><small><strong>Table 1:&nbsp;</strong>Availability as a Percentage of Total Yearly Uptime</small></p><h4 pid=\"17\"><strong>Analysis</strong></h4><p pid=\"17\">High availability depends on the expected uptime defined for system requirements; don't be misled by vendor figures. The meaning of having a highly available system and its measurable uptime are a direct function of a Service Level Agreement. Availability goes up when factoring planned downtime, such as a monthly 8-hour maintenance window. The cost of each additional nine of availability can grow exponentially. Availability is a function of scaling the systems up or out and implementing system, network, and storage redundancy.</p><h3>Service Level Agreement (SLA)</h3><p pid=\"18\">SLAs are the negotiated terms that outline the obligations of the two parties involved in delivering and using a system, like:</p><ul><li>System type (virtual or dedicated servers, shared hosting)</li><li>Levels of availability<ul><li>Minimum</li><li>Target</li></ul></li><li>Uptime<ul><li>Network</li><li>Power</li><li>Maintenance windows</li></ul></li><li>Serviceability</li><li>Performance and Metrics</li><li>Billing</li></ul><p pid=\"19\">SLAs can bind obligations between two internal organizations (e.g. the IT and e-commerce departments), or between the organization and an outsourced services provider. The SLA establishes the metrics for evaluating the system performance, and provides the definitions for availability and the scalability targets. It makes no sense to talk about any of these topics unless an SLA is being drawn or one already exists.</p><h3 pid=\"77\"><strong>Elasticity</strong></h3><p pid=\"78\">Elasticity is the ability to dynamically add and remove resources in a system in response to demand, and is a specialized implementation of scaling horizontally or vertically.</p><p pid=\"79\">As requests increase during a busy period, more nodes can be automatically added to a cluster to scale out and removed when the demand has faded – similar to seasonal hiring at brick and mortar retailers. Additionally, system resources can be re-allocated to better support a system for scaling up dynamically.</p><h2>Implementing Scalable Systems</h2><p pid=\"20\">SLAs determine whether systems must scale up or out. They also drive the growth timeline. A stock trading system must scale in real-time within minimum and maximum availability levels. An e-commerce system, in contrast, may scale in during the \"slow\" months of the year, and scale out during the retail holiday season to satisfy much larger demand.</p><h3>Load Balancing</h3><p pid=\"21\">Load balancing is a technique for minimizing response time and maximizing throughput by spreading requests among two or more resources. Load balancers may be implemented in dedicated hardware devices, or in software. Figure 3 shows how load-balanced systems appear to the resource consumers as a single resource exposed through a well-known address. The load balancer is responsible for routing requests to available systems based on a scheduling rule.</p><p pid=\"22\"><img alt=\"Load Balancer\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747708-picture3.png\"></p><p pid=\"23\"><small><strong>Figure 3:</strong> Availability as percentage of Total Yearly Uptime</small></p><p pid=\"80\">Scheduling rules are algorithms for determining which server must service a request. Web applications and services are typically balanced by following round robin scheduling rules, but can also balance based on least-connected, IP-hash, or a number of other options. Caching pools are balanced by applying frequency rules and expiration algorithms. Applications where stateless requests arrive with a uniform probability for any number of servers may use a pseudo-random scheduler. Applications like music stores, where some content is statistically more popular, may use asymmetric load balancers to shift the larger number popular requests to higher performance systems, serving the rest of the requests from less powerful systems or clusters.</p><h4 pid=\"25\"><strong>Persistent Load Balancers</strong></h4><p pid=\"25\">Stateful applications require persistent or sticky load balancing, where a consumer is guaranteed to maintain a session with a specific server from the pool. Figure 4 shows a sticky balancer that maintains sessions from multiple clients. Figure 5 shows how the cluster maintains sessions by sharing data using a database.</p><p pid=\"26\"><img alt=\"Sticky Load Balancer\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747709-picture4.png\"></p><p pid=\"27\"><small><strong>Figure 4:&nbsp;</strong>Sticky Load Balancer</small></p><h4 pid=\"28\"><strong>Common Features of a Load Balancer</strong></h4><p pid=\"28\">Asymmetric load distribution – assigns some servers to handle a bigger load than others</p><ul><li>Content filtering: Inbound or outbound.</li><li>Distributed Denial of Services (DDoS) attack protection</li><li>Firewall.</li><li>Payload switching: Sends requests to different servers based on URI, port, and/or protocol.</li><li>Priority activation: Adds standing by servers to the pool.</li><li>Rate shaping: Ability to give different priority to different traffic.</li><li>Scripting: Reduces human interaction by implementing programming rules or actions.</li><li>SSL termination: Hardware-assisted encryption frees web server resources.</li><li>TCP buffering and offloading: Throttle requests to servers in the pool.</li><li>GZIP compression: Decreases transfer bandwidth utilization.</li></ul><p pid=\"29\"><img alt=\"DatabaseSessions\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747710-picture5.png\"></p><p pid=\"30\"><small><strong>Figure 5:</strong> Database Sessions</small></p><h2>Caching Strategies</h2><p pid=\"31\">Stateful load balancing techniques require data sharing among the service providers. Caching is a technique for sharing data among multiple consumers or servers that are expensive to either compute or fetch. Data are stored and retrieved in a subsystem that provides quick access to a copy of the frequently accessed data.</p><p pid=\"32\">Caches are implemented as an indexed table where a unique key is used for referencing some datum. Consumers access data by checking (hitting) the cache first and retrieving the datum from it. If it's not there (cache miss), then the costlier retrieval operation takes place and the consumer or a subsystem inserts the datum to the cache.</p><h3>Write Policy</h3><p pid=\"33\">The cache may become stale if the backing store changes without updating the cache. A write policy for the cache defines how cached data are refreshed. Some common write policies include:</p><ul><li>Write-through: Every write to the cache follows a synchronous write to the backing store.</li><li>Write-behind: Updated entries are marked in the cache table as dirty and it's updated only when a dirty datum is requested.</li><li>No-write allocation: Only read requests are cached under the assumption that the data won't change over time but it's expensive to retrieve.</li></ul><h3>Application Caching</h3><ul><li>Implicit caching happens when there is little or no programmer participation in implementing the caching. The program executes queries and updates using its native API and the caching layer automatically caches the requests independently of the application. Example: Terracotta (<a href=\"https://www.terracotta.org/\">https://www.terracotta.org/</a>).</li><li>Explicit caching happens when the programmer participates in implementing the caching API and may also implement the caching policies. The program must import the caching API into its flow in order to use it. Examples: memcached (<a href=\"http://www.danga.com/memcached\">http://www.danga.com/memcached</a>), Redis (<a href=\"https://redis.io\">https://redis.io</a>), and Oracle Coherence (<a href=\"http://coherence.oracle.com\">http://coherence.oracle.com</a>).</li></ul><p pid=\"81\">In general, implicit caching systems are specific to a platform or language. Terracotta, for example, only works with Java and JVM-hosted languages like Groovy or Kotlin. Explicit caching systems may be used with many programming languages and across multiple platforms at the same time. Memcached and Redis work with every major programming language, and Coherence works with Java, .Net, and native C++ applications.</p><h3>Web Caching</h3><p pid=\"35\">Web caching is used for storing documents or portions of documents (‘particles') to reduce server load, bandwidth usage and lag for web applications. Web caching can exist on the browser (user cache) or on the server, the topic of this section. Web caches are invisible to the client may be classified in any of these categories:</p><ul><li><strong>Web accelerators:</strong> they operate on behalf of the server of origin. Used for expediting access to heavy resources, like media files, and are often geolocated closer to intended recipients. Content distribution networks (CDNs) are an example of web acceleration caches; Akamai, Amazon S3, Nirvanix are examples of this technology.</li><li><strong>Proxy caches:</strong> they serve requests to a group of clients that may all have access to the same resources. They can be used for content filtering and for reducing bandwidth usage. Squid, Apache, Amazon Cloud Front, ISA server are examples of this technology.</li></ul><h3>Distributed Caching</h3><p pid=\"82\">Caching techniques can be implemented across multiple systems that serve requests for multiple consumers and from multiple resources. These are known as distributed caches, like the setup in Figure 6. Akamai is an example of a distributed web cache, and memcached is an example of a distributed application cache.</p><p pid=\"37\"><img alt=\"Distributed Cache\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747711-picture6.png\"></p><p pid=\"38\"><strong>Figure 6:&nbsp;</strong>Distributed Cache</p><h2>Clustering</h2><p pid=\"83\">A cluster is a group of computer systems that work together to form what appears to the user as a single system. Clusters are deployed to improve services availability or to increase computational or data manipulation performance. In terms of equivalent computing power, a cluster is more cost-effective than a monolithic system with the same performance characteristics.</p><p pid=\"40\">The systems in a cluster are interconnected over high-speed local area networks like gigabit Ethernet, fiber distributed data interface (FDDI), Infiniband, Myrinet, or other technologies.</p><p pid=\"41\"><img alt=\"Load Balancing Cluster\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747712-picture7.png\"></p><p pid=\"42\">Figure 7: Load Balancing Cluster</p><p pid=\"84\"><strong>Load-balancing cluster (active/active)</strong>: Distribute the load among multiple back-end, redundant nodes. All nodes in the cluster offer full-service capabilities to the consumers and are active at the same time.</p><p pid=\"85\"><strong>High availability cluster (active/passive)</strong>: Improve services availability by providing uninterrupted service through redundant clusters that eliminate single points of failure. High availability clusters require two nodes at a minimum, a \"heartbeat\" to detect that all nodes are ready, and a routing mechanism that will automatically switch traffic, or fail over, if the main cluster fails.</p><p pid=\"44\"><img alt=\"Load Balancing Cluster\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747713-picture8.png\"></p><p pid=\"45\"><strong>Figure 8:</strong> Cluster Failover</p><p pid=\"49\"><strong>Grid:</strong> Process workloads defined as independent jobs that don't require data sharing among processes. Storage or network may be shared across all nodes of the grid, but intermediate results have no bearing on other jobs progress or on other nodes in the grid, such as a Cloudera Map Reduce cluster (<a href=\"http://www.cloudera.com\">http://www.cloudera.com</a>).</p><p pid=\"50\"><img alt=\"Figure 11\" class=\"fr-fin fr-dib\" src=\"/storage/temp/5747720-picture9.png\"></p><p pid=\"51\"><strong>Figure 9:</strong> Computational Clusters</p><p pid=\"86\"><strong>Computational clusters</strong>: Execute processes that require raw computational power instead of executing transactional operations like web or database clusters. The nodes are tightly coupled, homogeneous, and in close physical proximity. They often replace supercomputers.</p><h2>Redundancy and Fault Tolerance</h2><p pid=\"53\">Redundant system design depends on the expectation that any system component failure is independent of failure in the other components.</p><p pid=\"87\">Fault tolerant systems continue to operate in the event of component or subsystem failure; throughput may decrease but overall system availability remains constant. Faults in hardware or software are handled through component redundancy or safe fallbacks, if one can be made in software. Fault tolerance in software is often implemented as a fallback method if a dependent system is unavailable. Fault tolerance requirements are derived from SLAs. The implementation depends on the hardware and software components, and on the rules by which they interact.</p><h3>Fault Tolerance SLA Requirements</h3><ul><li><strong>No single point of failure</strong>: Redundant components ensure continuous operation and allow repairs without disruption of service.</li><li><strong>Fault isolation</strong>: Problem detection must pinpoint the specific faulty component</li><li><strong>Fault propagation containment</strong>: Faults in one component must not cascade to others.</li><li><strong>Reversion mode</strong>: Set the system back to a known state.</li></ul><p pid=\"88\">Redundant clustered systems can provide higher availability, better throughput, and fault tolerance. The A/A cluster in Figure 10 provides uninterrupted service for a scalable, stateless application.</p><p pid=\"56\"><img alt=\"Figure 12\" class=\"fr-fin fr-dib\" height=\"177\" src=\"/storage/rc-covers/14943-thumb.png\" width=\"748\"></p><p pid=\"89\"><strong>Figure 10: </strong>A/A full tolerance and recovery</p><p pid=\"90\">Some stateful applications may only scale up; the A/P cluster in Figure 11 provides uninterrupted service and disaster recovery for such an application. Active/Active configurations provide failure transparency. Active/Passive configurations may provide failure transparency at a much higher cost because automatic failure detection and reconfiguration are implemented through a feedback control system, which is more expensive and trickier to implement.</p><p pid=\"59\"><img alt=\"Figure13\" class=\"fr-fin fr-dib\" src=\"/storage/rc-covers/14944-thumb.png\" width=\"583\"></p><p pid=\"91\"><strong>Figure 11: </strong>A/P fault tolerance and recovery</p><p pid=\"92\">Enterprise systems most commonly implement A/P fault tolerance and recovery through fault transparency by diverting services to the passive system and bringing it on-line as soon as possible. Robotics and life-critical systems may implement probabilistic, linear model, fault hiding, and optimization control systems instead.</p><h3 pid=\"93\"><strong>Multi-Region</strong></h3><p pid=\"94\">Redundant systems often span multiple regions in order to isolate geographic phenomenon, provide failover capabilities, and deliver content as close to the consumer as possible. These redundancies cascade down through the system into all services, and a single scalable system may have a number of load balanced clusters throughout.</p><h3>Cloud Computing</h3><p pid=\"62\">Cloud computing describes applications running on distributed, computing resources owned and operated by a third-party.</p><p pid=\"63\">End-user apps are the most common examples. They utilize the Software as a Service (SaaS) and Platform as a Service (PaaS) computing models.</p><p pid=\"64\"><img alt=\"Figure 14\" class=\"fr-fin fr-dib\" src=\"/storage/rc-covers/14945-thumb.png\" width=\"612\"></p><p pid=\"65\"><strong>Figure 12: </strong>Cloud computing configuration</p><h3 pid=\"96\"><strong>Cloud Services Types</strong></h3><ul><li><strong>Web services</strong>: Salesforce com, USPS, Google Maps.</li><li><strong>Service platforms</strong>: Google App Engine, Amazon Web Services (EC2, S3, Cloud Front), Nirvanix, Akamai, MuleSource.</li></ul><h3 pid=\"97\"><strong>Fault Detection Methods</strong></h3><p pid=\"98\">Fault detection methods must provide enough information to isolate the fault and execute automatic or assisted failover action. Some of the most common fault detection methods include:</p><ul><li>Built-in diagnostics.</li><li>Protocol sniffers.</li><li>Sanity checks.</li><li>Watchdog checks.</li></ul><p pid=\"67\">Criticality is defined as the number of consecutive faults reported by two or more detection mechanisms over a fixed time period. A fault detection mechanism is useless if it reports every single glitch (noise) or if it fails to report a real fault over a number of monitoring periods.</p><h2>System Performance</h2><p pid=\"99\">Performance refers to the system throughput and latency under a particular workload for a defined period of time. Performance testing validates implementation decisions about the system throughput, scalability, reliability, and resource usage. Performance engineers work with the development and deployment teams to ensure that the system's non-functional requirements like SLAs are implemented as part of the system development lifecycle. System performance encompasses hardware, software, and networking optimizations.</p><p pid=\"100\"><strong>Tip</strong>: Performance testing efforts must begin at the same time as the development project and continue through deployment. Testing should be performed against a mirror of the production environment, if possible.</p><p pid=\"102\">The performance engineer's objective is to detect bottlenecks early and to collaborate with the development and deployment teams on eliminating them.</p><h3 pid=\"103\"><strong>System Performance Tests</strong></h3><p pid=\"104\">Performance specifications are documented along with the SLA and with the system design. Performance troubleshooting includes these types of testing:</p><ul><li><strong>Endurance testing</strong>: Identifies resource leaks under the continuous, expected load.</li><li><strong>Load testing</strong>: Determines the system behavior under a specific load.</li><li><strong>Spike testing</strong>: Shows how the system operates in response to dramatic changes in load.</li><li><strong>Stress testing</strong>: Identifies the breaking point for the application under dramatic load changes for extended periods of time.</li></ul><h3 pid=\"105\"><strong>Software Testing Tools</strong></h3><p pid=\"106\">There are many software performance testing tools in the market. Some of the best are released as open-source software. A comprehensive list of those is available from DZone.</p><p pid=\"107\">These include Java, native, PHP, .Net, and other languages and platforms.</p>","bodyAsHTML":"<h2 class=\"author_name\" pid=\"2\">Overview</h2><h3>Scalability, High Availability, and Performance</h3><p pid=\"3\">The terms scalability, high availability, performance, and mission-critical can mean different things to different organizations, or to different departments within an organization. They are often interchanged and create confusion that results in poorly managed expectations, implementation delays, or unrealistic metrics. This Refcard provides you with the tools to define these terms so that your team can implement mission-critical systems with well understood performance goals.</p><h3>Scalability</h3><p pid=\"4\">It's the property of a system or application to handle bigger amounts of work, or to be easily expanded, in response to increased demand for network, processing, database access or file system resources.</p><h4 pid=\"5\"><strong>Horizontal scalability</strong></h4><p pid=\"5\">A system scales horizontally, or out, when it's expanded by adding new nodes with identical functionality to existing ones, redistributing the load among all of them. SOA systems and web servers scale out by adding more servers to a load-balanced network so that incoming requests may be distributed among all of them. Cluster is a common term for describing a scaled out processing system.</p><p pid=\"6\"><img alt=\"Clustering\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747694-picture1.png\"></p><p pid=\"7\"><small><strong>Figure 1:&nbsp;</strong>Clustering</small></p><h4 pid=\"8\"><strong>Vertical scalability</strong></h4><p pid=\"8\">A system scales vertically, or up, when it's expanded by adding processing, main memory, storage, or network interfaces to a node to satisfy more requests per system. Hosting services companies scale up by increasing the number of processors or the amount of main memory to host more virtual servers in the same hardware.</p><p pid=\"10\"><img alt=\"Virtualization\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747695-picture2.png\"></p><p pid=\"11\"><small><strong>Figure 2:</strong>Virtualization</small></p><h3>High Availability</h3><p pid=\"12\">Availability describes how well a system provides useful resources over a set period of time. High availability guarantees an absolute degree of functional continuity within a time window expressed as the relationship between uptime and downtime.</p><p pid=\"13\">A = 100 – (100*D/U), D ::= unplanned downtime, U ::= uptime; D, U expressed in minutes</p><p pid=\"14\">Uptime and availability don't mean the same thing. A system may be up for a complete measuring period, but may be unavailable due to network outages or downtime in related support systems. Downtime and unavailability are synonymous.</p><h4 pid=\"15\"><strong>Measuring Availability</strong></h4><p pid=\"15\">Vendors define availability as a given number of \"nines\" like in Table 1, which also describes the number of minutes or seconds of estimated downtime in relation to the number of minutes in a 365-day year, or 525,600, making U a constant for their marketing purposes.</p><table cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td class=\"dark_blue\"><strong>Availability %</strong></td><td class=\"dark_cream\"><strong>Downtime in Minutes</strong></td><td class=\"dark_blue\"><strong>Downtime per Year</strong></td><td class=\"dark_cream\"><strong>Vendor Jargon</strong></td></tr><tr><td class=\"light_blue\">90</td><td class=\"light_cream\">52,560.00</td><td class=\"light_blue\">36.5 days</td><td class=\"light_cream\">one nine</td></tr><tr><td class=\"light_blue\">99</td><td class=\"light_cream\">5,256.00</td><td class=\"light_blue\">4 days</td><td class=\"light_cream\">two nines</td></tr><tr><td class=\"light_blue\">99.9</td><td class=\"light_cream\">525.60</td><td class=\"light_blue\">8.8 hours</td><td class=\"light_cream\">three nines</td></tr><tr><td class=\"light_blue\">99.99</td><td class=\"light_cream\">52.56</td><td class=\"light_blue\">53 minutes</td><td class=\"light_cream\">four nines</td></tr><tr><td class=\"light_blue\">99.999</td><td class=\"light_cream\">5.26</td><td class=\"light_blue\">5.3 minutes</td><td class=\"light_cream\">five nines</td></tr><tr><td class=\"light_blue\">99.9999</td><td class=\"light_cream\">0.53</td><td class=\"light_blue\">32 seconds</td><td class=\"light_cream\">six nines</td></tr></tbody></table><p pid=\"16\"><small><strong>Table 1:&nbsp;</strong>Availability as a Percentage of Total Yearly Uptime</small></p><h4 pid=\"17\"><strong>Analysis</strong></h4><p pid=\"17\">High availability depends on the expected uptime defined for system requirements; don't be misled by vendor figures. The meaning of having a highly available system and its measurable uptime are a direct function of a Service Level Agreement. Availability goes up when factoring planned downtime, such as a monthly 8-hour maintenance window. The cost of each additional nine of availability can grow exponentially. Availability is a function of scaling the systems up or out and implementing system, network, and storage redundancy.</p><h3>Service Level Agreement (SLA)</h3><p pid=\"18\">SLAs are the negotiated terms that outline the obligations of the two parties involved in delivering and using a system, like:</p><ul><li>System type (virtual or dedicated servers, shared hosting)</li><li>Levels of availability<ul><li>Minimum</li><li>Target</li></ul></li><li>Uptime<ul><li>Network</li><li>Power</li><li>Maintenance windows</li></ul></li><li>Serviceability</li><li>Performance and Metrics</li><li>Billing</li></ul><p pid=\"19\">SLAs can bind obligations between two internal organizations (e.g. the IT and e-commerce departments), or between the organization and an outsourced services provider. The SLA establishes the metrics for evaluating the system performance, and provides the definitions for availability and the scalability targets. It makes no sense to talk about any of these topics unless an SLA is being drawn or one already exists.</p><h3 pid=\"77\"><strong>Elasticity</strong></h3><p pid=\"78\">Elasticity is the ability to dynamically add and remove resources in a system in response to demand, and is a specialized implementation of scaling horizontally or vertically.</p><p pid=\"79\">As requests increase during a busy period, more nodes can be automatically added to a cluster to scale out and removed when the demand has faded – similar to seasonal hiring at brick and mortar retailers. Additionally, system resources can be re-allocated to better support a system for scaling up dynamically.</p><h2>Implementing Scalable Systems</h2><p pid=\"20\">SLAs determine whether systems must scale up or out. They also drive the growth timeline. A stock trading system must scale in real-time within minimum and maximum availability levels. An e-commerce system, in contrast, may scale in during the \"slow\" months of the year, and scale out during the retail holiday season to satisfy much larger demand.</p><h3>Load Balancing</h3><p pid=\"21\">Load balancing is a technique for minimizing response time and maximizing throughput by spreading requests among two or more resources. Load balancers may be implemented in dedicated hardware devices, or in software. Figure 3 shows how load-balanced systems appear to the resource consumers as a single resource exposed through a well-known address. The load balancer is responsible for routing requests to available systems based on a scheduling rule.</p><p pid=\"22\"><img alt=\"Load Balancer\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747708-picture3.png\"></p><p pid=\"23\"><small><strong>Figure 3:</strong> Availability as percentage of Total Yearly Uptime</small></p><p pid=\"80\">Scheduling rules are algorithms for determining which server must service a request. Web applications and services are typically balanced by following round robin scheduling rules, but can also balance based on least-connected, IP-hash, or a number of other options. Caching pools are balanced by applying frequency rules and expiration algorithms. Applications where stateless requests arrive with a uniform probability for any number of servers may use a pseudo-random scheduler. Applications like music stores, where some content is statistically more popular, may use asymmetric load balancers to shift the larger number popular requests to higher performance systems, serving the rest of the requests from less powerful systems or clusters.</p><h4 pid=\"25\"><strong>Persistent Load Balancers</strong></h4><p pid=\"25\">Stateful applications require persistent or sticky load balancing, where a consumer is guaranteed to maintain a session with a specific server from the pool. Figure 4 shows a sticky balancer that maintains sessions from multiple clients. Figure 5 shows how the cluster maintains sessions by sharing data using a database.</p><p pid=\"26\"><img alt=\"Sticky Load Balancer\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747709-picture4.png\"></p><p pid=\"27\"><small><strong>Figure 4:&nbsp;</strong>Sticky Load Balancer</small></p><h4 pid=\"28\"><strong>Common Features of a Load Balancer</strong></h4><p pid=\"28\">Asymmetric load distribution – assigns some servers to handle a bigger load than others</p><ul><li>Content filtering: Inbound or outbound.</li><li>Distributed Denial of Services (DDoS) attack protection</li><li>Firewall.</li><li>Payload switching: Sends requests to different servers based on URI, port, and/or protocol.</li><li>Priority activation: Adds standing by servers to the pool.</li><li>Rate shaping: Ability to give different priority to different traffic.</li><li>Scripting: Reduces human interaction by implementing programming rules or actions.</li><li>SSL termination: Hardware-assisted encryption frees web server resources.</li><li>TCP buffering and offloading: Throttle requests to servers in the pool.</li><li>GZIP compression: Decreases transfer bandwidth utilization.</li></ul><p pid=\"29\"><img alt=\"DatabaseSessions\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747710-picture5.png\"></p><p pid=\"30\"><small><strong>Figure 5:</strong> Database Sessions</small></p><h2>Caching Strategies</h2><p pid=\"31\">Stateful load balancing techniques require data sharing among the service providers. Caching is a technique for sharing data among multiple consumers or servers that are expensive to either compute or fetch. Data are stored and retrieved in a subsystem that provides quick access to a copy of the frequently accessed data.</p><p pid=\"32\">Caches are implemented as an indexed table where a unique key is used for referencing some datum. Consumers access data by checking (hitting) the cache first and retrieving the datum from it. If it's not there (cache miss), then the costlier retrieval operation takes place and the consumer or a subsystem inserts the datum to the cache.</p><h3>Write Policy</h3><p pid=\"33\">The cache may become stale if the backing store changes without updating the cache. A write policy for the cache defines how cached data are refreshed. Some common write policies include:</p><ul><li>Write-through: Every write to the cache follows a synchronous write to the backing store.</li><li>Write-behind: Updated entries are marked in the cache table as dirty and it's updated only when a dirty datum is requested.</li><li>No-write allocation: Only read requests are cached under the assumption that the data won't change over time but it's expensive to retrieve.</li></ul><h3>Application Caching</h3><ul><li>Implicit caching happens when there is little or no programmer participation in implementing the caching. The program executes queries and updates using its native API and the caching layer automatically caches the requests independently of the application. Example: Terracotta (<a href=\"https://www.terracotta.org/\">https://www.terracotta.org/</a>).</li><li>Explicit caching happens when the programmer participates in implementing the caching API and may also implement the caching policies. The program must import the caching API into its flow in order to use it. Examples: memcached (<a href=\"http://www.danga.com/memcached\">http://www.danga.com/memcached</a>), Redis (<a href=\"https://redis.io\">https://redis.io</a>), and Oracle Coherence (<a href=\"http://coherence.oracle.com\">http://coherence.oracle.com</a>).</li></ul><p pid=\"81\">In general, implicit caching systems are specific to a platform or language. Terracotta, for example, only works with Java and JVM-hosted languages like Groovy or Kotlin. Explicit caching systems may be used with many programming languages and across multiple platforms at the same time. Memcached and Redis work with every major programming language, and Coherence works with Java, .Net, and native C++ applications.</p><h3>Web Caching</h3><p pid=\"35\">Web caching is used for storing documents or portions of documents (‘particles') to reduce server load, bandwidth usage and lag for web applications. Web caching can exist on the browser (user cache) or on the server, the topic of this section. Web caches are invisible to the client may be classified in any of these categories:</p><ul><li><strong>Web accelerators:</strong> they operate on behalf of the server of origin. Used for expediting access to heavy resources, like media files, and are often geolocated closer to intended recipients. Content distribution networks (CDNs) are an example of web acceleration caches; Akamai, Amazon S3, Nirvanix are examples of this technology.</li><li><strong>Proxy caches:</strong> they serve requests to a group of clients that may all have access to the same resources. They can be used for content filtering and for reducing bandwidth usage. Squid, Apache, Amazon Cloud Front, ISA server are examples of this technology.</li></ul><h3>Distributed Caching</h3><p pid=\"82\">Caching techniques can be implemented across multiple systems that serve requests for multiple consumers and from multiple resources. These are known as distributed caches, like the setup in Figure 6. Akamai is an example of a distributed web cache, and memcached is an example of a distributed application cache.</p><p pid=\"37\"><img alt=\"Distributed Cache\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747711-picture6.png\"></p><p pid=\"38\"><strong>Figure 6:&nbsp;</strong>Distributed Cache</p><h2>Clustering</h2><p pid=\"83\">A cluster is a group of computer systems that work together to form what appears to the user as a single system. Clusters are deployed to improve services availability or to increase computational or data manipulation performance. In terms of equivalent computing power, a cluster is more cost-effective than a monolithic system with the same performance characteristics.</p><p pid=\"40\">The systems in a cluster are interconnected over high-speed local area networks like gigabit Ethernet, fiber distributed data interface (FDDI), Infiniband, Myrinet, or other technologies.</p><p pid=\"41\"><img alt=\"Load Balancing Cluster\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747712-picture7.png\"></p><p pid=\"42\">Figure 7: Load Balancing Cluster</p><p pid=\"84\"><strong>Load-balancing cluster (active/active)</strong>: Distribute the load among multiple back-end, redundant nodes. All nodes in the cluster offer full-service capabilities to the consumers and are active at the same time.</p><p pid=\"85\"><strong>High availability cluster (active/passive)</strong>: Improve services availability by providing uninterrupted service through redundant clusters that eliminate single points of failure. High availability clusters require two nodes at a minimum, a \"heartbeat\" to detect that all nodes are ready, and a routing mechanism that will automatically switch traffic, or fail over, if the main cluster fails.</p><p pid=\"44\"><img alt=\"Load Balancing Cluster\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747713-picture8.png\"></p><p pid=\"45\"><strong>Figure 8:</strong> Cluster Failover</p><p pid=\"49\"><strong>Grid:</strong> Process workloads defined as independent jobs that don't require data sharing among processes. Storage or network may be shared across all nodes of the grid, but intermediate results have no bearing on other jobs progress or on other nodes in the grid, such as a Cloudera Map Reduce cluster (<a href=\"http://www.cloudera.com\">http://www.cloudera.com</a>).</p><p pid=\"50\"><img alt=\"Figure 11\" class=\"fr-fin fr-dib\" src=\"/storage/temp/5747720-picture9.png\"></p><p pid=\"51\"><strong>Figure 9:</strong> Computational Clusters</p><p pid=\"86\"><strong>Computational clusters</strong>: Execute processes that require raw computational power instead of executing transactional operations like web or database clusters. The nodes are tightly coupled, homogeneous, and in close physical proximity. They often replace supercomputers.</p><h2>Redundancy and Fault Tolerance</h2><p pid=\"53\">Redundant system design depends on the expectation that any system component failure is independent of failure in the other components.</p><p pid=\"87\">Fault tolerant systems continue to operate in the event of component or subsystem failure; throughput may decrease but overall system availability remains constant. Faults in hardware or software are handled through component redundancy or safe fallbacks, if one can be made in software. Fault tolerance in software is often implemented as a fallback method if a dependent system is unavailable. Fault tolerance requirements are derived from SLAs. The implementation depends on the hardware and software components, and on the rules by which they interact.</p><h3>Fault Tolerance SLA Requirements</h3><ul><li><strong>No single point of failure</strong>: Redundant components ensure continuous operation and allow repairs without disruption of service.</li><li><strong>Fault isolation</strong>: Problem detection must pinpoint the specific faulty component</li><li><strong>Fault propagation containment</strong>: Faults in one component must not cascade to others.</li><li><strong>Reversion mode</strong>: Set the system back to a known state.</li></ul><p pid=\"88\">Redundant clustered systems can provide higher availability, better throughput, and fault tolerance. The A/A cluster in Figure 10 provides uninterrupted service for a scalable, stateless application.</p><p pid=\"56\"><img alt=\"Figure 12\" class=\"fr-fin fr-dib\" height=\"177\" src=\"/storage/rc-covers/14943-thumb.png\" width=\"748\"></p><p pid=\"89\"><strong>Figure 10: </strong>A/A full tolerance and recovery</p><p pid=\"90\">Some stateful applications may only scale up; the A/P cluster in Figure 11 provides uninterrupted service and disaster recovery for such an application. Active/Active configurations provide failure transparency. Active/Passive configurations may provide failure transparency at a much higher cost because automatic failure detection and reconfiguration are implemented through a feedback control system, which is more expensive and trickier to implement.</p><p pid=\"59\"><img alt=\"Figure13\" class=\"fr-fin fr-dib\" src=\"/storage/rc-covers/14944-thumb.png\" width=\"583\"></p><p pid=\"91\"><strong>Figure 11: </strong>A/P fault tolerance and recovery</p><p pid=\"92\">Enterprise systems most commonly implement A/P fault tolerance and recovery through fault transparency by diverting services to the passive system and bringing it on-line as soon as possible. Robotics and life-critical systems may implement probabilistic, linear model, fault hiding, and optimization control systems instead.</p><h3 pid=\"93\"><strong>Multi-Region</strong></h3><p pid=\"94\">Redundant systems often span multiple regions in order to isolate geographic phenomenon, provide failover capabilities, and deliver content as close to the consumer as possible. These redundancies cascade down through the system into all services, and a single scalable system may have a number of load balanced clusters throughout.</p><h3>Cloud Computing</h3><p pid=\"62\">Cloud computing describes applications running on distributed, computing resources owned and operated by a third-party.</p><p pid=\"63\">End-user apps are the most common examples. They utilize the Software as a Service (SaaS) and Platform as a Service (PaaS) computing models.</p><p pid=\"64\"><img alt=\"Figure 14\" class=\"fr-fin fr-dib\" src=\"/storage/rc-covers/14945-thumb.png\" width=\"612\"></p><p pid=\"65\"><strong>Figure 12: </strong>Cloud computing configuration</p><h3 pid=\"96\"><strong>Cloud Services Types</strong></h3><ul><li><strong>Web services</strong>: Salesforce com, USPS, Google Maps.</li><li><strong>Service platforms</strong>: Google App Engine, Amazon Web Services (EC2, S3, Cloud Front), Nirvanix, Akamai, MuleSource.</li></ul><h3 pid=\"97\"><strong>Fault Detection Methods</strong></h3><p pid=\"98\">Fault detection methods must provide enough information to isolate the fault and execute automatic or assisted failover action. Some of the most common fault detection methods include:</p><ul><li>Built-in diagnostics.</li><li>Protocol sniffers.</li><li>Sanity checks.</li><li>Watchdog checks.</li></ul><p pid=\"67\">Criticality is defined as the number of consecutive faults reported by two or more detection mechanisms over a fixed time period. A fault detection mechanism is useless if it reports every single glitch (noise) or if it fails to report a real fault over a number of monitoring periods.</p><h2>System Performance</h2><p pid=\"99\">Performance refers to the system throughput and latency under a particular workload for a defined period of time. Performance testing validates implementation decisions about the system throughput, scalability, reliability, and resource usage. Performance engineers work with the development and deployment teams to ensure that the system's non-functional requirements like SLAs are implemented as part of the system development lifecycle. System performance encompasses hardware, software, and networking optimizations.</p><p pid=\"100\"><strong>Tip</strong>: Performance testing efforts must begin at the same time as the development project and continue through deployment. Testing should be performed against a mirror of the production environment, if possible.</p><p pid=\"102\">The performance engineer's objective is to detect bottlenecks early and to collaborate with the development and deployment teams on eliminating them.</p><h3 pid=\"103\"><strong>System Performance Tests</strong></h3><p pid=\"104\">Performance specifications are documented along with the SLA and with the system design. Performance troubleshooting includes these types of testing:</p><ul><li><strong>Endurance testing</strong>: Identifies resource leaks under the continuous, expected load.</li><li><strong>Load testing</strong>: Determines the system behavior under a specific load.</li><li><strong>Spike testing</strong>: Shows how the system operates in response to dramatic changes in load.</li><li><strong>Stress testing</strong>: Identifies the breaking point for the application under dramatic load changes for extended periods of time.</li></ul><h3 pid=\"105\"><strong>Software Testing Tools</strong></h3><p pid=\"106\">There are many software performance testing tools in the market. Some of the best are released as open-source software. A comprehensive list of those is available from DZone.</p><p pid=\"107\">These include Java, native, PHP, .Net, and other languages and platforms.</p>","author":{"id":360761,"username":"RyanLittle","avatar":"https://secure.gravatar.com/avatar/b7ea965bf9b8d654d840826463499ecc?d=identicon&r=PG","reputation":0},"lastEditedAction":46627558,"activeRevisionId":4523433,"revisionIds":[4523433,2721839,2721838,2077641,2074588,2074587,2074586,2074585,2074583,1560364,1106306,937211,937185,936843,936842,936836,936826,936825,927442,635012,635011,635010,634998,635009,635008,635007,635006,635005,635004,635003,635002,635001,635000,634999],"lastActiveUserId":3342467,"lastActiveDate":1607463805000,"parentId":null,"parentAuthor":null,"originalParentId":null,"childrenIds":[532337,533323,538575,551039,552149,552151,552153,552155,552621,552695,552697,552899,553013],"commentIds":[532337,533323,538575,551039,552149,552151,552153,552155,552621,552695,552697,552899,553013],"marked":true,"topics":["performance","architecture","infrastructure","deployment","scalability","reliability","high availability"],"primaryContainerId":8,"containerIds":[7,8],"plug":"scalability","wiki":false,"score":0,"depth":0}}];TH_CORE_VARS.additional['requiresModule'] = ["generalDirectives","monospaced.elastic","angularFileUpload","ui.bootstrap-slider","angulartics","angulartics.google.analytics","ngCookies","ngSanitize","ui.select","ui.bootstrap","angularMoment","ngTouch","ngDialog","LocalStorageModule"]; } catch (e) {
console.error(e);
}
</script>
<script type="text/javascript" src="https://dz2cdn1.dzone.com/storage/pub/19198120-combined.js" charset="utf-8"></script><script type="text/javascript" src="https://dz2cdn1.dzone.com/storage/pub/19198141-combined.js" charset="utf-8"></script>
<script defer src="https://dz2cdn1.dzone.com/themes/dz20/lib/alpinejs/3.13.2/cdn.min.js"></script>
<script src="https://i6ByW9Zmz4ncxhHkb.ay.delivery/manager/i6ByW9Zmz4ncxhHkb"
type="text/javascript"
referrerpolicy="no-referrer-when-downgrade">
</script>
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-410289-1', 'auto');
ga('require', 'linkid', 'linkid.js');
ga('require', 'GTM-TSD9TZP');
ga('set', 'siteSpeedSampleRate', 25);
</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-K25QL22');
</script>
<script type="text/javascript">
(function() {
function controller($scope, TH$Dialog, $location, $rootScope, $timeout, TH$SharedVars, $service, TH$LocalStorage) {
$scope.searchT ='';
$scope.zonesOpen = false;
$scope.login = function() {
TH$Dialog.open({
loadWidget: 'users.loginForm',
size: 'modalForm',
showClose: true
});
};
$scope.signIn = function() {
TH$Dialog.open({
loadWidget: 'users.registration',
size: 'modalFormExtended',
showClose: true
});
};
$scope.allResults = function() {
window.location='/search';
};
$("#search").keyup(function(e) {
var length = ($scope.searchT ? $scope.searchT.length : 0);
$scope.searchT = ($scope.searchT ? $scope.searchT : '');
if (e.keyCode === 13 && length > 2) {
$scope.allResults();
}
});
$scope.focusSearch = function() {
$timeout(function() {
$("#search").focus();
}, 100);
};
$scope.search = function() {
var length = ($scope.searchT ? $scope.searchT.length : 0);
$scope.loading = (length > 2);
if (length < 3) {
if ($scope.nodes || $scope.nodes == []) {
$timeout(function() {
$scope.nodes = [];
$scope.cType = [];
$scope.related = [];
$scope.pager = [];
$scope.searchParam = [];
$scope.totalResults = null;
}, 100);
}
return false;
}
var term = $scope.searchT;
if ($scope.prevTerm == term) {
return;
}
$scope.prevTerm = term;
TH$LocalStorage.value('searchValue', term);
term = (term ? term : '');
$service.nextPage({term: term, pageSize: 7}, null, true).then(function(data) {
$scope.loading = false;
var curPage = 1;
$scope.nodes = data.pages.newest[curPage];
$scope.haveResults = ($scope.nodes) ? true : false;
$scope.totalResults = data.totalItems;
});
};
$scope.toggleZones = function(url, $event) {
$event.preventDefault();
$scope.zonesOpen = !$scope.zonesOpen;
};
$scope.$watch('searchT', function(_t) {
$scope.search();
});
}
var WMODEL_DATA = {};
WMODEL_DATA.isAdmin = false;WMODEL_DATA.getPortals = null;WMODEL_DATA.OPTIONS = {};WMODEL_DATA.user = {"karma":40,"country":null,"website":null,"city":null,"about":null,"avatar":"https://secure.gravatar.com/avatar/?d=identicon&r=PG","realName":"$$ANON_USER$$","websiteUrl":"","jobRole":null,"tagline":null,"company":null,"id":2500002,"job":null};TH.installWidgetController('header.headerV2', 'mainHeader', WMODEL_DATA, typeof controller == 'function' ? controller : null, [{name: 'nextPage', data: true}], ' oUhbWOfRPSwBoUhM', null);
})();
(function() {
var WMODEL_DATA = {};
WMODEL_DATA.OPTIONS = {};TH.installWidgetController('announcementBar', 'announcementBar1', WMODEL_DATA, typeof controller == 'function' ? controller : null, null, ' oUhbYlrRaqMaoUhM', null);
})();
(function() {
function controller($scope, $window, $location, DZHeadService, TH$SharedVars, TH$Dialog, TH$Service) {
TH$SharedVars.bind($scope, 'campaign', 'refcardCampaign', true);
$scope.editUrl = function() {
return '/dzone/staff/refcardz/' + $scope.asset.id + '/edit.html';
};
$scope.showRegistration = function() {
TH$Dialog.open({
loadWidget: 'users.registration',
size: 'modalFormExtended',
showClose: true,
data: {
asset: $scope.asset.pdf,
fromDownload: true
}
});
};
$scope.showDownload = function() {
TH$Service.data('dzoneUsers.getNextQuestion', { asset: $scope.asset.pdf }).then(function(result) {
if (result) {
TH$Dialog.open({
loadWidget: 'users.questionForm',
size: 'modalForm',
showClose: true,
closeByDocument: true,
closeByEscape: true,
data: {
asset: $scope.asset.pdf,
question: result,
fromDownload: true,
portalId: result.portalId,
portalName: result.portalName,
portalAlreadySubscribed: result.portalSubscribed,
}
});
} else {
$window.location.href = $scope.asset.pdf;
}
});
};
DZHeadService.title = TH_CORE_VARS.additional.model[0].metaData.title;
DZHeadService.description = TH_CORE_VARS.additional.model[0].metaData.description;
DZHeadService.url = $location.absUrl();
}
var WMODEL_DATA = {};
WMODEL_DATA.reprint = false;WMODEL_DATA.directPdf = false;WMODEL_DATA.perms = {"canEdit":false};WMODEL_DATA.type = "refcard";WMODEL_DATA.asset = {"cover":"https://dz2cdn1.dzone.com/storage/rc-covers/5747748-refcard-cover43.jpg","editUrl":"/dzone/staff/refcardz/520129/edit.html","pdf":"/asset/download/169039","headerImage":"https://dz2cdn1.dzone.com/storage/rc-covers/7864743-refcard-header43.png","subtitle":"Performing Well at Any Scale","cardId":"#043","description":"Scalability and Availability are mentioned so often that often it is difficult to know what they actually mean in each case. They are often interchanged and create confusion that results in poorly managed expectations and unrealistic metrics. This DZone Refcard provides you with the tools to define these terms so that your team can implement mission-critical systems with well-understood performance goals. This Refcard also covers: An Overview of Scalability and High Availability, Implementing Scalable Systems, Caching Strategies, Clustering, Redundancy and Fault Tolerance, Hot Tips, and More.","shortDesc":"Provides the tools to define Scalability and High Availability, so your team can implement critical systems with well-understood performance goals.","id":520129,"title":"Scalability and High Availability","authors":[{"firstName":"Matt","lastName":"Rasband","jobTitle":"Senior Software Engineer","companyName":"","isCore":false,"id":2915751,"avatar":"https://dz2cdn1.dzone.com/storage/user-avatar/5723604-thumb.jpg","url":"/users/2915751/mrasband.html"},{"firstName":"Eugene","lastName":"Ciurana","jobTitle":"Chief Architect","companyName":"CIME Software Labs","isCore":false,"id":281543,"avatar":"https://secure.gravatar.com/avatar/89a88ae47bd15341520996482c8e321c?d=identicon&r=PG","url":"/users/281543/ciurana.html"}]};WMODEL_DATA.OPTIONS = {};WMODEL_DATA.breadcrumbs = [{"position":1,"name":"DZone","item":"https://dzone.com"},{"position":2,"name":"Refcards","item":"https://dzone.com/refcardz"},{"position":3,"name":"Scalability and High Availability","item":"https://dzone.com/refcardz/scalability"}];TH.installWidgetController('refcardz.topHeaderV3', 'refcardzTopHeaderV34', WMODEL_DATA, typeof controller == 'function' ? controller : null, null, ' oUhbfSbmcnWOfYfWVcC', null);
})();
(function() {
function controller($scope, $rootScope, TH$Dialog, TH$SharedVars, $location, $analytics) {
$scope.loginForm = function() {
TH$Dialog.open({
loadWidget: 'users.loginForm',
size: 'modalForm',
showClose: true
});
};
$scope.scrollTo = function($event, anchor) {
$event.preventDefault();
$('html,body').animate({
scrollTop: $(anchor).offset().top - 100
}, 'slow', function() {
window.location.hash = anchor;
});
};
TH$SharedVars.bind($scope, 'chapter', 'currentChapter');
TH$SharedVars.bind($scope, 'campaign', 'refcardCampaign');
$analytics.pageTrack($location.absUrl());
}
var WMODEL_DATA = {};
WMODEL_DATA.refcard = {"rawType":"refcard","topicNames":["architecture","deployment","high availability","infrastructure","performance","reliability","scalability"],"relatedArticles":[{"img":15780921,"title":"Data Observability Doesn't Just Create Savings — It Drives Revenue, Too","url":"/articles/data-observability-doesnt-just-create-savings-it-d"},{"img":15770317,"title":"Monitor Kubernetes Events With Falco For Free","url":"/articles/monitor-kubernetes-events-with-falco-for-free"},{"img":15770054,"title":"SRE vs. Platform Engineering: The Key Differences, Explained","url":"/articles/sre-vs-platform-engineering-the-key-differences-ex"},{"img":15764017,"title":"Why a Site Reliability Engineer Is Important to Your CI/CD Pipeline","url":"/articles/why-a-site-reliability-engineer-is-important-to-yo"}],"chapters":[{"title":"Overview","content":"<h3>Scalability, High Availability, and Performance</h3><p pid=\"3\">The terms scalability, high availability, performance, and mission-critical can mean different things to different organizations, or to different departments within an organization. They are often interchanged and create confusion that results in poorly managed expectations, implementation delays, or unrealistic metrics. This Refcard provides you with the tools to define these terms so that your team can implement mission-critical systems with well understood performance goals.</p><h3>Scalability</h3><p pid=\"4\">It's the property of a system or application to handle bigger amounts of work, or to be easily expanded, in response to increased demand for network, processing, database access or file system resources.</p><h4 pid=\"5\"><strong>Horizontal scalability</strong></h4><p pid=\"5\">A system scales horizontally, or out, when it's expanded by adding new nodes with identical functionality to existing ones, redistributing the load among all of them. SOA systems and web servers scale out by adding more servers to a load-balanced network so that incoming requests may be distributed among all of them. Cluster is a common term for describing a scaled out processing system.</p><p pid=\"6\"><img alt=\"Clustering\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747694-picture1.png\"></p><p pid=\"7\"><small><strong>Figure 1:&nbsp;</strong>Clustering</small></p><h4 pid=\"8\"><strong>Vertical scalability</strong></h4><p pid=\"8\">A system scales vertically, or up, when it's expanded by adding processing, main memory, storage, or network interfaces to a node to satisfy more requests per system. Hosting services companies scale up by increasing the number of processors or the amount of main memory to host more virtual servers in the same hardware.</p><p pid=\"10\"><img alt=\"Virtualization\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747695-picture2.png\"></p><p pid=\"11\"><small><strong>Figure 2:</strong>Virtualization</small></p><h3>High Availability</h3><p pid=\"12\">Availability describes how well a system provides useful resources over a set period of time. High availability guarantees an absolute degree of functional continuity within a time window expressed as the relationship between uptime and downtime.</p><p pid=\"13\">A = 100 – (100*D/U), D ::= unplanned downtime, U ::= uptime; D, U expressed in minutes</p><p pid=\"14\">Uptime and availability don't mean the same thing. A system may be up for a complete measuring period, but may be unavailable due to network outages or downtime in related support systems. Downtime and unavailability are synonymous.</p><h4 pid=\"15\"><strong>Measuring Availability</strong></h4><p pid=\"15\">Vendors define availability as a given number of \"nines\" like in Table 1, which also describes the number of minutes or seconds of estimated downtime in relation to the number of minutes in a 365-day year, or 525,600, making U a constant for their marketing purposes.</p><table cellpadding=\"0\" cellspacing=\"0\">\n <tbody>\n <tr>\n <td class=\"dark_blue\"><strong>Availability %</strong></td>\n <td class=\"dark_cream\"><strong>Downtime in Minutes</strong></td>\n <td class=\"dark_blue\"><strong>Downtime per Year</strong></td>\n <td class=\"dark_cream\"><strong>Vendor Jargon</strong></td>\n </tr>\n <tr>\n <td class=\"light_blue\">90</td>\n <td class=\"light_cream\">52,560.00</td>\n <td class=\"light_blue\">36.5 days</td>\n <td class=\"light_cream\">one nine</td>\n </tr>\n <tr>\n <td class=\"light_blue\">99</td>\n <td class=\"light_cream\">5,256.00</td>\n <td class=\"light_blue\">4 days</td>\n <td class=\"light_cream\">two nines</td>\n </tr>\n <tr>\n <td class=\"light_blue\">99.9</td>\n <td class=\"light_cream\">525.60</td>\n <td class=\"light_blue\">8.8 hours</td>\n <td class=\"light_cream\">three nines</td>\n </tr>\n <tr>\n <td class=\"light_blue\">99.99</td>\n <td class=\"light_cream\">52.56</td>\n <td class=\"light_blue\">53 minutes</td>\n <td class=\"light_cream\">four nines</td>\n </tr>\n <tr>\n <td class=\"light_blue\">99.999</td>\n <td class=\"light_cream\">5.26</td>\n <td class=\"light_blue\">5.3 minutes</td>\n <td class=\"light_cream\">five nines</td>\n </tr>\n <tr>\n <td class=\"light_blue\">99.9999</td>\n <td class=\"light_cream\">0.53</td>\n <td class=\"light_blue\">32 seconds</td>\n <td class=\"light_cream\">six nines</td>\n </tr>\n </tbody>\n</table><p pid=\"16\"><small><strong>Table 1:&nbsp;</strong>Availability as a Percentage of Total Yearly Uptime</small></p><h4 pid=\"17\"><strong>Analysis</strong></h4><p pid=\"17\">High availability depends on the expected uptime defined for system requirements; don't be misled by vendor figures. The meaning of having a highly available system and its measurable uptime are a direct function of a Service Level Agreement. Availability goes up when factoring planned downtime, such as a monthly 8-hour maintenance window. The cost of each additional nine of availability can grow exponentially. Availability is a function of scaling the systems up or out and implementing system, network, and storage redundancy.</p><h3>Service Level Agreement (SLA)</h3><p pid=\"18\">SLAs are the negotiated terms that outline the obligations of the two parties involved in delivering and using a system, like:</p><ul>\n <li>System type (virtual or dedicated servers, shared hosting)</li>\n <li>Levels of availability\n <ul>\n <li>Minimum</li>\n <li>Target</li>\n </ul></li>\n <li>Uptime\n <ul>\n <li>Network</li>\n <li>Power</li>\n <li>Maintenance windows</li>\n </ul></li>\n <li>Serviceability</li>\n <li>Performance and Metrics</li>\n <li>Billing</li>\n</ul><p pid=\"19\">SLAs can bind obligations between two internal organizations (e.g. the IT and e-commerce departments), or between the organization and an outsourced services provider. The SLA establishes the metrics for evaluating the system performance, and provides the definitions for availability and the scalability targets. It makes no sense to talk about any of these topics unless an SLA is being drawn or one already exists.</p><h3 pid=\"77\"><strong>Elasticity</strong></h3><p pid=\"78\">Elasticity is the ability to dynamically add and remove resources in a system in response to demand, and is a specialized implementation of scaling horizontally or vertically.</p><p pid=\"79\">As requests increase during a busy period, more nodes can be automatically added to a cluster to scale out and removed when the demand has faded – similar to seasonal hiring at brick and mortar retailers. Additionally, system resources can be re-allocated to better support a system for scaling up dynamically.</p>"},{"title":"Implementing Scalable Systems","content":"<p pid=\"20\">SLAs determine whether systems must scale up or out. They also drive the growth timeline. A stock trading system must scale in real-time within minimum and maximum availability levels. An e-commerce system, in contrast, may scale in during the \"slow\" months of the year, and scale out during the retail holiday season to satisfy much larger demand.</p><h3>Load Balancing</h3><p pid=\"21\">Load balancing is a technique for minimizing response time and maximizing throughput by spreading requests among two or more resources. Load balancers may be implemented in dedicated hardware devices, or in software. Figure 3 shows how load-balanced systems appear to the resource consumers as a single resource exposed through a well-known address. The load balancer is responsible for routing requests to available systems based on a scheduling rule.</p><p pid=\"22\"><img alt=\"Load Balancer\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747708-picture3.png\"></p><p pid=\"23\"><small><strong>Figure 3:</strong> Availability as percentage of Total Yearly Uptime</small></p><p pid=\"80\">Scheduling rules are algorithms for determining which server must service a request. Web applications and services are typically balanced by following round robin scheduling rules, but can also balance based on least-connected, IP-hash, or a number of other options. Caching pools are balanced by applying frequency rules and expiration algorithms. Applications where stateless requests arrive with a uniform probability for any number of servers may use a pseudo-random scheduler. Applications like music stores, where some content is statistically more popular, may use asymmetric load balancers to shift the larger number popular requests to higher performance systems, serving the rest of the requests from less powerful systems or clusters.</p><h4 pid=\"25\"><strong>Persistent Load Balancers</strong></h4><p pid=\"25\">Stateful applications require persistent or sticky load balancing, where a consumer is guaranteed to maintain a session with a specific server from the pool. Figure 4 shows a sticky balancer that maintains sessions from multiple clients. Figure 5 shows how the cluster maintains sessions by sharing data using a database.</p><p pid=\"26\"><img alt=\"Sticky Load Balancer\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747709-picture4.png\"></p><p pid=\"27\"><small><strong>Figure 4:&nbsp;</strong>Sticky Load Balancer</small></p><h4 pid=\"28\"><strong>Common Features of a Load Balancer</strong></h4><p pid=\"28\">Asymmetric load distribution – assigns some servers to handle a bigger load than others</p><ul>\n <li>Content filtering: Inbound or outbound.</li>\n <li>Distributed Denial of Services (DDoS) attack protection</li>\n <li>Firewall.</li>\n <li>Payload switching: Sends requests to different servers based on URI, port, and/or protocol.</li>\n <li>Priority activation: Adds standing by servers to the pool.</li>\n <li>Rate shaping: Ability to give different priority to different traffic.</li>\n <li>Scripting: Reduces human interaction by implementing programming rules or actions.</li>\n <li>SSL termination: Hardware-assisted encryption frees web server resources.</li>\n <li>TCP buffering and offloading: Throttle requests to servers in the pool.</li>\n <li>GZIP compression: Decreases transfer bandwidth utilization.</li>\n</ul><p pid=\"29\"><img alt=\"DatabaseSessions\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747710-picture5.png\"></p><p pid=\"30\"><small><strong>Figure 5:</strong> Database Sessions</small></p>"},{"title":"Caching Strategies","content":"<p pid=\"31\">Stateful load balancing techniques require data sharing among the service providers. Caching is a technique for sharing data among multiple consumers or servers that are expensive to either compute or fetch. Data are stored and retrieved in a subsystem that provides quick access to a copy of the frequently accessed data.</p><p pid=\"32\">Caches are implemented as an indexed table where a unique key is used for referencing some datum. Consumers access data by checking (hitting) the cache first and retrieving the datum from it. If it's not there (cache miss), then the costlier retrieval operation takes place and the consumer or a subsystem inserts the datum to the cache.</p><h3>Write Policy</h3><p pid=\"33\">The cache may become stale if the backing store changes without updating the cache. A write policy for the cache defines how cached data are refreshed. Some common write policies include:</p><ul>\n <li>Write-through: Every write to the cache follows a synchronous write to the backing store.</li>\n <li>Write-behind: Updated entries are marked in the cache table as dirty and it's updated only when a dirty datum is requested.</li>\n <li>No-write allocation: Only read requests are cached under the assumption that the data won't change over time but it's expensive to retrieve.</li>\n</ul><h3>Application Caching</h3><ul>\n <li>Implicit caching happens when there is little or no programmer participation in implementing the caching. The program executes queries and updates using its native API and the caching layer automatically caches the requests independently of the application. Example: Terracotta (<a href=\"https://www.terracotta.org/\">https://www.terracotta.org/</a>).</li>\n <li>Explicit caching happens when the programmer participates in implementing the caching API and may also implement the caching policies. The program must import the caching API into its flow in order to use it. Examples: memcached (<a href=\"http://www.danga.com/memcached\">http://www.danga.com/memcached</a>), Redis (<a href=\"https://redis.io\">https://redis.io</a>), and Oracle Coherence (<a href=\"http://coherence.oracle.com\">http://coherence.oracle.com</a>).</li>\n</ul><p pid=\"81\">In general, implicit caching systems are specific to a platform or language. Terracotta, for example, only works with Java and JVM-hosted languages like Groovy or Kotlin. Explicit caching systems may be used with many programming languages and across multiple platforms at the same time. Memcached and Redis work with every major programming language, and Coherence works with Java, .Net, and native C++ applications.</p><h3>Web Caching</h3><p pid=\"35\">Web caching is used for storing documents or portions of documents (‘particles') to reduce server load, bandwidth usage and lag for web applications. Web caching can exist on the browser (user cache) or on the server, the topic of this section. Web caches are invisible to the client may be classified in any of these categories:</p><ul>\n <li><strong>Web accelerators:</strong> they operate on behalf of the server of origin. Used for expediting access to heavy resources, like media files, and are often geolocated closer to intended recipients. Content distribution networks (CDNs) are an example of web acceleration caches; Akamai, Amazon S3, Nirvanix are examples of this technology.</li>\n <li><strong>Proxy caches:</strong> they serve requests to a group of clients that may all have access to the same resources. They can be used for content filtering and for reducing bandwidth usage. Squid, Apache, Amazon Cloud Front, ISA server are examples of this technology.</li>\n</ul><h3>Distributed Caching</h3><p pid=\"82\">Caching techniques can be implemented across multiple systems that serve requests for multiple consumers and from multiple resources. These are known as distributed caches, like the setup in Figure 6. Akamai is an example of a distributed web cache, and memcached is an example of a distributed application cache.</p><p pid=\"37\"><img alt=\"Distributed Cache\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747711-picture6.png\"></p><p pid=\"38\"><strong>Figure 6:&nbsp;</strong>Distributed Cache</p>"},{"title":"Clustering","content":"<p pid=\"83\">A cluster is a group of computer systems that work together to form what appears to the user as a single system. Clusters are deployed to improve services availability or to increase computational or data manipulation performance. In terms of equivalent computing power, a cluster is more cost-effective than a monolithic system with the same performance characteristics.</p><p pid=\"40\">The systems in a cluster are interconnected over high-speed local area networks like gigabit Ethernet, fiber distributed data interface (FDDI), Infiniband, Myrinet, or other technologies.</p><p pid=\"41\"><img alt=\"Load Balancing Cluster\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747712-picture7.png\"></p><p pid=\"42\">Figure 7: Load Balancing Cluster</p><p pid=\"84\"><strong>Load-balancing cluster (active/active)</strong>: Distribute the load among multiple back-end, redundant nodes. All nodes in the cluster offer full-service capabilities to the consumers and are active at the same time.</p><p pid=\"85\"><strong>High availability cluster (active/passive)</strong>: Improve services availability by providing uninterrupted service through redundant clusters that eliminate single points of failure. High availability clusters require two nodes at a minimum, a \"heartbeat\" to detect that all nodes are ready, and a routing mechanism that will automatically switch traffic, or fail over, if the main cluster fails.</p><p pid=\"44\"><img alt=\"Load Balancing Cluster\" class=\"fr-fil fr-dib\" src=\"/storage/temp/5747713-picture8.png\"></p><p pid=\"45\"><strong>Figure 8:</strong> Cluster Failover</p><p pid=\"49\"><strong>Grid:</strong> Process workloads defined as independent jobs that don't require data sharing among processes. Storage or network may be shared across all nodes of the grid, but intermediate results have no bearing on other jobs progress or on other nodes in the grid, such as a Cloudera Map Reduce cluster (<a href=\"http://www.cloudera.com\">http://www.cloudera.com</a>).</p><p pid=\"50\"><img alt=\"Figure 11\" class=\"fr-fin fr-dib\" src=\"/storage/temp/5747720-picture9.png\"></p><p pid=\"51\"><strong>Figure 9:</strong> Computational Clusters</p><p pid=\"86\"><strong>Computational clusters</strong>: Execute processes that require raw computational power instead of executing transactional operations like web or database clusters. The nodes are tightly coupled, homogeneous, and in close physical proximity. They often replace supercomputers.</p>"},{"title":"Redundancy and Fault Tolerance","content":"<p pid=\"53\">Redundant system design depends on the expectation that any system component failure is independent of failure in the other components.</p><p pid=\"87\">Fault tolerant systems continue to operate in the event of component or subsystem failure; throughput may decrease but overall system availability remains constant. Faults in hardware or software are handled through component redundancy or safe fallbacks, if one can be made in software. Fault tolerance in software is often implemented as a fallback method if a dependent system is unavailable. Fault tolerance requirements are derived from SLAs. The implementation depends on the hardware and software components, and on the rules by which they interact.</p><h3>Fault Tolerance SLA Requirements</h3><ul>\n <li><strong>No single point of failure</strong>: Redundant components ensure continuous operation and allow repairs without disruption of service.</li>\n <li><strong>Fault isolation</strong>: Problem detection must pinpoint the specific faulty component</li>\n <li><strong>Fault propagation containment</strong>: Faults in one component must not cascade to others.</li>\n <li><strong>Reversion mode</strong>: Set the system back to a known state.</li>\n</ul><p pid=\"88\">Redundant clustered systems can provide higher availability, better throughput, and fault tolerance. The A/A cluster in Figure 10 provides uninterrupted service for a scalable, stateless application.</p><p pid=\"56\"><img alt=\"Figure 12\" class=\"fr-fin fr-dib\" height=\"177\" src=\"/storage/rc-covers/14943-thumb.png\" width=\"748\"></p><p pid=\"89\"><strong>Figure 10: </strong>A/A full tolerance and recovery</p><p pid=\"90\">Some stateful applications may only scale up; the A/P cluster in Figure 11 provides uninterrupted service and disaster recovery for such an application. Active/Active configurations provide failure transparency. Active/Passive configurations may provide failure transparency at a much higher cost because automatic failure detection and reconfiguration are implemented through a feedback control system, which is more expensive and trickier to implement.</p><p pid=\"59\"><img alt=\"Figure13\" class=\"fr-fin fr-dib\" src=\"/storage/rc-covers/14944-thumb.png\" width=\"583\"></p><p pid=\"91\"><strong>Figure 11: </strong>A/P fault tolerance and recovery</p><p pid=\"92\">Enterprise systems most commonly implement A/P fault tolerance and recovery through fault transparency by diverting services to the passive system and bringing it on-line as soon as possible. Robotics and life-critical systems may implement probabilistic, linear model, fault hiding, and optimization control systems instead.</p><h3 pid=\"93\"><strong>Multi-Region</strong></h3><p pid=\"94\">Redundant systems often span multiple regions in order to isolate geographic phenomenon, provide failover capabilities, and deliver content as close to the consumer as possible. These redundancies cascade down through the system into all services, and a single scalable system may have a number of load balanced clusters throughout.</p><h3>Cloud Computing</h3><p pid=\"62\">Cloud computing describes applications running on distributed, computing resources owned and operated by a third-party.</p><p pid=\"63\">End-user apps are the most common examples. They utilize the Software as a Service (SaaS) and Platform as a Service (PaaS) computing models.</p><p pid=\"64\"><img alt=\"Figure 14\" class=\"fr-fin fr-dib\" src=\"/storage/rc-covers/14945-thumb.png\" width=\"612\"></p><p pid=\"65\"><strong>Figure 12: </strong>Cloud computing configuration</p><h3 pid=\"96\"><strong>Cloud Services Types</strong></h3><ul>\n <li><strong>Web services</strong>: Salesforce com, USPS, Google Maps.</li>\n <li><strong>Service platforms</strong>: Google App Engine, Amazon Web Services (EC2, S3, Cloud Front), Nirvanix, Akamai, MuleSource.</li>\n</ul><h3 pid=\"97\"><strong>Fault Detection Methods</strong></h3><p pid=\"98\">Fault detection methods must provide enough information to isolate the fault and execute automatic or assisted failover action. Some of the most common fault detection methods include:</p><ul>\n <li>Built-in diagnostics.</li>\n <li>Protocol sniffers.</li>\n <li>Sanity checks.</li>\n <li>Watchdog checks.</li>\n</ul><p pid=\"67\">Criticality is defined as the number of consecutive faults reported by two or more detection mechanisms over a fixed time period. A fault detection mechanism is useless if it reports every single glitch (noise) or if it fails to report a real fault over a number of monitoring periods.</p>"},{"title":"System Performance","content":"<p pid=\"99\">Performance refers to the system throughput and latency under a particular workload for a defined period of time. Performance testing validates implementation decisions about the system throughput, scalability, reliability, and resource usage. Performance engineers work with the development and deployment teams to ensure that the system's non-functional requirements like SLAs are implemented as part of the system development lifecycle. System performance encompasses hardware, software, and networking optimizations.</p><p pid=\"100\"><strong>Tip</strong>: Performance testing efforts must begin at the same time as the development project and continue through deployment. Testing should be performed against a mirror of the production environment, if possible.</p><p pid=\"102\">The performance engineer's objective is to detect bottlenecks early and to collaborate with the development and deployment teams on eliminating them.</p><h3 pid=\"103\"><strong>System Performance Tests</strong></h3><p pid=\"104\">Performance specifications are documented along with the SLA and with the system design. Performance troubleshooting includes these types of testing:</p><ul>\n <li><strong>Endurance testing</strong>: Identifies resource leaks under the continuous, expected load.</li>\n <li><strong>Load testing</strong>: Determines the system behavior under a specific load.</li>\n <li><strong>Spike testing</strong>: Shows how the system operates in response to dramatic changes in load.</li>\n <li><strong>Stress testing</strong>: Identifies the breaking point for the application under dramatic load changes for extended periods of time.</li>\n</ul><h3 pid=\"105\"><strong>Software Testing Tools</strong></h3><p pid=\"106\">There are many software performance testing tools in the market. Some of the best are released as open-source software. A comprehensive list of those is available from DZone.</p><p pid=\"107\">These include Java, native, PHP, .Net, and other languages and platforms.</p>"}],"id":520129,"creationDate":1498771179000,"portal":{"id":10,"code":"performance","title":"Performance","shortTitle":"apm-tools-performance-monitoring-optimization","blurb":"Application monitoring & APM news, tools and training resources from DZone, the trusted source for software design, web development and devops best practices."},"relatedRefcards":[{"img":16058286,"title":"Full-Stack Observability Essentials","url":"/refcardz/full-stack-observability-essentials"},{"img":15919639,"title":"Getting Started With Log Management","url":"/refcardz/log-management"},{"img":16195234,"title":"Observability Maturity Model","url":"/refcardz/observability-maturity-model"},{"img":16142534,"title":"Getting Started With OpenTelemetry","url":"/refcardz/getting-started-with-opentelemetry"}]};WMODEL_DATA.OPTIONS = {};TH.installWidgetController('assets.content.chapters', 'assetsContentChapters5', WMODEL_DATA, typeof controller == 'function' ? controller : null, null, ' oUhbcgvMlhqMSsfboUhM', null);
})();
(function() {
var WMODEL_DATA = {};
WMODEL_DATA.OPTIONS = {};TH.installWidgetController('footer.footerV2', 'footerFooterV26', WMODEL_DATA, typeof controller == 'function' ? controller : null, null, ' oUhbdrfPmhwBdrfXM', null);
})();
</script>
<script type="text/javascript">
TH.installWidgetDirective('users.profile.mini', 'usersProfileMini', {"service":null,"extra":null}, 'widget.html', '/widgets/users/profile/mini/widget.js', null, ' oUhbwfbqddOeffWVcC', null, ['widget.less']);
TH.installWidgetDirective('manage.customNotifications.test', 'manageCustomNotificationsTest', {"service":{"customNotification":"="},"extra":null}, 'widget.html', '/widgets/manage/customNotifications/test/widget.js', [{name: 'searchGroups', data: true},{name: 'DEFAULT', data: true},{name: 'searchUsers', data: true}], ' oUhbXYVMwrjrYVdgpcgcoUhM', null, ['widget.less']);
TH.installWidgetDirective('manage.revisions', 'manageRevisions', {"service":null,"extra":null}, 'widget.html', '/widgets/manage/revisions/widget.js', null, ' oUhbXYVajkgpfWVcC', null, ['widget.less']);
TH.installWidgetDirective('content.commentBox', 'contentCommentBox', {"service":{"parent":"="},"extra":{"count":"=","limited":"="}}, 'widget.html', '/widgets/content/commentBox/widget.js', [{name: 'edit', data: false},{name: 'DEFAULT', data: true}], ' oUhbaqbcaibevMkaqbC', null, ['comments.less']);
TH.installWidgetDirective('dz.loading', 'dzLoading', {"service":null,"extra":null}, 'widget.html', '/widgets/dz/loading/widget.js', null, ' oUhbmVZWdfWVcC', null, ['widget.less']);
TH.installWidgetDirective('users.registration', 'usersRegistration', {"service":null,"extra":null}, 'widget.html', '/widgets/users/registration/widget.js', null, ' oUhbwfbfZvbllfWVcC', ['/scripts/utilities/tools.js'], ['widget.less']);
TH.installWidgetDirective('errors.recaptcha', 'errorsRecaptcha', {"service":null,"extra":null}, 'widget.html', '/widgets/errors/recaptcha/widget.js', null, ' oUhbfptaR_fSfWVcC', null, ['widget.less']);
TH.installWidgetDirective('users.loginForm', 'usersLoginForm', {"service":null,"extra":null}, 'widget.html', '/widgets/users/loginForm/widget.js', null, ' oUhbwfbjZcpWoUhM', null, ['widget.less']);
TH.installWidgetDirective('leads.addCRM', 'leadsAddCRM', {"service":null,"extra":null}, 'widget.html', '/widgets/leads/addCRM/widget.js', [{name: 'DEFAULT', data: true}], ' oUhb_ObOQnKRMnM oUhbcgvKRcgcONfPC', ['/scripts/utilities/tools.js'], ['add-crm.less','add-ref.less']);
TH.installWidgetDirective('users.questionForm', 'usersQuestionForm', {"service":null,"extra":null}, 'widget.html', '/widgets/users/questionForm/widget.js', null, ' oUhbwfbuglldnfWVcC', null, ['widget.less']);
TH.installWidgetDirective('errors.general', 'errorsGeneral', {"service":null,"extra":null}, 'widget.html', '/widgets/errors/general/widget.js', null, ' oUhbfptQbfWfWVcC', null, ['widget.less']);
TH.installWidgetDirective('manage.customNotifications.preview', 'manageCustomNotificationsPreview', {"service":null,"extra":null}, 'widget.html', '/widgets/manage/customNotifications/preview/widget.js', null, ' oUhbXYVMwrjrYVdgpZfnkZfnkM dLgZWBLPpWkKeXB', null, ['preview.less','/lib/froala-2/css/froala_style.min.css']);
</script>
</body>