iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📖

re:Invent 2023: AWS Resilience Analysis Framework - Theory and Practical Examples

に公開
2024/09/19

Introduction

By transcribing various overseas lectures into Japanese articles, we aim to make high-quality, hidden information more accessible. In this project, which proceeds with that concept in mind, the presentation we are covering this time is here!

📖 AWS re:Invent 2023 - A consistent approach to resilience analysis for critical workloads (ARC313)

This video provides a detailed explanation of the AWS Resilience Analysis Framework (RAF). Starting with the story of the "missing bullet holes" from World War II, you can learn the theory and practical application of RAF. Through customer case studies, we introduce specific resilience improvement measures such as the constant work pattern and hedging. Furthermore, we explain examples of RAF implementation in AWS services, such as AWS Route 53 Application Recovery Controller and Zonal Shift. It is a valuable session that provides a new perspective, viewing resilience as a "journey, not a destination."
https://www.youtube.com/watch?v=fEOeP08cQdk
This article was automatically generated from the video. Please note that there may be typos or incorrect content, so please watch the original video for accurate information.

Main Content

AWS Resilience Strategy: Introduction to Application Recovery Controller

Thumbnail 0

Welcome to ARC 313. I am John Formento, Jr., and I am a Principal Product Manager on the Resilience Infrastructure and Solutions Team at AWS. We develop the Application Recovery Controller as one of our services. It's great if you are familiar with it, and for those who aren't, I highly recommend checking it out. This is a recovery tool that supports resilience. I am happy to have Mike Haken and Mike Golovnykh join me as co-presenters today. They will introduce themselves when they come on stage.

Thumbnail 30

First, let's start with some housekeeping. We recently released the AWS resilience lifecycle framework. You can access the whitepaper by scanning the QR code. This framework was developed in response to many customer inquiries about where to start their resilience efforts. The whitepaper outlines the steps of the framework that you can use. In today's session, we will focus on the design, implementation, and operational phases of that lifecycle.

Thumbnail 60

I want to briefly highlight the wide range of resilience-oriented services AWS offers. I won't go into detail on each one, but I encourage you to take a photo of the ones you're interested in and look them up. However, I will specifically mention the Application Recovery Controller. It is definitely worth checking out.

Learning the Importance of Resilience Analysis from "Missing Bullet Holes"

Thumbnail 80

As we begin the presentation, has anyone heard the story of the "missing bullet holes"? A few people have, that's great. This isn't a story I knew until my colleague Mike told me about it a few months ago. It's about the P-38 Lightning long-range fighter aircraft during World War II. The U.S. government needed these planes to stay in the air and return safely after combat missions. The challenge was to increase their durability without compromising the planes' maneuverability or fuel efficiency.

Thumbnail 150

The government tasked the Statistical Research Group, a team led by the brilliant mathematician and statistician Abraham Wald, with this challenge. They addressed the problem of where to add armor to improve the aircraft's survival rate while maintaining performance. The team was provided with data showing the distribution of bullet holes on aircraft that returned from missions.

Thumbnail 180

The initial thought was to add armor where the bullet holes were most concentrated. However, Wald questioned this assumption. He approached it mathematically, taking into account that planes hit in critical areas like the engine or the pilot's compartment didn't come back at all. By setting the survival probability of hits to these parts to zero, he revealed the distribution of "invisible" bullet holes that should have been on the planes that didn't return.

Thumbnail 240

This analysis led to a counterintuitive solution: add more armor to the parts where there were fewer bullet holes on the returning planes. This is because these were the critical parts where being hit would be fatal. This approach significantly improved the survival rate of the aircraft. This lesson applies to our systems as well. We need to look beyond the surface, understand where our systems' true vulnerabilities lie, and make well-informed trade-offs to build resilience effectively.

Overview and Importance of the Resilience Analysis Framework (RAF)

Thumbnail 270

This leads us to the Resilience Analysis Framework. This framework is the result of integrating insights from customer interactions over the past year and internal discussions on improving system resilience. We defined a model that examines common observed failure modes and failure categories. I will explain the theory of this framework and the steps necessary to analyze your system. Afterward, Mike Haken will introduce real customer scenarios where this framework was applied to implement corrective and preventive measures to improve system resilience. Then, Michael Golovynkh will explain how the Application Recovery Controller team operationalized this framework.

