Designing for scale and resilience in the cloud 101

Scale and
resilience in the
cloud 101
https://neworbit.co.uk
https://neworbit.co.uk
https://neworbit.co.uk
The developer’s Azure Partner
Primary constraints
Scaling out doesn’t work how you think
Myth Reality
Primary constraints
Auto Scaling in response to volume of web
requests is slow and not very exact because you
have to measure averages over a time period
You can, of course, scale manually.
Databases and other back-end services quickly
become bottlenecks and some are difficult and/or
expensive to scale
SQL and CosmosDB now both have auto/elastic scale options but the
base cost of those can be higher. It is not just a matter of “turning it
on” as you may end up paying more.
Queues
distributed systems / micro services / buzzword
Traditional “heavy” writes
Do something Call service /
calculate
Write
to
db
Queues for “heavy” writes
(distributed systems / micro services / buzzword)
Do something Call service /
calculate
Read from queue
Post to queue
Write
to
db
Azure queues are incredibly
scalable, robust and cheap
Azure functions or Web Jobs
can scale very fast based on the
length of the queue
Simple
reads
Database / IO
Use more than one “database”
(multi-modal persistence model)
Main
databases
Storage based
Blob
storage
Table
storage
Examples
Car history checking system
Multi-modal persistence
Web
(single
core)
CosmosDB
6 million cars with case history
Table Storage
~550 million mileage records for
>50 million cars.
Several
hundred £
per month
A few £ per
month
Queues
Web
(single
core)
Upload 1000+
orders
Write each line to
Table Storage
Write a message to
a queue for each
row
Auto scale starts more servers
in seconds – and shuts them
down when the queue is empty
To infinity and
beyond…
https://neworbit.co.uk
What
Questions do
you have?
https://neworbit.co.uk
1 of 17

Recommended

Spend Less on Azure by
Spend Less on AzureSpend Less on Azure
Spend Less on AzureFrans Lytzen
40 views47 slides
Secure your Azure Web App 2019 by
Secure your Azure Web App 2019Secure your Azure Web App 2019
Secure your Azure Web App 2019Frans Lytzen
383 views43 slides
Jumpstart Azure by
Jumpstart AzureJumpstart Azure
Jumpstart AzureBrian Blanchard
657 views33 slides
Top 23 Things Not to Do in AWS by
Top 23 Things Not to Do in AWSTop 23 Things Not to Do in AWS
Top 23 Things Not to Do in AWSErvan Setiawan
286 views32 slides
Best Practices for Large-Scale Web Sites by
Best Practices for Large-Scale Web SitesBest Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web SitesCraig Dickson
7.3K views28 slides
Webinar: Securely Configuring and Mining AWS CloudTrail by
Webinar: Securely Configuring and Mining AWS CloudTrailWebinar: Securely Configuring and Mining AWS CloudTrail
Webinar: Securely Configuring and Mining AWS CloudTrailAaron Klein
1.2K views14 slides

More Related Content

What's hot

Embrace the Cloud - Inspiring Conference 2015 by
Embrace the Cloud - Inspiring Conference 2015Embrace the Cloud - Inspiring Conference 2015
Embrace the Cloud - Inspiring Conference 2015Henrik Møller Rasmussen
3.4K views45 slides
Amazon WorkSpaces – Fully Managed Desktops in the Cloud by
Amazon WorkSpaces – Fully Managed Desktops in the CloudAmazon WorkSpaces – Fully Managed Desktops in the Cloud
Amazon WorkSpaces – Fully Managed Desktops in the CloudAmazon Web Services
3K views25 slides
Get Started & Migrate Your Data to AWS (English Session) by
Get Started & Migrate Your Data to AWS (English Session)Get Started & Migrate Your Data to AWS (English Session)
Get Started & Migrate Your Data to AWS (English Session)Amazon Web Services
1.2K views51 slides
Amazon WorkSpaces - Fully Managed Desktops in the Cloud by
Amazon WorkSpaces - Fully Managed Desktops in the Cloud Amazon WorkSpaces - Fully Managed Desktops in the Cloud
Amazon WorkSpaces - Fully Managed Desktops in the Cloud Amazon Web Services
1.4K views32 slides
A tale of two clouds by
A tale of two cloudsA tale of two clouds
A tale of two cloudsAndrew Siemer
1.7K views77 slides
Dos and don'ts in AWS by
Dos and don'ts in AWSDos and don'ts in AWS
Dos and don'ts in AWSMarek Piątek
195 views14 slides

