How to measure resiliency? RTO, RPO, MTTR and SLA - Part 2
Measure resiliency with RTO, RPO, MTTR and MTBF, and calculate the composite and overall SLA of an application with an example.
How to measure resiliency? RTO, RPO, MTTR and SLA - Part 2
We can’t improve what we don’t measure, and resiliency is no exception. “The application should be highly available” means different things to different people; for the business it may mean “never down”, and for the team it may mean “back within a day”. Metrics like RTO, RPO and SLA turn this into numbers which the business and the team can agree on, and these numbers decide which DR strategy we need and how much it will cost. In the previous article, we discussed what resiliency is, the difference between HA, DR and backup, and the principles we follow. In this article, we are going to see the recovery metrics, the availability metrics, and how to calculate the SLA for an application.
DR Guidelines series:
- What is resiliency and why do we need a DR strategy?
- How to measure resiliency? RTO, RPO, MTTR and SLA (this article)
- What are the DR strategy patterns and how to choose one?
- How to implement DR for Azure resources?
- How to define a DR strategy for your application? A worked example
TL;DR Summary
- RTO (Recovery Time Objective) - how soon the system should recover from an outage.
- RPO (Recovery Point Objective) - how much data loss is tolerable.
- MTTR (Mean Time To Recover) - the average time to restore after an outage; MTBF (Mean Time Between Failures) - the average time between major outages.
- SLA (Service Level Agreement) - the availability commitment; for an application on Azure, it is a composite of all the Azure resources it uses.
- Overall SLA = Infrastructure composite SLA × Application SLA, where the application SLA comes from the actual downtime (sum of actual RTOs).
Recovery Metrics
RTO - Recovery Time Objective
RTO defines how soon the system should recover from an outage. In other words, it is the maximum acceptable time the application can be down.
Our recommended RTO targets are,
- Web App/API/Web Job - 30 mins, but it is subject to vary from app to app
- Static sites - 10 mins
RPO - Recovery Point Objective
RPO defines how much data loss is tolerable, and it completely relies on how frequently we are taking backups of the data/file stores or replicating the data across regions.
Our typical RPO values for database and file storage are,
- One hour for restore from geo-replicated backups, but it is subject to vary from app to app
- 5 seconds for auto or manual failover groups
An everyday analogy helps here. Think of writing a long document. RPO is “how often do I press Save?” - if the laptop crashes, you lose everything since the last save. RTO is “how long does it take to get a working laptop and open the document again?”. Both matter, and improving one doesn’t improve the other.
Must Consider: Define the RTO and RPO with the business, not only within the team. Lower RTO and RPO values need more expensive DR strategies, as we will see in the next article.
Availability Metrics
MTTR - Mean Time To Recover
MTTR is the average time to restore an infrastructure or application after an outage, and it is usually measured in hours.
For example, MTTR is one hour when 12 outages were recovered in one hour each.
MTBF - Mean Time Between Failures
MTBF is the average length of time between major outages, and it is usually measured in months.
For example, MTBF is one month when 12 outages happened for an application during a year.
RTO is the target, and MTTR is what actually happened. When MTTR is consistently higher than RTO, our DR strategy or its automation is not good enough. MTBF, on the other hand, tells us how often we are going to exercise the DR plan, and it helps to justify the investment in HA.
SLA - Service Level Agreement
A Service Level Agreement is a commitment between a service provider and a client on availability (it also includes quality and responsibilities). In this context, it refers to the availability commitment.
Since we are using Azure, Microsoft provides its own SLA for each resource. So, when we calculate the SLA for our applications, we should include the SLA of all Azure resources that are used as part of the application, and this is called the Composite SLA.
Composite SLA
Composite SLAs involve multiple services supporting an application, each with differing levels of availability. For example, consider an App Service web app that writes to Azure SQL Database. At the time of this writing, these Azure services have the following SLAs,
- App Service web apps = 99.95%
- SQL Database = 99.99%
What is the maximum downtime you would expect for this application? If either service fails, the whole application fails. The probability of each service failing is independent, so the composite SLA for this application is 99.95% × 99.99% = 99.94%.
Notice that the composite SLA is always lower than the SLA of the weakest component. Every resource we add to the request path reduces the overall availability, unless we add redundancy for it. For more information, refer to the composite SLA section in the Azure Architecture Center ([link: confirm URL]).
How to calculate the SLA for an application?
The composite SLA only covers the infrastructure. Our own application also has downtime, for example the time it takes to fail over to the secondary region. So, we calculate the overall SLA as follows,
Application Downtime = Sum of actual RTOs
Application SLA = (100 / time window) * (time window - application downtime in hours) %
Overall SLA = Infrastructure Composite SLA * Application SLA
Example
Assume our application uses the following Azure resources,
| Resource | SLA (%) | High availability enabler | SKU |
|---|---|---|---|
| App Service Plan | 99.95 | Global scale | Standard or above |
| SQL MI Instance | 99.99 | Shared resource/replicas | General Purpose or above |
| Storage Account | 99.99 | Zone redundancy | V2, ZRS or above |
| Redis Cache | 99.9 | Replicas/clusters | Standard or above |
| Composite SLA | 99.83 |
Assume 2 outages happened in a year, and with the Redeploy strategy the RTO is 2 hours and the RPO is 1 hour.
Downtime for 2 outages = 2 * 120 mins = 4 hours
Application SLA = (100 / 8760) * (8760 - 4) = 99.95 %
Overall SLA = 99.83 % * 99.95 % = 99.78 %
What does 99.78% mean in downtime?
Percentages hide the real impact, so it is always better to translate the SLA into downtime. The following table shows the allowed downtime for an overall SLA of 99.78%,
| Time window | Total hours | Outage in mins | Outage in hours |
|---|---|---|---|
| Week | 168 | 22.18 | 0.37 |
| Month | 720 | 95.04 | 1.58 |
| Year | 8760 | 1156.32 | 19.27 |
So, 99.78% allows about 19 hours of downtime in a year. When the business expects less than that, we need a DR strategy with a lower RTO or more redundancy in the infrastructure.
Wrap up
In this article, we have looked at the recovery metrics (RTO and RPO), the availability metrics (MTTR and MTBF), and how to calculate the composite SLA and the overall SLA for an application with an example. I really appreciate that you took the time to read this article. In the next article, I will walk you through the DR strategy patterns, from redeploy to active-active, with their architecture, RTO, RPO and when to choose each one.
Related Posts
Disaster Recovery (DR) on Azure - RTO, RPO and backups
Azure disaster recovery explained through RTO, RPO, point-in-time restore, geo-restore, Azure Backup, Site Recovery and tested recovery strategies for practical guidance.
What is resiliency and why do we need a DR strategy? - Part 1
What resiliency is, why we need a DR strategy, how high availability, disaster recovery and backup differ and the principles we follow.
How to define a DR strategy for your application? A worked example - Part 5
Define a DR strategy for your application with a worked example: the process to identify the strategy, a worked example and the DR lifecycle.