Thumbnail 320

You might wonder why this is important. This QR code leads to a white paper that contains more details than what is described here. This framework is important because it provides a reproducible process for assessing and strengthening workload resilience. It can be applied consistently across an organization and operationalized on a weekly, monthly, or quarterly basis as needed. Mike will explain more about the implementation.

Thumbnail 380

Thumbnail 390

This framework leads to a recovery-oriented architecture that considers mitigation measures capable of addressing specific failure categories and multiple failure modes within those categories. It also helps align mitigation measures and observability strategies with your resilience goals. We started by identifying the resilience characteristics required for the workload. The first is fault isolation, intentionally creating boundaries to limit the blast radius of potential failures. Next is sufficient capacity, ensuring we can handle the demand placed on the workload, such as CPU cycles, memory, and other resources.

Thumbnail 400

Thumbnail 410

Thumbnail 420

Thumbnail 430

Thumbnail 440

Timely output is also required. This means the client receives the result within the expected timeframe. This is the difference between an application being perceived as unavailable because it exceeded the client's timeout, or receiving a response within an appropriate timeout. Accurate output is also extremely critical. We need expected results from the system. Sometimes, an inaccurate or incomplete result is worse than no result at all. Finally, there is redundancy. Having backup components is often better than relying on a single point of failure.

Thumbnail 460

Based on these desirable resilience characteristics, we created the SEEMS model: Shared fate, Excessive load, Excessive latency, Misconfiguration and bugs, and Single point of failure. Each of these failure categories violates one of the resilience characteristics. Shared fate spreads across fault isolation boundaries, potentially expanding the blast radius. Excessive load can infringe on sufficient capacity, such as through unexpected traffic spikes. Excessive latency can appear in various forms, such as network device failures or slow hardware, impacting timely output.

Thumbnail 550

Misconfiguration and bugs are likely the most common failure category and can lead to unexpected output. This could be caused by deployment failures, incorrect security group changes, or issues with EC2 host patching. Finally, a single point of failure is a component that, if it fails, could render the entire system unavailable. We aim to minimize these in our systems. Now that we understand the failure categories and the desired resilience characteristics, the first step in using this framework is to understand your workload.

Understanding Your Workload: The First Step of RAF

Thumbnail 560

This is an example of an in-app purchase validation solution built on AWS. Typically, we start with an architecture diagram that shows data flows or the transaction lifecycle in numbered steps like this. We also break down the system into atomic user stories that represent different functions the system provides. This example is relatively simple, with only a few services and two flows. However, you can imagine that for an e-commerce website or a retail banking website, the user stories would be much more extensive. In this case, we have user stories for in-app purchases and refunds.

Thumbnail 620

This approach allows us to prioritize the user stories that are most valuable to the business and focus our resilience analysis efforts accordingly. We are not trying to boil the ocean. We can make meaningful progress in our analysis work. This is the first step: understand the workload and identify where to focus your efforts.

Thumbnail 640

Thumbnail 650

Within these user stories and diagrams, you must be sure to clarify the following four elements. The first is code and config. You can think of this as application code and the various settings used in the system. The second is infrastructure, which encompasses many AWS services, on-premises components, or anything that powers the system. The third is data sources, which include databases, EBS volumes, and everywhere data is stored. Finally, the fourth is external dependencies. This includes utilizing APIs provided by other teams within the organization or third-party APIs such as ISVs. For example, if your system needs weather data, that is classified as an external dependency.

Thumbnail 690

The main goal here is not necessarily to list every single database component. Rather, it is important to grasp the positioning and interrelationships of these components as you think about, diagram, and understand the system. You will utilize this as part of your analysis. By doing this, you can understand, model, and diagram the workload, and gain a shared understanding across your entire workgroup.

SEEMS Model: The Relationship Between Failure Categories and Resilience Characteristics

Thumbnail 700

Thumbnail 710

Thumbnail 730

Next, we need to think about how to apply this framework—the SEEMS model—to our workload to mitigate potential failures. After you start asking questions about failure modes, the first step is to determine the necessary trade-offs. This is the same as what Abraham Wald did with the aircraft. In our systems, we usually have factors of cost and effort. As I mentioned earlier regarding redundancy, adding replicas or spares increases costs. It also takes effort to implement advanced fault-tolerance patterns, some of which Mike will introduce in a few minutes.