What's hot(20)

Amazon WorkSpaces – Fully Managed Desktops in the Cloud by Amazon Web Services
Amazon WorkSpaces – Fully Managed Desktops in the CloudAmazon WorkSpaces – Fully Managed Desktops in the Cloud
Amazon WorkSpaces – Fully Managed Desktops in the Cloud
Get Started & Migrate Your Data to AWS (English Session) by Amazon Web Services
Get Started & Migrate Your Data to AWS (English Session)Get Started & Migrate Your Data to AWS (English Session)
Get Started & Migrate Your Data to AWS (English Session)
Amazon Web Services1.2K views
Amazon WorkSpaces - Fully Managed Desktops in the Cloud by Amazon Web Services
Amazon WorkSpaces - Fully Managed Desktops in the Cloud Amazon WorkSpaces - Fully Managed Desktops in the Cloud
Amazon WorkSpaces - Fully Managed Desktops in the Cloud
Amazon Web Services1.4K views
Data in the Azure Cloud, by Julie Lerman by Julie Lerman
Data in the Azure Cloud, by Julie LermanData in the Azure Cloud, by Julie Lerman
Data in the Azure Cloud, by Julie Lerman
Julie Lerman670 views
Exploring Cloud Computing with Amazon Web Services (AWS) by Kalema Edgar
Exploring Cloud Computing with Amazon Web Services (AWS)Exploring Cloud Computing with Amazon Web Services (AWS)
Exploring Cloud Computing with Amazon Web Services (AWS)
Kalema Edgar237 views
Optimizing AWS Economics by Aaron Klein
Optimizing AWS EconomicsOptimizing AWS Economics
Optimizing AWS Economics
Aaron Klein1.9K views
AWS Meet-up Atlanta: AWS Economics by Aaron Klein
AWS Meet-up Atlanta: AWS EconomicsAWS Meet-up Atlanta: AWS Economics
AWS Meet-up Atlanta: AWS Economics
Aaron Klein858 views
Powering Remote Developers with Amazon Workspaces by Amazon Web Services
Powering Remote Developers with Amazon WorkspacesPowering Remote Developers with Amazon Workspaces
Powering Remote Developers with Amazon Workspaces
Amazon Web Services1.7K views
Aws Overview by Jon Parten
Aws OverviewAws Overview
Aws Overview
Jon Parten291 views
AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community by AWS Germany
AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo CommunityAWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community
AWS Summit Berlin 2013 - Tadaa - HD Camera and Photo Community
AWS Germany3.1K views
Creating scalable solutions with aws by ondrejbalas
Creating scalable solutions with awsCreating scalable solutions with aws
Creating scalable solutions with aws
ondrejbalas371 views
Dell EMC: Protect Your Workloads on AWS With Increased Scale & Performance by Amazon Web Services
Dell EMC: Protect Your Workloads on AWS With Increased Scale & PerformanceDell EMC: Protect Your Workloads on AWS With Increased Scale & Performance
Dell EMC: Protect Your Workloads on AWS With Increased Scale & Performance
Amazon Web Services1.1K views
AWS Meet-up San Francisco: Cloud Security by Aaron Klein
AWS Meet-up San Francisco: Cloud SecurityAWS Meet-up San Francisco: Cloud Security
AWS Meet-up San Francisco: Cloud Security
Aaron Klein1.5K views
Amazon AWS Workspace Howto by mailbhargav
Amazon AWS Workspace HowtoAmazon AWS Workspace Howto
Amazon AWS Workspace Howto
mailbhargav12.6K views
Module 1 cloud computing by krnaween
Module 1   cloud computingModule 1   cloud computing
Module 1 cloud computing
krnaween166 views