Thumbnail 750

It also increases complexity. You might need to deploy advanced CI/CD systems in a specific way to reduce configuration errors and bugs, or you might need enhanced observability to understand different failure modes and detect leading indicators rather than just lagging ones. Operational burden also increases, requiring more sophisticated runbooks, on-call processes, and ensuring that teams truly understand what to do when an event occurs. These are all trade-offs that must be made for mission-critical systems.

Thumbnail 770

Thumbnail 790

Finally, there is consistency and latency. Often, these systems start considering multi-region approaches or DR strategies. And usually, when you start thinking about the CAP theorem and asynchronous replication, you face a trade-off where you prioritize consistency over availability, which is a trade-off that needs to be carefully considered. Now, we have looked at SEEMS and failure categories, begun to consider the workload and understand how these failure modes manifest, and examined the trade-offs when implementing mitigations.

Then, the next thing you need to think about is: when you consider a specific failure mode, what is its probability of occurrence? Should you invest time in this particular failure mode? Probability refers to the likelihood that it can happen. For example, if you have an EC2 instance, you will likely patch it during its lifetime. You will also perform maintenance. At some point, something might go wrong, and there is a fairly high probability that the instance will become unavailable. On the other hand, if you are using RDS and have multiple replicas, the likelihood of it becoming unavailable is low because if an issue arises, the replicas take over and continue to function without problems.

Thumbnail 870

Another factor is impact. You need to understand the damage, or the reputational and commercial losses, if that failure mode were to manifest. By considering both the probability of occurrence and the impact, you can determine which failure modes to focus on and whether to continue developing countermeasures for them. What I want to show here is that there is usually a law of diminishing returns. You can improve resilience to a certain point by investing time and effort. While considering those trade-offs, as you approach the top of the curve, you will usually focus on more important systems. For example, if you have an internal directory for searching employees, you probably don't need to spend much time and effort making it highly resilient. However, for a system that is critical to your business and generates a lot of revenue, you will need to focus more on resilience, particularly paying attention to the critical user stories that drive your business.

Failure Mode Analysis and Mitigation Strategy

Thumbnail 900

The next step, after you have identified the failure modes and understood where to focus, is to think about how to observe them.

It is important to have both leading and lagging indicators whenever possible. Leading indicators alert you that something in the system is changing and that you are approaching a threshold that could lead to availability issues, even though the problem hasn't occurred yet. For example, by monitoring the number of database connections and understanding that you are approaching a certain threshold, you can implement throttling or terminate the least used connections to prevent potential problems. An example of a lagging indicator is an alarm regarding database connection failures. If possible, it is desirable to be able to utilize both types of indicators.

Thumbnail 960

Once you understand how to observe them, you need to think about how to mitigate them. There are two general approaches: preventative or corrective. Preventative means taking measures to prevent the occurrence of failures or malfunctions. This can be thought of as implementing throttling or load shedding to prevent excessive load on the infrastructure, ensuring that the system does not end up in a situation where it is completely unavailable. An example of a corrective mitigation is to proactively initiate auto-scaling to add capacity if you see an increase in traffic and predict that excessive load will occur in the next 24 hours.

Thumbnail 1000

Now, I will hand it over to Mike to share customer case studies. Mike will introduce examples from his experience and explain how he actually used the analysis framework to define resilience threats and find mitigation strategies for these customer scenarios.

Metadata Problem: Solving with the Constant Work Pattern

Thumbnail 1050

Thumbnail 1090

The first example is about a workload that had metadata problems. They had a large interactive fleet and a sharded database. Each node of that sharded database was responsible for a different dataset. The database was not fixed in size as it was re-sharded as it grew. This system also had a metadata database that managed the shard maps.

Thumbnail 1120

Thumbnail 1130

Thumbnail 1150

The container itself, the software, was lazily loading mapping data from the metadata database. When it received its first request, it would access this metadata database to get the mapping and connect to the necessary database. We wanted to consider the issue of excessive load. In a normal scenario, a user says "I want to look for Smith," goes to the worker fleet, and the fleet accesses the metadata database. The database mapping is returned, and it is known that Smith is on DB4 because of the letter S. Then, it connects to that database.

Thumbnail 1190

Thumbnail 1200

However, what happens if users suddenly flood the system? A large number of people show up at once, everyone tries to search, and all worker nodes try to connect to the single metadata database, causing it to crash. They had a very plausible excessive load scenario that could bring down this entire system and make it unrecoverable. So, what we proposed was to consider a pattern called constant work. Instead of searching for the metadata when a request is received, you can have all these nodes in the worker fleet pull the mapping from something like an S3 bucket every 60 seconds.

Thumbnail 1210

In this approach: They continuously do the same thing. This removes the unexpected load because they are always repeating the same action. Therefore, regardless of the number of customer requests, the load on the metadata service does not change.

Thumbnail 1230

Constant work has several benefits. It provides consistent, predictable performance and brings a property called antifragility. This means that when something goes wrong, when something breaks, you actually do less work. In other words, when a problem occurs in the system, you reduce the workload instead of increasing it. Constant work could help solve the problem of excessive load on the metadata database.

Multi-Region Synchronous Replication Challenges and Asynchronous Replication Proposals

Thumbnail 1260

However, as John mentioned, you must consider trade-offs when trying to improve resilience. One of the trade-offs of constant work is that it can potentially lead to wasted effort. You end up doing a lot of work even when there are no changes. Therefore, you need to consider and understand the potential increase in costs. Because every request has a cost, and data transfer also has a cost. Here, you need to consider the trade-offs. Is the resilience improvement gained by implementing constant work to solve this problem worth the trade-off? This is the first example.

Thumbnail 1300

Thumbnail 1310

Thumbnail 1330

The next example is a customer case that wanted to build a multi-region synchronous replication system. They wanted to achieve an RPO of zero, meaning zero data loss between regions. They planned to use multi-region synchronous replication spanning three different regions. John mentioned CAP earlier, but has anyone heard of the CAP theorem? The CAP theorem states that there are three properties: Consistency, Availability, and Partition tolerance, and that only two can be met at the same time. In most distributed systems, because there are multiple servers or components, you are forced to accept partition tolerance. That means you have to trade off and choose between consistency and availability.

Thumbnail 1380

However, this customer was trying to overcome the CAP theorem. They said that if a failure occurs, meaning one of these becomes unavailable, they would restore availability by removing the failed region from the configuration. This is because in a synchronous replication scheme, if one of the nodes fails, the entire system fails. Therefore, they wanted to update the configuration at runtime in case of failure. When that region recovered, they intended to sync the data back to the failed region. In other words, in any case, there would be inconsistency for a certain period. They were trying to achieve all of this at the same time.

Thumbnail 1390

Thumbnail 1400

Thumbnail 1420

As a result of our review, we found that this would become a very complex and fragile system. So, we wanted to test the cascading failure part. Is there a shared fate? So we looked at how this replication would affect fault isolation. Here, we have three regions, Region A, B, and C, using synchronous replication. And if something happens in Region B, for example, that database node fails, and a user tries to perform a write in Region A, they cannot. This operation fails. In other words, a cascading failure from Region B to Region A is occurring.

Thumbnail 1440

Thumbnail 1450

Thumbnail 1470

So what they were trying to do was remove the failed node from the replication configuration. Then, this database would be in an inconsistent state until it recovered and caught up. Instead, we proposed the following: If you truly need fault isolation and want to avoid cascading failures, you can use asynchronous replication. By doing this, even if a problem occurs in Region B, you can perform writes in other regions. You can perform a write in Region A and replicate it asynchronously to Region C. And when Region B recovers, it needs to perform replication to catch up, but eventually, it will return to a caught-up state with the minimal lag of asynchronous replication.

Thumbnail 1490

They planned to use asynchronous replication to achieve fault tolerance across these regions and prevent cascading failures. This reduces latency because you don't have to wait for every write to be replicated to both regions.

Thumbnail 1520

Asynchronous replication provides faster performance and improved availability. Even if one region fails, you can continue to perform writes and reads in the remaining regions. However, the trade-off here is consistency. We made a trade-off regarding consistency and recognized that an RPO of zero cannot be achieved in such scenarios. You have to deal with some level of inconsistency. We made this decision because the original design already assumed an inconsistent state. Even if one of the nodes failed, it would have needed to catch up anyway.

Thumbnail 1560