Similar to Designing for scale and resilience in the cloud 101

2014.11.14 Data Opportunities with Azure by
2014.11.14 Data Opportunities with Azure2014.11.14 Data Opportunities with Azure
2014.11.14 Data Opportunities with AzureMarco Parenzan
432 views60 slides
Deploying your Application to SQLRally by
Deploying your Application to SQLRallyDeploying your Application to SQLRally
Deploying your Application to SQLRallyJoseph D'Antoni
539 views34 slides
Working with azure database services platform by
Working with azure database services platformWorking with azure database services platform
Working with azure database services platformssuser79fc19
84 views82 slides
Greenfield Development with CQRS by
Greenfield Development with CQRSGreenfield Development with CQRS
Greenfield Development with CQRSDavid Hoerster
2.4K views35 slides
The Public Cloud is a Lie by
The Public Cloud is a LieThe Public Cloud is a Lie
The Public Cloud is a LieTapio Rautonen
242 views22 slides
Day Of Cloud - Windows Azure Platform by
Day Of Cloud - Windows Azure PlatformDay Of Cloud - Windows Azure Platform
Day Of Cloud - Windows Azure PlatformWade Wegner
461 views51 slides

Similar to Designing for scale and resilience in the cloud 101(20)

2014.11.14 Data Opportunities with Azure by Marco Parenzan
2014.11.14 Data Opportunities with Azure2014.11.14 Data Opportunities with Azure
2014.11.14 Data Opportunities with Azure
Marco Parenzan432 views
Deploying your Application to SQLRally by Joseph D'Antoni
Deploying your Application to SQLRallyDeploying your Application to SQLRally
Deploying your Application to SQLRally
Joseph D'Antoni539 views
Working with azure database services platform by ssuser79fc19
Working with azure database services platformWorking with azure database services platform
Working with azure database services platform
ssuser79fc1984 views
Greenfield Development with CQRS by David Hoerster
Greenfield Development with CQRSGreenfield Development with CQRS
Greenfield Development with CQRS
David Hoerster2.4K views
Day Of Cloud - Windows Azure Platform by Wade Wegner
Day Of Cloud - Windows Azure PlatformDay Of Cloud - Windows Azure Platform
Day Of Cloud - Windows Azure Platform
Wade Wegner461 views
DataTalks.Club - Building Scalable End-to-End Deep Learning Pipelines in the ... by Rustem Feyzkhanov
DataTalks.Club - Building Scalable End-to-End Deep Learning Pipelines in the ...DataTalks.Club - Building Scalable End-to-End Deep Learning Pipelines in the ...
DataTalks.Club - Building Scalable End-to-End Deep Learning Pipelines in the ...
Rustem Feyzkhanov206 views
Building Cloud-Native Applications with Microsoft Windows Azure by Bill Wilder
Building Cloud-Native Applications with Microsoft Windows AzureBuilding Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows Azure
Bill Wilder899 views
Cloud Architecture Patterns for Mere Mortals - Bill Wilder - Vermont Code Cam... by Bill Wilder
Cloud Architecture Patterns for Mere Mortals - Bill Wilder - Vermont Code Cam...Cloud Architecture Patterns for Mere Mortals - Bill Wilder - Vermont Code Cam...
Cloud Architecture Patterns for Mere Mortals - Bill Wilder - Vermont Code Cam...
Bill Wilder2.6K views
Jisc RSC Eastern Technical Managers Forum 5th February 2014 Oaklands College ... by JISC RSC Eastern
Jisc RSC Eastern Technical Managers Forum 5th February 2014 Oaklands College ...Jisc RSC Eastern Technical Managers Forum 5th February 2014 Oaklands College ...
Jisc RSC Eastern Technical Managers Forum 5th February 2014 Oaklands College ...
JISC RSC Eastern687 views
Migrate Access to SQL Server/Azure by ADNUG
Migrate Access to SQL Server/AzureMigrate Access to SQL Server/Azure
Migrate Access to SQL Server/Azure
ADNUG357 views
MongoDB by fsbrooke
MongoDBMongoDB
MongoDB
fsbrooke1.3K views
Architetture Serverless con SQL Server e Azure Functions by Massimo Bonanni
Architetture Serverless con SQL Server e Azure FunctionsArchitetture Serverless con SQL Server e Azure Functions
Architetture Serverless con SQL Server e Azure Functions
Massimo Bonanni46 views
Azure Databricks – Customer Experiences and Lessons Denzil Ribeiro Madhu Ganta by Databricks
Azure Databricks – Customer Experiences and Lessons Denzil Ribeiro Madhu GantaAzure Databricks – Customer Experiences and Lessons Denzil Ribeiro Madhu Ganta
Azure Databricks – Customer Experiences and Lessons Denzil Ribeiro Madhu Ganta
Databricks2.8K views
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals by John Beresniewicz
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentalsDB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals

Recently uploaded

nintendo_64.pptx by
nintendo_64.pptxnintendo_64.pptx
nintendo_64.pptxpaiga02016
7 views7 slides
Playwright Retries by
Playwright RetriesPlaywright Retries
Playwright Retriesartembondar5
7 views1 slide
.NET Deserialization Attacks by
.NET Deserialization Attacks.NET Deserialization Attacks
.NET Deserialization AttacksDharmalingam Ganesan
7 views50 slides
Transport Management System - Shipment & Container Tracking by
Transport Management System - Shipment & Container TrackingTransport Management System - Shipment & Container Tracking
Transport Management System - Shipment & Container TrackingFreightoscope
6 views3 slides
Techstack Ltd at Slush 2023, Ukrainian delegation by
Techstack Ltd at Slush 2023, Ukrainian delegationTechstack Ltd at Slush 2023, Ukrainian delegation
Techstack Ltd at Slush 2023, Ukrainian delegationViktoriiaOpanasenko
7 views4 slides
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile... by
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...Stefan Wolpers
44 views38 slides

Recently uploaded(20)

Transport Management System - Shipment & Container Tracking by Freightoscope
Transport Management System - Shipment & Container TrackingTransport Management System - Shipment & Container Tracking
Transport Management System - Shipment & Container Tracking
Freightoscope 6 views
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile... by Stefan Wolpers
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
Stefan Wolpers44 views
tecnologia18.docx by nosi6702
tecnologia18.docxtecnologia18.docx
tecnologia18.docx
nosi67026 views
How Workforce Management Software Empowers SMEs | TraQSuite by TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuiteHow Workforce Management Software Empowers SMEs | TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuite
TraQSuite7 views
Understanding HTML terminology by artembondar5
Understanding HTML terminologyUnderstanding HTML terminology
Understanding HTML terminology
artembondar58 views
Introduction to Git Source Control by John Valentino
Introduction to Git Source ControlIntroduction to Git Source Control
Introduction to Git Source Control
John Valentino8 views
Mobile App Development Company by Richestsoft
Mobile App Development CompanyMobile App Development Company
Mobile App Development Company
Richestsoft 5 views
FOSSLight Community Day 2023-11-30 by Shane Coughlan
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30
Shane Coughlan8 views
How to build dyanmic dashboards and ensure they always work by Wiiisdom
How to build dyanmic dashboards and ensure they always workHow to build dyanmic dashboards and ensure they always work
How to build dyanmic dashboards and ensure they always work
Wiiisdom16 views

Designing for scale and resilience in the cloud 101