We decided to accept the possibility of this data inconsistency. This is not actual data loss. That data remains in the database of the primary region where it was written. However, if a failover becomes necessary, you might have to deal with periods where all data is unavailable. This was one of the trade-offs we had to make.

Leveraging Hedging in Distributed Storage Systems

Thumbnail 1570

Thumbnail 1580

Thumbnail 1590

Let's look at example 3: a distributed storage system. In this service, data is sharded across multiple storage nodes. Data is replicated between these nodes. Read requests issued by system users can reach any of the replicas. Requests are usually routed from the frontend request router to a random storage node. So, how does this work? When a user performs a read, it reaches one of the storage nodes. When they perform a second read, it reaches a different node.

Thumbnail 1610

But what if one of these nodes is slow? We thought about what would happen if the system has excessive latency. This storage node at the bottom could have a hard drive error or an issue with its CPU or memory. For some reason, it is responding much slower than the other storage nodes. As a result, a certain percentage of reads are clearly slower than others. In other words, the tail latency (p90, p99, p99.9, etc.) becomes significantly higher compared to the other nodes.

Thumbnail 1650

Thumbnail 1670

We proposed using a pattern called hedging to reduce tail latency. Hedging is a method where you send requests in parallel and have them compete against each other. Here, we still have that slow storage node, but we send two read requests in parallel. You can see that the top request is significantly faster than the bottom one. With hedging, we only take the fastest response. Therefore, even if the slow storage node responds with high tail latency, we don't actually need to care because we are getting a faster response from the other request.

Thumbnail 1690

Thumbnail 1720

Hedging gives us the ability to reduce tail latency. It also hides transient faults. Because whether a storage node is slow or completely unavailable is exactly the same to the client. Since we are only looking at the first response, we don't know if that node was slow or simply didn't respond. The challenge with hedging is that, as a trade-off, additional work is generated. For a single read request, depending on the degree of hedging, you will be making two or three requests. Therefore, additional work is generated, and there is a potential for cost increase.

Another thing you must be very careful about with hedging is that those requests must be idempotent. Idempotent means that no matter how many times you issue a request, you always get the same result. Read requests are inherently idempotent, so we can deal with this regarding reads. Some write requests or requests that make changes are idempotent, while others are not. Therefore, you need to be careful when implementing hedging in your system.

Improving Multi-AZ Deployments: A Fault Isolation Approach

Thumbnail 1770

Thumbnail 1780

Thumbnail 1790

Let's look at the fourth example: Multi-AZ deployment. There is a system architected to use three Availability Zones. For this customer, the speed of deployment was a priority. The deployment targets instances in each AZ simultaneously. They had built a system that relied on the success of a pre-production environment to validate deployments. However, what we actually discovered is that many customers' pre-production environments do not accurately reflect their production environments. Does anyone here have a true pre-production environment that accurately reflects their production environment? It looks like three or four hands are raised. Most customers experience some discrepancies between environments.

Thumbnail 1830

This discrepancy can cause problems when a deployment fails. A bad change, an environmental issue, or something missed can cause the deployment to fail, and if you push to deploy that change, it simultaneously impacts all three Availability Zones. This leads to a massive outage. We needed to ask whether the changes being made—those deployment units—were at least as small as the intended fault isolation boundaries. Here, the Availability Zone provides a fault isolation boundary. We do not assume that a failure in one Availability Zone will cascade to others. If an instance fails in one AZ, it does not impact instances in other AZs.

Thumbnail 1870

Instead, we considered whether it was possible to align the deployment units with Availability Zones. When pushing and deploying a change, it is applied to one Availability Zone. If there is a problem with that deployment and a failure occurs there, you have several options for fixing it. If you are building an AZ-isolated architecture—meaning you keep all traffic within the AZ—you can use something like Zonal Shift to move traffic away from the problematic AZ and recover quickly before rolling back the deployment. Even if you are not building such an architecture, it is possible to initiate an automatic rollback based on specific metrics or alarms.

Thumbnail 1910

What is important here is that the remaining two Availability Zones have not been changed and are not experiencing failures. This does not necessarily mean a complete failure, nor does it mean all instances were changed at once. However, it is possible that instances in each AZ were changed simultaneously, which could expand the scope of failure impact. If the deployment is successful, you can proceed one AZ at a time, using dependency and gate checks before proceeding to deploy to the next Availability Zone.

Thumbnail 1950

Thumbnail 1970

By using fault-isolated deployments, you get a predictable deployment failure impact scope. You know that the impact scope is always limited to the size of a single Availability Zone. This helps in maintaining the customer experience. By quickly rolling back or shifting traffic away from the failed deployment unit, you can maintain the customer experience you were trying to provide without causing a large-scale outage. However, there are trade-offs. The deployment might be slightly slower. You need to deploy to one entire AZ at a time, monitor, inspect, and verify that everything is healthy before moving on to the next AZ.

This approach makes orchestration somewhat more complex. You need to configure your CI/CD system to be aware of which AZ it is deploying to. This can be achieved using AWS CodeDeploy and tags. If you tag all instances with their Availability Zone ID, you can configure individual deployments for each. However, orchestration within the CI/CD system can be a challenge.

Improving E-commerce Site Resilience: Implementing Graceful Degradation

Thumbnail 2020

Thumbnail 2030

Thumbnail 2040

Thumbnail 2050

As a final example, let's look at an e-commerce site with multiple dependencies. This site uses multiple backend services to serve content to web pages. Not every microservice is critical for the customer experience. However, with current web services, each component needs to load to render the entire page. This is our web page. Very fancy, right? It has product images, which call one microservice. It has an "add to cart" feature, which is another microservice. It has suggestions for products often bought together. It has a section for items you might be interested in. And finally, it has new promotions.

Thumbnail 2060

Thumbnail 2090

However, if the new promotions microservice fails, the entire website fails to load. This is not a good customer experience. This is not what we want. Instead, if all these microservices load normally, we can provide the important user stories. The most important thing is that the customer can see the item they want to buy, add it to the cart, and check out. Therefore, if the new promotions are unavailable, we simply don't display them instead of failing the entire web page load. This is the concept of graceful degradation. Even if system components become slow or unavailable, you can degrade functionality gracefully.

Thumbnail 2100

Graceful degradation helps prevent cascading failures. As we have seen, we want to avoid situations where the failure of one component causes the failure of other components or the entire system.

Thumbnail 2120

This approach is particularly important for critical features. For instance, you want to avoid a failure in the new promotions widget impacting the checkout process or other important operations. By implementing graceful degradation, you gain the ability to provide a partial customer experience even if specific components fail.

However, you must consider the trade-offs. Implementing graceful degradation requires a deep understanding of dependency interactions. Understanding the dependency map of the entire service and tuning it to degrade gracefully is a difficult challenge. You must thoroughly verify how all components interact.

Thumbnail 2150

Those were actual customer examples where we used the analysis framework to identify resilience gaps and propose mitigation strategies to address them. Now, I will pass it over to Mike, who will talk about resilience analysis at AWS.

Implementing RAF at AWS: Lessons Learned and Criteria for Adoption

Thumbnail 2200

Thank you, Mike. My name is Mike Golovnykh, and I am a Senior Software Engineer at AWS, working in the Resiliency Infrastructure and Solutions Organization. Today, I will talk about how our team implemented the RAF within our organization, the lessons we learned, and most importantly, help you decide whether you should implement RAF in your own organization.

Thumbnail 2220

One of the services where we implemented RAF is the routing control for Amazon Route 53 Application Recovery Controller. Customers use routing control to recover applications from regional infrastructure or application failures. It is used to initiate failovers and update DNS records quickly and reliably. Routing control provides 100% SLA and is designed to operate even in extreme scenarios, such as when two regions are experiencing failures or one region is partitioned from the others.

Thumbnail 2280

Another service where we implemented RAF is zonal shift, which is also part of the Application Recovery Controller. This helps customers recover applications from failures within a single Availability Zone. Zonal shift is free and integrated with AWS Elastic Load Balancing, making it easy to move traffic away from a faulty Availability Zone without depending on a control plane.

In a typical multi-AZ application, if the error rate is rising in AZ3, customers can use the zonal shift API to redirect traffic from EC2 instances in AZ3 to other Availability Zones. Under the hood, zonal shift does not depend on a control plane and updates Amazon Route 53 DNS records with a constant amount of work. This means it functions regardless of the customer's request count or application scale.

Zonal shift operates at scale, managing millions of load balancers and resources. It provides value while running in an impacted region during an Availability Zone failure. Operating such a service and continuously building functionality is difficult, so we chose to proactively address the resilience of our service by applying RAF.