Editor's Notes

  1. You hear an awful lot about the “right” way to develop stuff in the cloud, usually peppered with things like “Netflix does x” or “Amazon does Y”. There is a lot of good information out there – but you need to take a lot of it with a pinch of salt. Very few of us are developing anything at the same scale as Netflix. Today, I am going to talk about two very simple things that are really your “101” for scale and resilience in the cloud. It’s a starting point that you can implement very easily on any cloud platform without making big changes to your existing code. These two things are, imo, the biggest, immediate difference in *mindset* compared to the on-premise mindset. I look at a lot of software that is already in the cloud – but most of it still has an “on-premise” mindset, so don’t dismiss what I have to say just because you are already cloud based. Of course there is a ton more you *can* do – just remember to assess what you actually *need* before building Netflix scale architecture to support a blog site. The things I am talking about today you should almost always do – even for very simple apps. If you are planning for millions of users then you are in the wrong talk. Please tune out for the next 14 minutes or so.
  2. In my business, we have been building software on Azure since 2011. Some of it large scale, some of it fairly small. We have had the chance to try out many of the technologies as Azure has introduced them and lived through Azure finding it’s feet. For several years we have also been an Azure Gold Partner and reseller, helping developers in other companies make the most of Azure. That means my colleagues and I get to go into companies, much like yours, to look at how they use Azure and give advice on how to reduce costs, increase scale or improve security. What I am talking about today are the two core lessons about designing for scale in the cloud that I have learnt over the last decade. I have various other talks coming up that go into much more detail about specific topics.
  3. 2:50
  4. The first constraint is that auto scale doesn’t respond quickly to web traffic. The problem is that in order to respond to an increase in web traffic, you have to measure the number of hits or the cpu/memory load over a period of time before you can make a decision; web servers constantly hit 100% CPU, for example, or very brief spikes in traffic. You need to measure it over several minutes, at least, before you auto scale. Once your web servers scale out, you now have all these extra servers hitting the database and that may start being overloaded. Databases can be a single point of contention and they don’t scale quickly, not even when done manually. Some database operations increase more than linearly with size. It can also be very expensive to scale database out; some cloud databases quadruple the cost for every doubling in performance. So, in reality, you need to predict spikes in traffic and scale out ahead of time. That can be costly and will still not save you when you have a sudden, unexpected increase in traffic.
  5. 5:45
  6. When a user “does” something, like place an order or register for an event or report an absence etc, this is how you’d write it. It’s easy. It doesn’t scale well. If there is a bug in your code, you lose data. If the external service is down, you lose data. If the database is overloaded, you lose data.
  7. My first rule is to take anything that is more than a simple read or write and put it on a queue for a background process to process. Anything that requires complex processing or talking to other services. [click] Traditionally, introducing queues into a system was a big decision because you now had to set up and manage a queue system. With Azure and other cloud providers, these are built-in, very cheap and rock-solid. [click] You can scale very rapidly based on the length of the queue. Typically you will have new servers up in less than one minute to handle the load. This is a huge resilience benefit as well; if there is a bug in your processing code or a backend service is down, you can fix and just replay the message – no data is lost; if did the processing inside the web app, you will irretrievable lose the data. For fun, last time I taught someone to add an Azure queue and set up a function to do background processing, the whole thing including setup and coding took 57 minutes end-to-end.
  8. 9:20
  9. In a traditional system, you typically have a single database that does everything for you. That makes sense, because you have to look after everything. In the cloud you usually have different data storage – persistence – tools available to you. The trick is to use a mix of them in way that makes sense. For example, you may offload some types of “cold” data to another model or you may pre-process responses and store them in a faster persistence system so you can respond to users without having to run complex queries on the main database. Blob storage and table storage, in particular, are worth looking at. They are completely useless as a general database, but they are exceptionally cheap and fast for the right usecases.
  10. 10:40
  11. If you need to scale up to the millions of users then you obviously need much more advanced patterns. There are many of them and we use a few of them, such a as Kubernetes clusters, actor models and other things. But, for most systems, the stuff I have covered here is more than enough – and is in any case a good starting point. Don’t do more than you need to.
  12. 13:55 As I mentioned above, my company is an Azure partner and reseller. If there is anything I have said today that has piqued your interest or you just need to talk to somebody about reducing cost, improving security or scaling better in Azure, feel free to contact me. We love to talk about Azure. We are not primarily a consultancy and we often given an initial consultation for free so you can try us out.