Thumbnail 2420

To be proactive about this resiliency, we need to consider various aspects. As John mentioned, resilience comes in all shapes and sizes, from airplanes to applications. In the case of zonal shift, it must function when an Availability Zone fails. That is what matters. Customers must be able to rely on zonal shift even when other parts of AWS services are experiencing failures.

Thumbnail 2450

For many applications, the biggest resilience concern is availability, which is often measured by failure rate. However, that is not the case for zonal shift. While the number of 500 errors is certainly important, we prioritize the ability to initiate zonal shifts. If the first request to initiate a zonal shift fails, it might be acceptable if the second request—the first retry—succeeds. It is important to understand what is truly critical for your application.

Thumbnail 2500

Thumbnail 2530

Of course, it is not simple. Durability, consistency, upstream availability, downstream availability—first, you must clearly define your customer's workload and work backward from what is critical for resilience. The process we institutionalized in my organization is to have meetings every two weeks. There is a set agenda, but we also have a facilitator responsible for adjusting this agenda to suit specific meetings or conversations. While product team members also attend the meetings, the process is led and owned by the engineering team.

Thumbnail 2570

Thumbnail 2610

As we move forward with this process, a lot of documentation is created. At Amazon, we believe that a culture of documentation is important. By creating failure mode documents and taking time for the team to review them, we understand the issues more deeply than by just talking about them. You might think, "This RAF is a heavy process and documentation." And you are right. RAF requires a significant investment of engineering effort. However, if you are operating critical applications that must work reliably at all times, if your application is complex with various dependencies, and if you are dealing with constantly changing customer traffic, it is worth considering.

Thumbnail 2650

Let me ask you a question: In your software development lifecycle, do you set aside time to proactively think about resilience after the application launch? There is no doubt that we all conduct post-mortems after events. One of the reasons my team institutionalized RAF was that we wanted a way to think more proactively about the resilience of critical services.

Thumbnail 2690

We remind ourselves that resilience is a journey, not a destination. It does not mean you are done once you have designed for it. So, what did we learn from this implementation of RAF?

Thumbnail 2710

It is no surprise that, like any other initiative, RAF requires executive-level support. RAF also requires engineers who have the willingness and ability to dive deep into hypothetical scenarios and reason about them. Naturally, this leads to staffing your team with the right people who have a passion for resilience.

Thumbnail 2750

We learned that RAF is as much a process for engineers as it is for stakeholders. RAF helps engineers learn about system behavior and cultivate a resilience mindset. RAF is most effective when integrated into operations and feature development processes. However, you also need to invest resources not just in running the program, but in improving the system in the areas the team has identified as most critical.

Thumbnail 2810

Let me share an example from my team. One day, an on-call engineer mitigated a deployment issue in one of our application component environments. While mitigating that issue, they noticed that the root cause lay in an intermittent failure of a low-criticality dependency. The engineer pointed this out in a regular RAF meeting. After reviewing and discussing the failure mode document with the team, we realized that the potential for this low-criticality dependency to reduce the application's ability to scale up quickly was higher than we had initially thought. This meant that the risk of that specific failure mode was higher than the initial assessment.

Thumbnail 2900

As a result, we prioritized the work to remove this low-criticality dependency from the application's critical path. Without RAF, this risk would likely have persisted with us for much longer.

Thumbnail 2910

So, let's summarize the main points. If you are operating mission-critical applications and place a high value on keeping them reliably up and running at all times, RAF might be right for you. Even if your architecture follows best practices, you have well-designed Standard Operating Procedures (SOPs), and you have excellent operators, your application is likely complex. It responds to ever-changing traffic patterns driven by various customer behaviors and deals with various dependencies.

If you find value in thinking about resiliency in advance and agree with the idea that resiliency is a journey, not a destination, you should consider adopting RAF. Believe that once adopted, your team will find opportunities to improve the application, and the team will look forward to you taking advantage of those opportunities.

Thumbnail 2990

Thank you for listening.


  • This article was created entirely automatically by utilizing Amazon Bedrock for various tasks.
  • I plan to write about the trial-and-error process of creating this article at some point, but if you are interested in the technical aspects in the near future, please DM me on Twitter.

Discussion