# Resilience and multi-region design on BTP: what SAP covers, what you design, and what it costs

> Decide how each BTP workload survives losing a zone or a whole region, what SAP's SLA and disaster recovery cover, and when a second region is worth paying for.

- Course: Orchestrate, Unit 21 · SAP BTP as a platform
- Page: https://erpfde.com/topics/btp-resilience-and-multi-region/
- Updated: 2026-11-27
- Reading time: Foundational 8 min, Deep 40 min

Independent learning resource. Not affiliated with, sponsored by or endorsed by SAP SE. SAP and other SAP products mentioned are trademarks of SAP SE in Germany and other countries.

## Foundational layer

### The 60-second version

Every cloud service fails sometimes. A disk dies, a data center loses power, a software update goes wrong. **Resilience** is how much of that your business notices.

SAP Business Technology Platform (BTP) runs in **regions**, such as US East or Europe (Frankfurt). Each region is built from several **availability zones**: separate data centers with their own power, cooling and network. SAP spreads its own platform services across zones, so losing one zone is usually survivable. Your own apps survive it only if they are built to: two or more running copies, a database with a replica in another zone, health checks that restart what hangs.

Losing a **whole region** is rare but real, and SAP doesn't fail your apps over to another region for you. If a workload must keep running through that, your team designs it: a second subaccount in another region, data copied there, and one web address that can point to either side. That roughly doubles what the workload costs to run.

So the decision for each workload is simple to state: how long may it be down, how much recent data may it lose, and what are you willing to pay to stay inside those numbers?

### Why it matters to the business

Take the fictional company **Calder Pumpworks**, which makes industrial pumps. It runs six production workloads on BTP. One of them is a portal where distributors check the status of their orders. Another is an agent that helps customer service clerks clear blocked sales orders. A third receives production confirmations from the shop floor.

Three questions decide what an outage costs:

- **How long can each one stop?** If the distributor portal is down for an afternoon, distributors phone customer service instead, and clerks spend hours answering status questions. If the shop-floor listener stops, confirmations queue up and planners plan from yesterday's numbers.
- **How much recent data can it lose?** The portal stores distributors' questions. Losing the last 15 minutes of questions means a handful of unanswered customers. Losing a day of them is a reputational problem.
- **What does protection cost?** In this course's numbers, a second region for the distributor portal costs about 14,800 USD a year. It saves about 13,800 USD of disruption in one 24-hour regional outage. On outage math alone, it pays off only if such an outage happened about once a year, and region-wide outages are rare.

> **Note** Those figures are course values from the walkthrough in the deep layer, not prices or outage statistics from a real system. They show how to reason, not what your numbers will be.

That last point is the business lesson. A second region is rarely justified by expected outage cost. It is justified by a contract, a regulation, or a process where an outage of hours is unacceptable. For everything else, the cheaper answer is to survive the loss of a zone and to be able to rebuild in another region from code.

### How SAP does it

As of 27 November 2026, SAP's documentation describes these layers ([Resilience, High Availability, and Disaster Recovery](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/10-concepts/resilience-high-availability-and-disaster-recovery-e3ac4f7.md)):

- **Availability zones.** SAP deploys its services across multiple zones, and the Cloud Foundry and Kyma runtimes use the zones the cloud provider offers. Your apps benefit only if they run more than one copy.
- **A service level agreement (SLA).** SAP's BTP supplemental terms set a System Availability SLA of 99.9% per month for production cloud services, with exceptions noted per service. Beta features and the free tier have no SLA ([BTP Supplement, v11 2025](https://assets.cdn.sap.com/agreements/product-use-and-support-terms/cls/en/sap-business-technology-platform-supplement-english-v11-2025.pdf)).
- **In-Metro disaster recovery.** For services in its scope, SAP commits to losing at most 5 minutes of data and restoring service within 2 hours if one zone is lost. The scope is listed in SAP's *BTP Disaster Recovery Overview*, and SAP says it covers BTP regions on AWS and Azure.
- **Standard disaster recovery.** If a region is lost, SAP restores productive tenants from backups "as soon as practicable", with no fixed recovery time.
- **Backups.** SAP backs up some platform services itself. For most services, backing up your configuration is your job.
- **Multi-region.** SAP's reference architecture for running in two regions is a design for customers to build, not a switch ([SAP Architecture Center](https://architecture.learning.sap.com/docs/ref-arch/bbfc34)). SAP also documents pairing two subaccounts in different regions for disaster recovery, which the deep layer describes with what this run could and couldn't confirm.

### Three answers for each workload

For every production workload, an architect picks one of three answers for losing a region. Losing a zone is handled inside the region by the design rules in the deep layer.

| | Accept | Rebuild | Standby |
| --- | --- | --- | --- |
| What happens in a regional outage | Wait for SAP to restore the region | Recreate the workload in another region from code | Switch to a copy already running in another region |
| Typical recovery time | Hours to days, no fixed promise | A few hours, if rehearsed | About an hour |
| Data | Safe once the region returns | Only works for workloads that hold no data of their own | Copied continuously, minutes of loss possible |
| Extra cost | None | Small: keep the setup in code, rehearse once a year | Large: a second copy of the data store, a second subaccount, a domain and health checks, rehearsals |
| Fits | Batch jobs, archives, anything that can wait a day | Stateless APIs, agents, gateways | Customer-facing apps with a contractual recovery time |

At Calder, the walkthrough ends with two workloads on *accept*, three on *rebuild* and one, the distributor portal, on *standby*.

> **Note** **For functional consultants** Very little changes in configuration, but two things land in your work. First, recovery targets are business decisions: you are the one who knows how long order status lookups, shop-floor confirmations or certificate reprints can wait, so expect to be asked. Second, failover rehearsals need test cases. A yearly drill should include a business test in the secondary region: a distributor looks up an order, a clerk clears a block, and someone checks the result in S/4HANA.

### Questions to ask

1. For each workload on BTP, what are its recovery time and recovery point targets, and who signed them off?
2. Does every production app run at least two copies, and does its database have a replica in another zone?
3. What does our contract say about availability and disaster recovery, and is each service we rely on inside the scope of SAP's In-Metro disaster recovery?
4. Which configuration (roles, destinations, trust, subscriptions) would we need to recreate by hand after a disaster, and is it kept as code?
5. If a workload is on *standby*, when was the last rehearsed failover, and did a business user test the result?
6. What does our BTP workload depend on outside BTP (S/4HANA, the Cloud Connector, a shop-floor system), and is its recovery time compatible with ours?
7. Where we accept a regional outage, is that written down with an owner and a review date?

### Common misconceptions

- **"BTP is multi-zone, so our apps are highly available."** The platform is. An app with one instance, or a database without a replica, still goes down with its zone.
- **"SAP will fail us over to another region."** For your own apps, it won't. Regional failover is something you design, build and rehearse.
- **"Two regions means twice as available."** Only if data, identity, connectivity and the web address all follow. A second region that can't reach S/4HANA, or holds yesterday's data, doesn't help.
- **"The SLA is how available our app will be."** The SLA is a monthly floor per service, with service credits if SAP misses it. Your app depends on several services in a chain, and on systems outside BTP.
- **"SAP backs everything up."** SAP backs up some services and databases. Your roles, destinations and other configuration are mostly yours to keep.
- **"We can add the second region later."** Some choices are fixed at creation. A cross-region database replica in SAP HANA Cloud, for example, can only be created when the database is first provisioned.

### Key terms

- **Region:** a geographic location where BTP runs, chosen per subaccount.
- **Availability zone (AZ):** a separate data center inside a region, with its own power, cooling and network.
- **Recovery time objective (RTO):** how long a workload may take to come back after a failure.
- **Recovery point objective (RPO):** how much recent data a workload may lose, measured in minutes.
- **System availability SLA:** the contractual minimum share of a month a production service is available, excluding agreed maintenance.
- **In-Metro disaster recovery:** SAP's zone-level recovery for services in scope, with a committed RPO of 5 minutes and RTO of 2 hours.
- **Standby:** a copy of a workload already running in a second region, ready to take over.
- **Rebuild:** recreating a workload in another region from configuration kept as code.
- **Failover rehearsal:** a planned test in which the secondary side takes over and is checked by real users.

### Check yourself

1. Calder's distributor portal runs one app instance with no database replica. What does SAP's multi-zone platform give it when one zone fails?
   - A. Automatic failover to another region within two hours
   - B. Little: the app and its database still go down with that zone
   - C. A guaranteed RTO of 2 hours, because In-Metro DR covers every app
   - D. Nothing, because BTP doesn't use availability zones at all

   Answer: B. SAP spreads its own services across zones, but your app benefits only with two or more instances and a database replica in another zone. In-Metro DR commitments apply to services in SAP's scope, not to how you configure your own app.

2. Who designs failover to a second region for an app Calder built on BTP?
   - A. SAP, as part of standard disaster recovery for every subaccount
   - B. The cloud provider, because regions are their infrastructure
   - C. Calder's own team, using a second subaccount and replicated data
   - D. Nobody: BTP apps can only ever run in one region

   Answer: C. SAP's reference architecture for multi-region is a design for customers to build: two subaccounts, data copied across, and one web address. SAP's standard disaster recovery restores a lost region from backups with no fixed time.

3. The walkthrough's standby for the distributor portal costs about as much a year as one 24-hour regional outage. What should justify it?
   - A. The outage math, because one regional outage a year is typical
   - B. Nothing: a second region should be added to every workload by default
   - C. The SLA credit, which pays back the cost of the standby
   - D. A contractual or regulatory recovery time that waiting can't meet

   Answer: D. Region-wide outages are rare, so expected outage cost seldom pays for a standby. A promise to customers or a regulation that demands recovery in hours is the usual reason.

4. A stateless agent API can't wait days for a region to return. Which answer is usually enough?
   - A. Standby, with a second copy running in another region all the time
   - B. Rebuild from code in another region, rehearsed once a year
   - C. Accept, because stateless apps never go down
   - D. Move it into S/4HANA, which has no regional risk

   Answer: B. A workload that holds no data of its own can be recreated from its configuration and deployment pipeline in a few hours. That costs little more than keeping the setup in code and rehearsing it.

5. What is the most useful question to ask about a workload that will "accept" a regional outage?
   - A. Whether the SLA percentage can be raised for it
   - B. Whether a second region can be added after go-live
   - C. Who owns that decision, and when it will be reviewed
   - D. Whether SAP's In-Metro DR covers regional outages

   Answer: C. Accepting a risk is a valid decision only when it is written down with an owner and a review date. In-Metro DR covers zone loss inside one region, not loss of the region.

6. Calder's BTP app depends on S/4HANA with its own recovery time of 12 hours. What does that mean for the app's design?
   - A. Nothing, because BTP and S/4HANA are independent
   - B. It can't recover work that needs S/4HANA any faster
   - C. The app's SLA rises to match S/4HANA's
   - D. S/4HANA automatically fails over with the BTP app

   Answer: B. A chain is only as available as its weakest link. If S/4HANA is down for 12 hours, a BTP app that needs it can't do that work either, wherever it runs.

## Deep layer

### Mental model

Resilience is a budget of minutes, spent per workload. Each workload has two numbers: the **RTO**, how long it may be down, and the **RPO**, how many minutes of data it may lose. Then you take each failure you plan for, such as one zone lost or the whole region lost, and ask what the design actually delivers. Where the design misses, you either change the design, which costs money, or accept the gap in writing.

Two facts shape every answer on BTP:

1. **Inside a region, SAP gives you zones; you have to use them.** The platform spreads its own components across zones. Your Cloud Foundry app, Kyma deployment or database survives a zone loss only if it has copies in more than one zone.
2. **Across regions, SAP gives you building blocks; you have to assemble them.** A second region means a second subaccount, data copied there, identity and connectivity that work from both sides, and one address that follows the move. None of it is automatic for your own apps, and all of it must be rehearsed.

### How it works

#### What fails, and who handles it

| Failure | Inside SAP's platform | In your workload |
| --- | --- | --- |
| A VM or container crashes | Cloud Foundry and Kyma restart it and reschedule missing instances | Health checks must detect a hung process, not only a dead one |
| One availability zone is lost | Platform services run across zones; In-Metro DR commits RPO 5 min, RTO 2 h for services in scope | Your app needs at least two instances across zones and a database replica in another zone |
| A whole region is lost | Standard DR: SAP restores productive tenants from backups, with no fixed timeline | Your choice: accept, rebuild elsewhere, or a standby in a second region |
| Someone deletes or corrupts data | SAP-managed database backups, point-in-time restore where offered | Configuration backups and restores are mostly yours |

The Kyma rows have one extra condition. SAP's [Kyma documentation](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/10-concepts/availability-zones-in-the-kyma-environment-a649bd9.md) says production plans run the control plane and default worker nodes in three zones, but high availability "is not automatically provided" for your applications. You need several replicas, topology spread constraints so the scheduler places them in different zones, probes, and resource limits. An **additional worker node pool** created without high availability lands in one randomly chosen zone, and that setting can't be changed later: you delete and recreate the pool.

#### The SLA, and what a chain of services is worth

SAP's BTP supplemental terms (v11 2025) give production cloud services a System Availability SLA of 99.9% per month. Deviations for individual services are in the Service Description Guide, and beta features and the free tier have no SLA ([BTP Supplement](https://assets.cdn.sap.com/agreements/product-use-and-support-terms/cls/en/sap-business-technology-platform-supplement-english-v11-2025.pdf)). The same document makes the customer responsible for platform applications that restore their own running state without manual intervention.

An SLA is a floor for one service, measured over a month. Your workload uses several in a chain. If any link fails, the request fails, so a pessimistic planning number for the chain is the product of the links:

```text
Distributor portal (W02): Cloud Foundry x XSUAA x HANA Cloud x Destination x Connectivity
                          x Cloud Connector pair x S/4HANA (RISE)
  = 0.999^6 x 0.997 = 99.10% a month, at the contract minimums
```

Real availability is usually much better than the product of SLAs. The point of the calculation is different: it shows which link dominates. Here it is S/4HANA at 99.7%, the RISE figure from [non-functional design for SAP](https://erpfde.com/topics/non-functional-design-for-sap/). No BTP design can make the portal more available than the system it reads from.

#### Inside the region: zones

```mermaid
flowchart LR
  U[Users] --> R[Router]
  subgraph Region us10
    subgraph AZ1[Zone 1]
      A1[App instance 1]
      D1[(HANA primary)]
    end
    subgraph AZ2[Zone 2]
      A2[App instance 2]
      D2[(HANA replica, sync)]
    end
  end
  R --> A1 & A2
  A1 & A2 --> D1
  D1 -. synchronous .-> D2
```

On Cloud Foundry, you scale an app to two or more instances in the manifest, with `cf scale` or in the cockpit, and the scheduler spreads the instances across zones ([SAP BTP documentation](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/10-concepts/availability-zones-in-the-cloud-foundry-environment-b6a7e11.md)). Cloud Foundry restarts instances it considers unhealthy, which is why an HTTP health check matters: a process check sees a hung process as healthy.

For **SAP HANA Cloud**, SAP Learning describes one or two replicas per database, synchronous in the same zone or another zone, or asynchronous in another zone. Replicas cost extra and are available only in production landscapes, not in trial or free tier ([SAP Learning](https://learning.sap.com/courses/provisioning-and-administering-databases-in-sap-hana-cloud/increasing-the-resilience-of-a-sap-hana-cloud_da093727-bd34-4f33-b498-b9cc5eed1e7c)). A synchronous replica in another zone takes over with no data loss. Changing a replica's zone or mode means deleting and recreating it.

For the **ABAP environment** (SAP's documentation now calls it SAP Business AI Platform, ABAP environment), the multi-zone option is a parameter, `multi_availability_zones`. With it on, application servers are spread across zones and two HANA Cloud database instances replicate synchronously. ABAP Compute Units stay the same; HANA Compute Units double. SAP recommends at least three application servers so that two remain after a zone loss, and notes that in a complete zone outage SAP's operations team may have to declare it before the system is moved ([Resilience of an ABAP Environment System](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/50-administration-and-ops/resilience-of-an-abap-environment-system-4f380f8.md)).

#### Backups: what SAP keeps, what you keep

| Thing | Who backs it up (as documented on 27 November 2026) |
| --- | --- |
| SAP HANA Cloud data | SAP: a full backup every 24 hours and log backups every 15 minutes; backups kept in other zones of the same region, and also shipped to the secondary region once a cross-region replica is enabled; restore to a point in time from SAP HANA Cloud Central ([SAP Learning](https://learning.sap.com/courses/provisioning-and-administering-databases-in-sap-hana-cloud/increasing-the-resilience-of-a-sap-hana-cloud_da093727-bd34-4f33-b498-b9cc5eed1e7c)) |
| ABAP environment database | SAP: backups kept up to 30 days, RPO no more than 15 minutes; a point-in-time restore is a service request on component `BC-CP-ABA`, planned with SAP, and changes only the ABAP database ([Backups](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/50-administration-and-ops/backups-ab4f108.md)) |
| Kyma objects and volumes | Kyma provides no point-in-time backup. Cluster objects are snapshotted for automatic cluster restore; keep your own objects in Git (GitOps) and snapshot volumes yourself ([Kyma Environment Backup](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/50-administration-and-ops/kyma-environment-backup-ab959cf.md)) |
| Roles, role collections, trust, destinations, subscriptions | Mostly you, by export through APIs or by keeping them as code |

The last row is the one teams forget. After a disaster, or after someone deletes a role collection by mistake, you need the configuration back exactly as it was. Keeping subaccounts, entitlements, role collections and destinations as code (the Terraform topic later in Unit 21 shows how) turns that from a week of clicking into a pipeline run.

#### Across regions

SAP's [multi-region reference architecture](https://architecture.learning.sap.com/docs/ref-arch/bbfc34) (last updated 19 February 2025) is explicit that BTP services are multi-zone by default and that a multi-region setup is for customers to architect. Its building blocks:

```mermaid
flowchart TB
  U[Users and callers] --> DNS[DNS load balancer with health checks]
  DNS -->|primary| P
  DNS -.->|after failover| S
  subgraph P[Subaccount, region us10]
    PA[App] --> PD[(HANA Cloud primary)]
  end
  subgraph S[Subaccount, region us11]
    SA[App, standby] --> SD[(HANA Cloud replica)]
  end
  PD -. asynchronous .-> SD
  PA & SA --> CC[Cloud Connector pair, Rockford]
  CC --> S4[S/4HANA S4P]
  PIPE[CI/CD and Terraform] --> P & S
```

- **Two subaccounts in different regions**, with the same services and apps in both.
- **One address.** The SAP Custom Domain service gives the app a domain of your own, and a DNS-based load balancer (Azure Traffic Manager, Amazon Route 53 or Google Cloud DNS in SAP's examples) checks each side's health and points the domain at the healthy one.
- **State copied across.** SAP's design uses HANA Cloud replication between regions and Advanced Event Mesh replication for events. SAP Learning describes a newer HANA Cloud option for this: an asynchronous replica in another region, active and passive, with failover triggered by hand from the secondary. It lists region pairs `cf-us10`/`cf-us11` and `cf-eu10`/`cf-eu13` on AWS, and says the replica can only be created when the database is first provisioned.
- **A control plane.** SAP's open-source sample *Multi-Region Manager*, a CAP app, orchestrates the switch: replication direction, event replication, load balancer settings.
- **Everything deployed twice from one source.** SAP's CI/CD service or project "Piper" for the apps, Terraform for the subaccounts.

The reference architecture's cost page warns that redundancy "can double the costs" and notes that SAP Cloud Identity Services' Identity Authentication is already multi-region and needs no second copy.

**Subaccount pairs.** SAP's documentation now describes a platform feature for this: you pair a subaccount with one subaccount in a paired region, then create **instance pairs** and **subscription pairs** of services inside the paired subaccounts. The btp CLI has `btp create disaster-recovery/subaccount-pair`, `btp get disaster-recovery/subaccount-pair` and `btp delete disaster-recovery/subaccount-pair`. You need the *Central Disaster Recovery Administrator* role, assigned through the Subaccount Administrator role collection in both subaccounts, and each subaccount can be paired with only one other ([Terraform provider docs](https://github.com/SAP/terraform-provider-btp/blob/main/docs/resources/disaster_recovery_subaccount_pair.md); the resource was added in March 2026). The *SAP BTP Multi-Region Guide* on help.sap.com, which lists the services and region pairs, couldn't be opened in this run. Before you design around subaccount pairs, read it for which of your services support instance pairs and how failover is triggered.

#### When does a region plan work?

A rehearsed plan that is missing one piece is still no plan. For *rebuild* and *standby* the pieces are:

| Piece | Rebuild | Standby |
| --- | --- | --- |
| Configuration as code, deployable to an empty subaccount | Required | Required |
| A failover rehearsal in the last 12 months | Required | Required |
| A stable name for callers (custom domain) | When something calls the workload | Required |
| Health-checked DNS failover | No | Required |
| Data already in the second region | Not possible: rebuild only fits stateless workloads | Required (replica created at provisioning) |
| Cloud Connector connected to the secondary subaccount | When the workload reaches on-premise systems | Required when it does |

The last row trips teams up. One Cloud Connector can serve several subaccounts ([BTP connectivity](https://erpfde.com/topics/btp-connectivity/)), but each subaccount connection is configured separately. A standby that was never connected to Rockford's Cloud Connector comes up and then can't reach S/4HANA.

### Build it yourself: Calder's resilience plan

You will write Calder's resilience design for six BTP workloads as data, check it against ten rules, run two drills (one zone lost, then the whole region lost), and work out what the choices cost. Then you will load the reviewed design and see what changed. Everything runs on your computer with no account.

```mermaid
flowchart LR
  I[--init / --reviewed] --> J[calder_resilience.json]
  J --> C[--check<br/>rules R01-R10]
  J --> D[--drill az / region]
  J --> K[--cost]
  C --> W[--write]
  W --> M[calder_resilience_plan.md]
```

**Before you start:** complete [Set up your computer for this course](https://erpfde.com/topics/set-up-your-computer/) and [Set up for Unit 21](https://erpfde.com/topics/set-up-for-unit-21/). This walkthrough doesn't repeat their steps. It reuses Calder's workloads from [BTP runtimes compared](https://erpfde.com/topics/btp-runtimes-compared/), the subaccounts from [the BTP account model](https://erpfde.com/topics/btp-account-model/) and the Cloud Connector pair `SCC-RK-P` from [BTP connectivity](https://erpfde.com/topics/btp-connectivity/).

> **Note** New words. **JSON** is a text format for structured data. A **drill** here is a simulation: the script assumes a failure and calculates, for each workload, how long it is down and how much data it loses. **Stateless** means a workload keeps no data of its own between requests; **stateful** means it does, usually in a database.

#### What you need

- Python 3 and your `orchestrate-course` folder with its `.venv`.
- No account and no extra libraries. The script uses only Python's built-in modules.
- About 35 minutes. Free.

#### Step 1: Open the course folder and turn on the virtual environment

1. Open VS Code, choose **File > Open Folder**, and open `orchestrate-course`.
2. Open a terminal: **Terminal > New Terminal**.
3. If the prompt doesn't start with `(.venv)`, turn it on:

   - **Windows (PowerShell):**

     ```powershell
     .venv\Scripts\Activate.ps1
     ```

   - **macOS / Linux:**

     ```bash
     source .venv/bin/activate
     ```

4. The `unit21` folder exists from the setup topic. If it doesn't, create it with `mkdir unit21`.

#### Step 2: Create the script

1. In VS Code, create a new file `unit21/resilience_plan.py`.
2. Paste this code and save.

```python
"""Calder's resilience plan for BTP workloads (course lab, built-in modules only).

Steps:
  --init       write the partner's draft design to unit21/calder_resilience.json
  --reviewed   write the reviewed design (same file)
  --check      check the design against rules R01-R10
  --drill az   simulate losing one availability zone for 6 hours
  --drill region   simulate losing the whole primary region for 24 hours
  --cost       monthly cost of the resilience choices, and the standby break-even
  --write      write unit21/calder_resilience_plan.md

Every number is a course value or an SAP figure named in the topic.
No randomness: the same design always gives the same output.
"""
import argparse
import json
from datetime import date
from pathlib import Path

HERE = Path(__file__).resolve().parent
DESIGN = HERE / "calder_resilience.json"
PLAN = HERE / "calder_resilience_plan.md"

# Tier targets (course values). T1 matches the RPO/RTO SAP commits to for
# In-Metro disaster recovery (5 minutes, 2 hours); T2 and T3 are looser.
TIERS = {
    "T1": {"availability": 99.5, "rto_min": 120, "rpo_min": 5},
    "T2": {"availability": 99.0, "rto_min": 480, "rpo_min": 60},
    "T3": {"availability": 97.0, "rto_min": 1440, "rpo_min": 1440},
}
# Monthly availability used for each dependency. 99.9 is the System
# Availability SLA in the SAP BTP Supplement; s4p is Calder's RISE SLA from the
# non-functional design topic; the Cloud Connector pair is a course value.
DEPENDENCY_AVAILABILITY = {
    "cf": 99.9, "kyma": 99.9, "abap": 99.9, "xsuaa": 99.9, "destination": 99.9,
    "connectivity": 99.9, "hana": 99.9, "aicore": 99.9,
    "scc_ha": 99.9, "scc_single": 99.5, "s4p": 99.7,
}
AZ_OUTAGE_MIN = 360        # drill: one zone lost for 6 hours (course value)
REGION_OUTAGE_MIN = 1440   # drill: the region lost for 24 hours (course value)
# Recovery times in minutes (course values, not SAP commitments)
APP_RESCHEDULE_MIN = 10        # a lone instance restarted in another zone
HANA_NO_REPLICA_MIN = 180      # recreate from backup in another zone
HANA_NO_REPLICA_LOSS = 15      # log backups every 15 minutes
HANA_AZ_REPLICA_MIN = 5        # automatic takeover by the synchronous replica
ABAP_SINGLE_ZONE_MIN = 120     # restart on other hardware, subject to availability
ABAP_SINGLE_ZONE_LOSS = 15
ABAP_MULTI_AZ_MIN = 30         # SAP declares the zone outage and evacuates
REBUILD_MIN = {"cf": 240, "kyma": 300}   # new subaccount from code, tested
STANDBY_MIN = 60               # DNS switch plus manual database takeover
STANDBY_LOSS = 5               # asynchronous replication to the paired region
# Monthly costs in USD (course values)
CF_GB_MONTH = 60
DNS_AND_DOMAIN_MONTH = 120
TEST_DAY_USD = 900


def workload(**kw):
    base = {"instances": 2, "zone_spread": True, "health_check": "http", "pdb": None,
            "memory_gb": 0.5, "store": None, "multi_az": None,
            "node_pool_ha": None, "region_plan": None, "called_by": [], "outage_cost_per_hour": 100}
    base.update(kw)
    return base


def design(reviewed):
    hana_w02 = {"type": "hana", "replica": "az_sync" if reviewed else "none",
                "multi_region_replica": reviewed, "monthly_usd": 900,
                "backup_retention_days": 14,
                "restore_tested": "2026-11-20" if reviewed else None}
    abap_w06 = {"type": "abap", "monthly_usd": 700, "backup_retention_days": 30,
                "restore_tested": "2026-10-15" if reviewed else None}
    tested = "2026-11-24" if reviewed else None
    w = [
        workload(id="W01", name="order-exc-api", tier="T2", runtime="cf",
                 subaccount="calder-ai-prod", owner="00100288",
                 instances=2 if reviewed else 1,
                 depends=["cf", "xsuaa", "destination", "connectivity", "scc_ha", "s4p", "aicore"],
                 region_plan={"plan": "rebuild", "config_as_code": True,
                              "failover_tested": tested} if reviewed else None,
                 outage_cost_per_hour=250),
        workload(id="W02", name="distributor-order-status", tier="T1", runtime="cf",
                 subaccount="calder-ext-prod", owner="00100292", memory_gb=1.0,
                 store=hana_w02, called_by=["distributors' browsers"],
                 depends=["cf", "xsuaa", "hana", "destination", "connectivity", "scc_ha", "s4p"],
                 region_plan={"plan": "standby", "config_as_code": True,
                              "failover_tested": tested,
                              "custom_domain": "orders.calder-pumpworks.example",
                              "dns_failover": True, "scc_secondary": reviewed,
                              "secondary_subaccount": "calder-ext-prod-dr"},
                 outage_cost_per_hour=600),
        workload(id="W03", name="calder-ai-gw", tier="T2", runtime="cf",
                 subaccount="calder-ai-prod", owner="00100288", memory_gb=2.0,
                 health_check="http" if reviewed else "process",
                 depends=["cf", "xsuaa", "aicore"],
                 region_plan={"plan": "rebuild", "config_as_code": True,
                              "failover_tested": tested} if reviewed else None,
                 outage_cost_per_hour=0),
        workload(id="W04", name="mes-event-listener", tier="T2", runtime="kyma",
                 subaccount="calder-ext-prod", owner="00100292", memory_gb=1.0,
                 zone_spread=reviewed, health_check="probes", pdb=reviewed,
                 called_by=["Rockford MES"],
                 depends=["kyma", "connectivity", "scc_ha", "s4p"],
                 region_plan={"plan": "rebuild", "config_as_code": True,
                              "failover_tested": tested,
                              "custom_domain": "mes-in.calder-pumpworks.example"}
                 if reviewed else {"plan": "rebuild", "config_as_code": False,
                                   "failover_tested": None},
                 outage_cost_per_hour=300),
        workload(id="W06", name="test-certificate-archive", tier="T2", runtime="abap",
                 subaccount="calder-ext-prod", owner="00100292", instances=None,
                 zone_spread=None, health_check=None, multi_az=False, store=abap_w06,
                 depends=["abap", "destination", "connectivity", "scc_ha", "s4p"],
                 region_plan={"plan": "accept",
                              "exception": {"owner": "00100292", "review_by": "2027-06-30",
                                            "reason": "certificates can be re-sent within a day; "
                                                      "SAP's standard disaster recovery applies"}}
                 if reviewed else {"plan": "accept"},
                 outage_cost_per_hour=150),
        workload(id="W07", name="notification-coding-batch", tier="T3", runtime="cf",
                 subaccount="calder-ai-prod", owner="00100288", instances=1, memory_gb=1.0,
                 depends=["cf", "aicore", "destination", "connectivity", "scc_ha", "s4p"],
                 region_plan={"plan": "accept"}, outage_cost_per_hour=50),
    ]
    return {"as_of": "2026-11-27", "primary_region": "us10", "paired_region": "us11",
            "version": "reviewed" if reviewed else "draft", "workloads": w}


def months_since(day, as_of):
    if not day:
        return None
    d, a = date.fromisoformat(day), date.fromisoformat(as_of)
    return (a.year - d.year) * 12 + (a.month - d.month)


def composite(w):
    value = 1.0
    for dep in w["depends"]:
        value *= DEPENDENCY_AVAILABILITY[dep] / 100
    return value * 100


def az_drill(w):
    """Downtime and data loss in minutes when one zone is lost."""
    app = 0
    if w["runtime"] == "cf" and w["instances"] < 2:
        app = APP_RESCHEDULE_MIN
    if w["runtime"] == "kyma" and (w["instances"] < 2 or not w["zone_spread"]):
        app = APP_RESCHEDULE_MIN
    if w["runtime"] == "kyma" and w.get("node_pool_ha") is False:
        app = AZ_OUTAGE_MIN   # the pool lives in one zone: wait until it returns
    store, loss = 0, 0
    s = w["store"]
    if s and s["type"] == "hana":
        if s["replica"] == "az_sync":
            store = HANA_AZ_REPLICA_MIN
        else:
            store, loss = HANA_NO_REPLICA_MIN, HANA_NO_REPLICA_LOSS
    if s and s["type"] == "abap":
        if w["multi_az"]:
            store = ABAP_MULTI_AZ_MIN
        else:
            store, loss = ABAP_SINGLE_ZONE_MIN, ABAP_SINGLE_ZONE_LOSS
    return max(app, store), loss


def plan_problems(w, as_of):
    """What stops the region plan from working. Empty list means it can work."""
    p = w["region_plan"] or {}
    kind = p.get("plan")
    problems = []
    if kind in ("rebuild", "standby"):
        if not p.get("config_as_code"):
            problems.append("configuration not in code")
        m = months_since(p.get("failover_tested"), as_of)
        if m is None or m > 12:
            problems.append("failover never tested" if m is None else f"failover tested {m} months ago")
    if kind == "rebuild" and w["store"]:
        problems.append("rebuild can't bring back data held only in the lost region")
    if kind in ("rebuild", "standby") and w["called_by"] and not p.get("custom_domain"):
        problems.append(f"no custom domain, so {w['called_by'][0]} can't follow the move")
    if kind == "standby":
        if not p.get("dns_failover"):
            problems.append("no health-checked DNS failover")
        if w["store"] and not w["store"].get("multi_region_replica"):
            problems.append("data not replicated to the paired region")
        if "connectivity" in w["depends"] and not p.get("scc_secondary"):
            problems.append("Cloud Connector not connected to the secondary subaccount")
    return problems


def region_drill(w, as_of):
    p = w["region_plan"] or {}
    kind = p.get("plan")
    if kind in ("rebuild", "standby") and not plan_problems(w, as_of):
        if kind == "rebuild":
            return REBUILD_MIN[w["runtime"]], 0
        return STANDBY_MIN, STANDBY_LOSS if w["store"] else 0
    return REGION_OUTAGE_MIN, 0   # wait for the region; data intact when it returns


def check(d):
    as_of = d["as_of"]
    rows = []

    def add(rule, wid, ok, text, warn=False):
        rows.append((rule, wid, "OK" if ok else ("WARN" if warn else "FAIL"), text))

    for w in d["workloads"]:
        t = TIERS[w["tier"]]
        wid = w["id"]
        if w["runtime"] == "cf":
            add("R01", wid, w["instances"] >= 2 or w["tier"] == "T3",
                f"{w['instances']} instance(s)" + (" (T3 may run one)" if w["tier"] == "T3" else ""))
            add("R02", wid, w["health_check"] == "http", f"health check {w['health_check']}")
        if w["runtime"] == "kyma":
            ok = w["instances"] >= 2 and w["zone_spread"] and w.get("node_pool_ha") is not False
            add("R01", wid, ok, f"{w['instances']} replicas" +
                (", spread across zones" if w["zone_spread"] else ", no topology spread") +
                (", node pool in one zone" if w.get("node_pool_ha") is False else ""))
            add("R02", wid, w["health_check"] == "probes", f"health check {w['health_check']}")
            add("R03", wid, bool(w["pdb"]), "PodDisruptionBudget set" if w["pdb"]
                else "no PodDisruptionBudget", warn=True)
        down, loss = az_drill(w)
        add("R04", wid, down <= t["rto_min"] and loss <= t["rpo_min"],
            f"zone loss: {down} min down, {loss} min data lost "
            f"(target {t['rto_min']}/{t['rpo_min']})")
        p = w["region_plan"] or {}
        add("R05", wid, p.get("plan") in ("accept", "rebuild", "standby"),
            f"region plan {p.get('plan') or 'none'}")
        rdown, rloss = region_drill(w, as_of)
        meets = rdown <= t["rto_min"] and rloss <= t["rpo_min"]
        exc = p.get("exception")
        exc_ok = bool(exc and exc.get("owner") and exc.get("review_by")
                      and months_since(as_of, exc["review_by"]) is not None
                      and months_since(as_of, exc["review_by"]) <= 12)
        add("R06", wid, meets or exc_ok,
            f"region loss: {rdown} min down" + ("" if meets else
            (f", exception by {exc['owner']} to {exc['review_by']}" if exc_ok
             else f", misses {t['rto_min']} min and no accepted exception")))
        if p.get("plan") in ("rebuild", "standby"):
            probs = [x for x in plan_problems(w, as_of)
                     if x.startswith(("configuration", "failover"))]
            add("R07", wid, not probs, "; ".join(probs) or "in code, failover tested")
        if p.get("plan") == "standby" or (p.get("plan") == "rebuild" and (w["store"] or w["called_by"])):
            probs = [x for x in plan_problems(w, as_of)
                     if not x.startswith(("configuration", "failover"))]
            ready = ("domain, DNS, data and connector ready" if p.get("plan") == "standby"
                     else "callers use " + str(p.get("custom_domain")))
            add("R08", wid, not probs, "; ".join(probs) or ready)
        c = composite(w)
        add("R09", wid, c >= t["availability"],
            f"chain {c:.2f}% vs target {t['availability']}%", warn=True)
        s = w["store"]
        if s:
            m = months_since(s.get("restore_tested"), as_of)
            ok = s["backup_retention_days"] >= 14 and m is not None and m <= 12
            add("R10", wid, ok, f"{s['type']} backups {s['backup_retention_days']} days, restore "
                + ("never tested" if m is None else f"tested {m} months ago"))
    return rows


def cost(d):
    lines = []
    for w in d["workloads"]:
        items = []
        if w["runtime"] == "cf" and w["instances"] >= 2:
            items.append(("second instance", w["memory_gb"] * CF_GB_MONTH))
        s = w["store"] or {}
        if s.get("type") == "hana" and s.get("replica") == "az_sync":
            items.append(("HANA replica in another zone", s["monthly_usd"]))
        if s.get("type") == "abap" and w["multi_az"]:
            items.append(("ABAP multi-zone (database x2)", s["monthly_usd"]))
        p = w["region_plan"] or {}
        if p.get("plan") == "rebuild":
            items.append(("rebuild test, 1 day a year", TEST_DAY_USD / 12))
        if p.get("plan") == "standby":
            if s.get("multi_region_replica"):
                items.append(("HANA replica in the paired region", s["monthly_usd"]))
            items.append(("standby app, one instance", w["memory_gb"] * CF_GB_MONTH))
            items.append(("custom domain and DNS health checks", DNS_AND_DOMAIN_MONTH))
            items.append(("failover test, 2 days a year", 2 * TEST_DAY_USD / 12))
        total = sum(v for _, v in items)
        lines.append((w, items, total))
    return lines


def print_cost(d):
    grand = 0
    for w, items, total in cost(d):
        grand += total
        print(f"{w['id']}  {w['name']:<26} {total:>9,.2f} USD/month")
        for label, value in items:
            print(f"      {label:<38} {value:>9,.2f}")
        if (w["region_plan"] or {}).get("plan") == "standby":
            standby = sum(v for label, v in items if label.startswith(
                ("HANA replica in the paired", "standby", "custom", "failover")))
            saved_h = (REGION_OUTAGE_MIN - STANDBY_MIN) / 60
            per_event = saved_h * w["outage_cost_per_hour"]
            print(f"      standby {standby * 12:,.2f} USD a year; saves {saved_h:.0f} h x "
                  f"{w['outage_cost_per_hour']} = {per_event:,.2f} per 24 h region outage")
            print(f"      break-even: {standby * 12 / per_event:.2f} region outages a year")
    print(f"Total {grand:,.2f} USD/month (course values)")


def print_drill(d, kind):
    hrs = (AZ_OUTAGE_MIN if kind == "az" else REGION_OUTAGE_MIN) / 60
    print(f"Drill: {'one availability zone' if kind == 'az' else 'region ' + d['primary_region']} "
          f"lost for {hrs:.0f} h")
    for w in d["workloads"]:
        t = TIERS[w["tier"]]
        down, loss = az_drill(w) if kind == "az" else region_drill(w, d["as_of"])
        ok = down <= t["rto_min"] and loss <= t["rpo_min"]
        print(f"{w['id']}  {w['name']:<26} {w['tier']}  down {down:>4} min  lost {loss:>2} min"
              f"  target {t['rto_min']:>4}/{t['rpo_min']:<4}  {'meets' if ok else 'MISSES'}")


def write_plan(d, rows):
    out = ["# Calder resilience plan", "",
           f"Design: {d['version']}, as of {d['as_of']}. Primary region {d['primary_region']}, "
           f"paired region {d['paired_region']}. Course values; not a real system.", "",
           "| Workload | Tier | Owner | Zone loss (min down / lost) | Region plan | Region loss (min down) |",
           "| --- | --- | --- | --- | --- | --- |"]
    for w in d["workloads"]:
        down, loss = az_drill(w)
        rdown, _ = region_drill(w, d["as_of"])
        out.append(f"| {w['id']} {w['name']} | {w['tier']} | {w['owner']} | {down} / {loss} | "
                   f"{(w['region_plan'] or {}).get('plan')} | {rdown} |")
    out += ["", "## Findings", ""]
    out += [f"- {r} {wid} {s}: {text}" for r, wid, s, text in rows if s != "OK"] or ["- none"]
    out += ["", "## Decision record", "", "- Context:", "- Options:", "- Decision:",
            "- Consequences:", ""]
    PLAN.write_text("\n".join(out), encoding="utf-8")
    print(f"Wrote {PLAN.relative_to(HERE.parent)}")


def load():
    if not DESIGN.exists():
        raise SystemExit("calder_resilience.json not found: run --init or --reviewed first")
    return json.loads(DESIGN.read_text(encoding="utf-8"))


def main():
    ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])
    ap.add_argument("--init", action="store_true")
    ap.add_argument("--reviewed", action="store_true")
    ap.add_argument("--check", action="store_true")
    ap.add_argument("--drill", choices=["az", "region"])
    ap.add_argument("--cost", action="store_true")
    ap.add_argument("--write", action="store_true")
    a = ap.parse_args()
    if a.init or a.reviewed:
        DESIGN.write_text(json.dumps(design(a.reviewed), indent=2), encoding="utf-8")
        print(f"Wrote {DESIGN.relative_to(HERE.parent)} ({'reviewed' if a.reviewed else 'draft'})")
        return
    d = load()
    if a.check or a.write:
        rows = check(d)
        if a.check:
            for r, wid, s, text in rows:
                print(f"{r}  {wid}  {s:<4}  {text}")
            n = {k: sum(1 for x in rows if x[2] == k) for k in ("OK", "WARN", "FAIL")}
            print(f"{len(rows)} checks: {n['OK']} OK, {n['WARN']} WARN, {n['FAIL']} FAIL")
        if a.write:
            write_plan(d, rows)
    if a.drill:
        print_drill(d, a.drill)
    if a.cost:
        print_cost(d)
    if not (a.check or a.write or a.drill or a.cost):
        ap.print_help()


if __name__ == "__main__":
    main()
```

The numbers at the top are the model. The tiers' targets, the recovery minutes and the monthly costs are course values; 99.9% is the BTP Supplement's SLA figure and 99.7% is Calder's RISE SLA. Change them to your own and the rest follows.

#### Step 3: Write the partner's draft and check it

A partner drafted Calder's design with the comment "BTP is multi-zone, so we're covered", plus a standby for the distributor portal.

1. Write the draft:

   - **Windows (PowerShell):**

     ```powershell
     python unit21\resilience_plan.py --init
     ```

   - **macOS / Linux:**

     ```bash
     python3 unit21/resilience_plan.py --init
     ```

   ```text
   Wrote unit21/calder_resilience.json (draft)
   ```

2. Check it (on Windows use `python unit21\resilience_plan.py`, as above, for every command below):

   ```bash
   python3 unit21/resilience_plan.py --check
   ```

   ```text
   R01  W01  FAIL  1 instance(s)
   R02  W01  OK    health check http
   R04  W01  OK    zone loss: 10 min down, 0 min data lost (target 480/60)
   R05  W01  FAIL  region plan none
   R06  W01  FAIL  region loss: 1440 min down, misses 480 min and no accepted exception
   R09  W01  OK    chain 99.10% vs target 99.0%
   R01  W02  OK    2 instance(s)
   R02  W02  OK    health check http
   R04  W02  FAIL  zone loss: 180 min down, 15 min data lost (target 120/5)
   R05  W02  OK    region plan standby
   R06  W02  FAIL  region loss: 1440 min down, misses 120 min and no accepted exception
   R07  W02  FAIL  failover never tested
   R08  W02  FAIL  data not replicated to the paired region; Cloud Connector not connected to the secondary subaccount
   R09  W02  WARN  chain 99.10% vs target 99.5%
   R10  W02  FAIL  hana backups 14 days, restore never tested
   R01  W03  OK    2 instance(s)
   R02  W03  FAIL  health check process
   R04  W03  OK    zone loss: 0 min down, 0 min data lost (target 480/60)
   R05  W03  FAIL  region plan none
   R06  W03  FAIL  region loss: 1440 min down, misses 480 min and no accepted exception
   R09  W03  OK    chain 99.70% vs target 99.0%
   R01  W04  FAIL  2 replicas, no topology spread
   R02  W04  OK    health check probes
   R03  W04  WARN  no PodDisruptionBudget
   R04  W04  OK    zone loss: 10 min down, 0 min data lost (target 480/60)
   R05  W04  OK    region plan rebuild
   R06  W04  FAIL  region loss: 1440 min down, misses 480 min and no accepted exception
   R07  W04  FAIL  configuration not in code; failover never tested
   R08  W04  FAIL  no custom domain, so Rockford MES can't follow the move
   R09  W04  OK    chain 99.40% vs target 99.0%
   R04  W06  OK    zone loss: 120 min down, 15 min data lost (target 480/60)
   R05  W06  OK    region plan accept
   R06  W06  FAIL  region loss: 1440 min down, misses 480 min and no accepted exception
   R09  W06  OK    chain 99.30% vs target 99.0%
   R10  W06  FAIL  abap backups 30 days, restore never tested
   R01  W07  OK    1 instance(s) (T3 may run one)
   R02  W07  OK    health check http
   R04  W07  OK    zone loss: 10 min down, 0 min data lost (target 1440/1440)
   R05  W07  OK    region plan accept
   R06  W07  OK    region loss: 1440 min down
   R09  W07  OK    chain 99.20% vs target 97.0%
   41 checks: 22 OK, 2 WARN, 17 FAIL
   ```

Read it workload by workload:

- **W01** runs one instance: a zone loss costs ten minutes while Cloud Foundry restarts it elsewhere. That fits its tier, but rule R01 still asks for two: with one instance, every crash and every restart is an outage.
- **W02**, the portal, fails the zone test outright: without a database replica, the course model needs three hours to recreate HANA Cloud from backup in another zone and loses up to 15 minutes of data. Its standby is half built: no replica in the paired region, and Rockford's Cloud Connector isn't connected to the standby subaccount. Its restore has never been tested.
- **W03**, the AI gateway, has a process health check: a hung gateway looks healthy.
- **W04**, the shop-floor listener on Kyma, has two replicas with no topology spread, so both may sit in one zone. Its "rebuild" isn't in code, and the shop-floor system calls a fixed address that wouldn't follow a move.
- **W02** also gets a warning from the chain rule: R09 says its target of 99.5% is above what its chain of SLAs supports. **W06**, the certificate archive, accepts regional risk with no owner or review date on record.
- **W07**, a nightly batch in tier T3, may run one instance and wait for a region to return.

#### Step 4: Run the drills

1. Lose one zone for six hours:

   ```bash
   python3 unit21/resilience_plan.py --drill az
   ```

   ```text
   Drill: one availability zone lost for 6 h
   W01  order-exc-api              T2  down   10 min  lost  0 min  target  480/60    meets
   W02  distributor-order-status   T1  down  180 min  lost 15 min  target  120/5     MISSES
   W03  calder-ai-gw               T2  down    0 min  lost  0 min  target  480/60    meets
   W04  mes-event-listener         T2  down   10 min  lost  0 min  target  480/60    meets
   W06  test-certificate-archive   T2  down  120 min  lost 15 min  target  480/60    meets
   W07  notification-coding-batch  T3  down   10 min  lost  0 min  target 1440/1440  meets
   ```

2. Lose the region for 24 hours:

   ```bash
   python3 unit21/resilience_plan.py --drill region
   ```

   ```text
   Drill: region us10 lost for 24 h
   W01  order-exc-api              T2  down 1440 min  lost  0 min  target  480/60    MISSES
   W02  distributor-order-status   T1  down 1440 min  lost  0 min  target  120/5     MISSES
   W03  calder-ai-gw               T2  down 1440 min  lost  0 min  target  480/60    MISSES
   W04  mes-event-listener         T2  down 1440 min  lost  0 min  target  480/60    MISSES
   W06  test-certificate-archive   T2  down 1440 min  lost  0 min  target  480/60    MISSES
   W07  notification-coding-batch  T3  down 1440 min  lost  0 min  target 1440/1440  meets
   ```

Every workload that needs to be back within a working day misses. The draft's standby doesn't help W02, because a standby without its data and without its connection to S/4HANA isn't one.

#### Step 5: Look at the cost

```bash
python3 unit21/resilience_plan.py --cost
```

```text
W01  order-exc-api                   0.00 USD/month
W02  distributor-order-status      390.00 USD/month
      second instance                            60.00
      standby app, one instance                  60.00
      custom domain and DNS health checks       120.00
      failover test, 2 days a year              150.00
      standby 3,960.00 USD a year; saves 23 h x 600 = 13,800.00 per 24 h region outage
      break-even: 0.29 region outages a year
W03  calder-ai-gw                  120.00 USD/month
      second instance                           120.00
W04  mes-event-listener             75.00 USD/month
      rebuild test, 1 day a year                 75.00
W06  test-certificate-archive        0.00 USD/month
W07  notification-coding-batch       0.00 USD/month
Total 585.00 USD/month (course values)
```

The draft's standby looks cheap, with a break-even of 0.29 regional outages a year. That is because it leaves out the part that makes it work: the copy of the database in the second region.

#### Step 6: Load the reviewed design and compare

The review made these changes: W01 runs two instances; W02 gets a synchronous HANA replica in another zone, a replica in the paired region `us11` created at provisioning, Rockford's Cloud Connector connected to `calder-ext-prod-dr`, a tested restore and a rehearsed failover; W03 gets an HTTP health check; W04 gets topology spread, a PodDisruptionBudget, its rebuild in code and the stable name `mes-in.calder-pumpworks.example` for the shop-floor system; W01, W03 and W04 rehearse a rebuild; W06 accepts the regional risk with an owner and a review date.

1. Write and check it:

   ```bash
   python3 unit21/resilience_plan.py --reviewed
   python3 unit21/resilience_plan.py --check
   ```

   ```text
   R01  W01  OK    2 instance(s)
   R02  W01  OK    health check http
   R04  W01  OK    zone loss: 0 min down, 0 min data lost (target 480/60)
   R05  W01  OK    region plan rebuild
   R06  W01  OK    region loss: 240 min down
   R07  W01  OK    in code, failover tested
   R09  W01  OK    chain 99.10% vs target 99.0%
   R01  W02  OK    2 instance(s)
   R02  W02  OK    health check http
   R04  W02  OK    zone loss: 5 min down, 0 min data lost (target 120/5)
   R05  W02  OK    region plan standby
   R06  W02  OK    region loss: 60 min down
   R07  W02  OK    in code, failover tested
   R08  W02  OK    domain, DNS, data and connector ready
   R09  W02  WARN  chain 99.10% vs target 99.5%
   R10  W02  OK    hana backups 14 days, restore tested 0 months ago
   R01  W03  OK    2 instance(s)
   R02  W03  OK    health check http
   R04  W03  OK    zone loss: 0 min down, 0 min data lost (target 480/60)
   R05  W03  OK    region plan rebuild
   R06  W03  OK    region loss: 240 min down
   R07  W03  OK    in code, failover tested
   R09  W03  OK    chain 99.70% vs target 99.0%
   R01  W04  OK    2 replicas, spread across zones
   R02  W04  OK    health check probes
   R03  W04  OK    PodDisruptionBudget set
   R04  W04  OK    zone loss: 0 min down, 0 min data lost (target 480/60)
   R05  W04  OK    region plan rebuild
   R06  W04  OK    region loss: 300 min down
   R07  W04  OK    in code, failover tested
   R08  W04  OK    callers use mes-in.calder-pumpworks.example
   R09  W04  OK    chain 99.40% vs target 99.0%
   R04  W06  OK    zone loss: 120 min down, 15 min data lost (target 480/60)
   R05  W06  OK    region plan accept
   R06  W06  OK    region loss: 1440 min down, exception by 00100292 to 2027-06-30
   R09  W06  OK    chain 99.30% vs target 99.0%
   R10  W06  OK    abap backups 30 days, restore tested 1 months ago
   R01  W07  OK    1 instance(s) (T3 may run one)
   R02  W07  OK    health check http
   R04  W07  OK    zone loss: 10 min down, 0 min data lost (target 1440/1440)
   R05  W07  OK    region plan accept
   R06  W07  OK    region loss: 1440 min down
   R09  W07  OK    chain 99.20% vs target 97.0%
   43 checks: 42 OK, 1 WARN, 0 FAIL
   ```

2. Run both drills again:

   ```bash
   python3 unit21/resilience_plan.py --drill az
   python3 unit21/resilience_plan.py --drill region
   ```

   ```text
   Drill: one availability zone lost for 6 h
   W01  order-exc-api              T2  down    0 min  lost  0 min  target  480/60    meets
   W02  distributor-order-status   T1  down    5 min  lost  0 min  target  120/5     meets
   W03  calder-ai-gw               T2  down    0 min  lost  0 min  target  480/60    meets
   W04  mes-event-listener         T2  down    0 min  lost  0 min  target  480/60    meets
   W06  test-certificate-archive   T2  down  120 min  lost 15 min  target  480/60    meets
   W07  notification-coding-batch  T3  down   10 min  lost  0 min  target 1440/1440  meets
   Drill: region us10 lost for 24 h
   W01  order-exc-api              T2  down  240 min  lost  0 min  target  480/60    meets
   W02  distributor-order-status   T1  down   60 min  lost  5 min  target  120/5     meets
   W03  calder-ai-gw               T2  down  240 min  lost  0 min  target  480/60    meets
   W04  mes-event-listener         T2  down  300 min  lost  0 min  target  480/60    meets
   W06  test-certificate-archive   T2  down 1440 min  lost  0 min  target  480/60    MISSES
   W07  notification-coding-batch  T3  down 1440 min  lost  0 min  target 1440/1440  meets
   ```

3. And the cost:

   ```bash
   python3 unit21/resilience_plan.py --cost
   ```

   ```text
   W01  order-exc-api                 105.00 USD/month
         second instance                            30.00
         rebuild test, 1 day a year                 75.00
   W02  distributor-order-status    2,190.00 USD/month
         second instance                            60.00
         HANA replica in another zone              900.00
         HANA replica in the paired region         900.00
         standby app, one instance                  60.00
         custom domain and DNS health checks       120.00
         failover test, 2 days a year              150.00
         standby 14,760.00 USD a year; saves 23 h x 600 = 13,800.00 per 24 h region outage
         break-even: 1.07 region outages a year
   W03  calder-ai-gw                  195.00 USD/month
         second instance                           120.00
         rebuild test, 1 day a year                 75.00
   W04  mes-event-listener             75.00 USD/month
         rebuild test, 1 day a year                 75.00
   W06  test-certificate-archive        0.00 USD/month
   W07  notification-coding-batch       0.00 USD/month
   Total 2,565.00 USD/month (course values)
   ```

> **Note** These results come from course values in the script (tiers, recovery minutes, prices and outage costs), not from a real SAP system or SAP price list. They show the method. Your recovery times come from your own rehearsals, and your prices from SAP's estimator and your contract.

Two things stand out. First, W06 still misses the region drill: SAP offers no customer-side regional option for it in this design, and Calder accepted that in writing (the archive can re-send certificates within a day). That is what R06 asks for: a miss you chose, not a miss you didn't see. Second, W02's standby now costs 14,760 USD a year against 13,800 USD of disruption saved per 24-hour regional outage: it breaks even only at about one regional outage a year. The standby is there because Calder's distributor agreements promise the portal back within two hours (a course assumption), not because the outage math pays for it. The remaining WARN on W02 is the chain rule: the portal can't be more available than S/4HANA, and the target was kept and the warning recorded.

#### Step 7: Write the plan

```bash
python3 unit21/resilience_plan.py --write
```

```text
Wrote unit21/calder_resilience_plan.md
```

Open `unit21/calder_resilience_plan.md`. It holds the table of workloads, the open findings and an empty decision record. Fill the decision record in with the ADR from the architecture view below, then commit:

```bash
git add unit21/resilience_plan.py unit21/calder_resilience.json unit21/calder_resilience_plan.md
git commit -m "Unit 21: Calder resilience plan"
```

#### Sketch: pairing subaccounts on a real global account

> **Note** This is a **sketch**. It needs an enterprise global account with two production subaccounts in a paired region pair, the Central Disaster Recovery Administrator role in both, and the btp CLI from [Set up for Unit 21](https://erpfde.com/topics/set-up-for-unit-21/). Check the *SAP BTP Multi-Region Guide* for supported services and region pairs first. Don't run it on a trial account.

```bash
# Sketch: needs an enterprise global account and two paired production subaccounts
btp login
btp create disaster-recovery/subaccount-pair --help   # read the parameters your CLI version expects
btp get disaster-recovery/subaccount-pair --help
```

The same pair as Terraform (provider `SAP/btp`, resource added in March 2026):

```hcl
# Sketch: subaccount IDs come from your own global account
resource "btp_disaster_recovery_subaccount_pair" "ext_prod" {
  subaccount_id        = var.calder_ext_prod_id      # us10
  paired_subaccount_id = var.calder_ext_prod_dr_id   # us11
}
```

#### How the code works

| Part of the script | What it does |
| --- | --- |
| `TIERS`, `DEPENDENCY_AVAILABILITY` and the constants | The model: targets per tier, availability per dependency, recovery minutes and monthly costs |
| `design()` | Builds the draft or reviewed design for W01 to W04, W06 and W07 |
| `composite()` | Multiplies the availability of every dependency in a workload's chain |
| `az_drill()` | Minutes down and minutes of data lost when one zone is lost, from instances, zone spread, node pool and database replica |
| `plan_problems()` and `region_drill()` | Lists what stops a rebuild or standby from working; a plan with any problem counts as waiting for the region |
| `check()` | Applies rules R01 to R10 and prints OK, WARN or FAIL with a reason |
| `cost()` and `print_cost()` | Adds up the monthly cost of each resilience choice and the standby's break-even |
| `write_plan()` | Writes the plan as a Markdown table with findings and an empty decision record |

The rules: R01 instances and zone spread (SAP's advice), R02 health checks (SAP's advice), R03 PodDisruptionBudget for Kyma (SAP's advice, a warning), R04 zone loss within the tier, R05 a region plan for every workload, R06 region loss within the tier or an accepted exception with an owner and a review date within 12 months, R07 configuration as code and a rehearsal within 12 months, R08 the prerequisites for the plan (domain, DNS, data, connector), R09 the chain of SLAs against the target (a warning), R10 backups kept at least 14 days with a restore tested within 12 months. R04 to R10 are course rules.

#### If something goes wrong

| What you see | What it means | What to do |
| --- | --- | --- |
| `python: command not found` or `'python' is not recognized` | Python isn't on your PATH, or the venv is off | Turn on the venv (Step 1). On macOS/Linux use `python3`. |
| `calder_resilience.json not found` | `--check`, `--drill`, `--cost` or `--write` ran before a design existed | Run `--init` or `--reviewed` first |
| `json.decoder.JSONDecodeError` | The design file was edited and is no longer valid JSON (often a missing comma) | Fix the line the error names, or write it again with `--reviewed` |
| `KeyError: 'depends'` or another field name | A workload you added is missing a field | Copy every field from an existing workload, as in the exercise |
| Your numbers differ from the sample | The script or the design file was changed | Paste the script again and rerun `--init`; the output depends only on the code |
| `ModuleNotFoundError` | You are running another file, or an old Python 2 | Check the file name and run `python --version` (3.9 or later) |
| A proxy or network error | Nothing in this walkthrough uses the network | Check you ran this script, not one from another topic |

### The SAP way

What SAP provides, as of 27 November 2026:

- **Multi-zone runtimes.** Cloud Foundry spreads app instances across zones and restarts unhealthy ones; Kyma production plans run the control plane and default worker nodes across three zones, with high availability for your workloads left to replicas, topology spread and probes ([Cloud Foundry](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/10-concepts/availability-zones-in-the-cloud-foundry-environment-b6a7e11.md), [Kyma](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/10-concepts/availability-zones-in-the-kyma-environment-a649bd9.md)).
- **In-Metro disaster recovery** for services in scope, on BTP regions on AWS and Azure: RPO 5 minutes and RTO 2 hours as contractual obligations, a customer-facing DR plan updated at least yearly and a yearly DR test ([SAP BTP documentation](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/10-concepts/resilience-high-availability-and-disaster-recovery-e3ac4f7.md)). The BTP Supplement points to the *SAP BTP Disaster Recovery Overview* for which services get enhanced disaster recovery.
- **SAP HANA Cloud replicas**, synchronous or asynchronous, within a region, and a cross-region replica in listed region pairs; extra cost, production only ([SAP Learning](https://learning.sap.com/courses/provisioning-and-administering-databases-in-sap-hana-cloud/increasing-the-resilience-of-a-sap-hana-cloud_da093727-bd34-4f33-b498-b9cc5eed1e7c)).
- **The ABAP environment's multi-zone option**, `multi_availability_zones`, doubling HANA Compute Units ([SAP BTP documentation](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/50-administration-and-ops/resilience-of-an-abap-environment-system-4f380f8.md)).
- **Subaccount pairs for multi-region disaster recovery**, with instance and subscription pairs, in the btp CLI and the Terraform provider ([Terraform provider docs](https://github.com/SAP/terraform-provider-btp/blob/main/docs/resources/disaster_recovery_subaccount_pair.md)). Supported services, region pairs and the failover procedure are in the *SAP BTP Multi-Region Guide*, which this run couldn't open.
- **A reference architecture and samples** for two regions with DNS failover, custom domains, HANA Cloud and Advanced Event Mesh replication, and the Multi-Region Manager control plane ([SAP Architecture Center](https://architecture.learning.sap.com/docs/ref-arch/bbfc34)). SAP calls these reference designs, not turnkey solutions.
- **Licensing.** Replicas, a second subaccount's services and a custom domain are billed like any other consumption; [BTP commercial models and cost control](https://erpfde.com/topics/btp-commercial-models-and-cost/) covers how BTP charges add up.

### Build vs. SAP

| Need | What SAP gives you | What you build | Usual answer |
| --- | --- | --- | --- |
| Survive a VM or container crash | Restarts and rescheduling | Two or more instances, HTTP health checks | Always |
| Survive a zone loss, stateless app | Multi-zone runtimes | Instance count, topology spread, PodDisruptionBudgets | Always |
| Survive a zone loss, database | HANA Cloud replicas, ABAP multi-zone option | Choose and pay for the replica | Tier 1 and most tier 2 |
| Survive a region loss, stateless | Paired regions, subaccount pairs | Configuration as code, a pipeline that deploys to an empty subaccount, a rehearsal | Rebuild |
| Survive a region loss, stateful | Cross-region HANA Cloud replica, instance pairs where supported | Custom domain, DNS failover, control plane, connector, rehearsals | Standby, only where a contract or regulation requires it |
| Recover configuration | Export APIs for roles, trust and destinations | Keep it as code | Always |

### Architecture view

**Where it sits.** Calder's production subaccounts in `us10`, the standby subaccount in `us11`, and what each depends on outside BTP:

```mermaid
flowchart LR
  subgraph US10[us10]
    AI[calder-ai-prod<br/>W01, W03, W07]
    EXT[calder-ext-prod<br/>W02, W04, W06]
  end
  subgraph US11[us11]
    DR[calder-ext-prod-dr<br/>W02 standby]
  end
  DNS[orders.calder-pumpworks.example<br/>DNS health checks] --> EXT
  DNS -.-> DR
  EXT -. HANA replica .-> DR
  AI & EXT & DR --> SCC[SCC-RK-P master + shadow]
  SCC --> S4P[S/4HANA S4P, RISE]
  MES[Rockford MES] -->|mes-in.calder-pumpworks.example| EXT
  GIT[Git: Terraform + MTA] -->|rebuild| US11
```

**Non-functional requirements that decide the design:**

| Requirement | Typical target (course values) | What breaks if it's missed |
| --- | --- | --- |
| RTO per tier | T1 2 h, T2 8 h, T3 24 h | Distributors and clerks work by phone; confirmations pile up |
| RPO per tier | T1 5 min, T2 60 min, T3 24 h | Questions or confirmations are lost and must be re-entered |
| Instances per production app | At least 2, across zones | A zone loss takes the app down |
| Database replica | Synchronous, another zone, for T1 | Hours to recreate from backup, 15 minutes of data lost |
| Restore and failover rehearsal | At least every 12 months | The first real failover is also the first test |
| Configuration as code | Every subaccount, role collection and destination | A rebuild needs days of manual setup |

**Integration and identity.** Users sign in through SAP Cloud Identity Services, which SAP's reference architecture describes as already multi-region; the standby subaccount needs the same trust configuration and role collections, created by the same code ([BTP security model](https://erpfde.com/topics/btp-security-model/)). Calls to S/4HANA go through destinations and the Cloud Connector pair `SCC-RK-P` in both subaccounts, so the connector must be connected to `calder-ext-prod-dr` before the first rehearsal. Data flows one way, from the primary's HANA Cloud to the replica, and reverses only during a failover. Callers outside BTP, such as the Rockford MES and distributors' browsers, use custom domains, never a region's own host name.

**The decision to record** (short ADR form from [the design-doc topic](https://erpfde.com/topics/writing-a-solution-design-doc/)):

- **Context:** six production workloads in `us10`; the distributor portal W02 is customer-facing and holds distributors' questions; Calder's distributor agreements promise the portal back within two hours (course assumption); everything else can wait a working day; the draft relied on multi-zone defaults and a half-built standby.
- **Options:** (1) accept regional risk for everything; (2) standby for every workload; (3) zone-resilient design for all, rebuild from code for the stateless workloads, a standby only for W02, accepted risk for W06 and W07.
- **Decision:** option 3, with W02's standby in `us11` on a HANA Cloud cross-region replica created at provisioning, a custom domain behind health-checked DNS, and a yearly rehearsal with a business test.
- **Consequences:** about 2,565 USD a month in course values, 2,190 of it for W02; the HANA Cloud instance for W02 must be provisioned with the replica, so it can't be added later without migrating data; every subaccount moves into Terraform before the next rehearsal; W06's exception is reviewed by 30 June 2027; the portal's availability remains bounded by S/4HANA's, and that is recorded.

**What a design review will ask:**

1. For each workload, what are the RTO and RPO, who signed them, and which drill shows they are met?
2. Which of the services you rely on are inside SAP's In-Metro scope, and where is that written?
3. If `us10` is lost tonight, what is the first command someone runs, and when was it last run?
4. What would you have to recreate by hand, and why isn't it in code?
5. What does the standby cost a year, and which commitment pays for it?

### Production concerns

- **Security and authorizations.** A standby is a second production environment: same roles, same audit logging, same secret rotation. Keep the Central Disaster Recovery Administrator role to the platform administrators, and give failover a written runbook with named approvers.
- **Evaluation.** Test the plan, not only the app. Restore a database to a point in time in a test subaccount, rebuild a stateless workload into an empty subaccount, and fail W02 over once a year with a distributor-facing test. Record the measured minutes and compare them with the targets.
- **Cost.** Price each resilience choice separately and attach it to the workload that needs it. Replicas and standby subaccounts are the big items; rehearsals are the cheap ones that make the rest worth paying for.
- **Operations.** Monitor both sides: the replica's lag, the standby's health check and the DNS failover state belong on the same dashboard as the app ([observability on BTP](https://erpfde.com/topics/btp-observability/)). Ship releases to both regions from one pipeline ([CI/CD and transport management on BTP](https://erpfde.com/topics/btp-cicd-and-transport/)), so the standby never falls behind.
- **Clean core.** Nothing here changes S/4HANA. Its own high availability and disaster recovery are bought with RISE and covered in Unit 29.

### Where AI fits

- **Agents are workloads with a chain of their own.** An agent such as W01 depends on the generative AI hub as well as S/4HANA. Model calls can fail or slow down independently of BTP's zones, so the resilience pattern there is a fallback model, not a second region: see [model routing with fallbacks](https://erpfde.com/topics/model-routing-with-fallbacks-in-the-sap-cloud-sdk/). A gateway in front of the models, like W03, is a single point of failure unless it runs at least two instances ([AI gateways](https://erpfde.com/topics/ai-gateways-for-model-and-agent-traffic/)).
- **Where models run matters for a region plan.** Rebuilding an agent in another region only works if the models it uses are available there and data may be processed there. Check both before choosing *rebuild*.
- **Agent state is data.** An agent that keeps conversation memory or checkpoints, as in [agent memory and long-running agents](https://erpfde.com/topics/agent-memory-and-long-running-agents/), is stateful: its store needs the same replica and backup decisions as any database.
- **AI can help write the runbook, not run the failover.** A model can draft a failover runbook from the plan file. A regional failover is a decision with business consequences, and it stays with a named person.

### Pitfalls

- **One instance in production.** It works until its zone or host fails, then the restart depends on spare capacity.
- **Process health checks.** A hung app stays "healthy" and keeps receiving traffic.
- **Kyma replicas without topology spread.** Two replicas can sit in the same zone.
- **An additional Kyma node pool without high availability.** It lives in one zone, and the setting can't be changed in place.
- **Deciding on a cross-region database replica after go-live.** SAP Learning says the HANA Cloud cross-region replica is created at first provisioning.
- **A standby that can't reach S/4HANA.** The Cloud Connector must be connected to the standby subaccount too.
- **Region host names in callers.** Shop-floor systems, partners and bookmarks must use your custom domain.
- **Configuration kept only in the cockpit.** After a disaster, nobody remembers every role collection and destination.
- **Never rehearsing.** An untested failover plan is a guess.

### Exercise

Calder moves W08, the casting porosity image check on Kyma from [BTP runtimes compared](https://erpfde.com/topics/btp-runtimes-compared/), into production. It runs on an additional node pool of large machines, and the platform team created the pool without high availability.

1. Run `python3 unit21/resilience_plan.py --reviewed` so you start from the reviewed design.
2. Open `unit21/calder_resilience.json` and add this object to the end of the `workloads` list (put a comma after the closing `}` of W07):

   ```json
   {"id": "W08", "name": "porosity-image-check", "tier": "T2", "runtime": "kyma",
    "subaccount": "calder-ai-prod", "owner": "00100288", "instances": 2, "zone_spread": true,
    "health_check": "probes", "pdb": true, "memory_gb": 24.0, "store": null, "multi_az": null,
    "node_pool_ha": false, "called_by": [], "outage_cost_per_hour": 80,
    "depends": ["kyma", "aicore"],
    "region_plan": {"plan": "accept", "exception": {"owner": "00100288", "review_by": "2027-11-30",
      "reason": "castings wait at incoming inspection; inspectors check by eye"}}}
   ```

3. Run `python3 unit21/resilience_plan.py --check`. You should see `R01  W08  FAIL  2 replicas, spread across zones, node pool in one zone` and the last line `50 checks: 48 OK, 1 WARN, 1 FAIL`.
4. Run `--drill az`. W08 is down for 360 minutes: the whole zone outage, because its pool lives in one zone. It still meets T2's 480 minutes, which is why R01 checks the design and not only the drill.
5. Fix it the way the platform team must: the pool is deleted and recreated with high availability. Change `"node_pool_ha": false` to `true` and check again.
6. Run `--write` and add a line to the decision record: "W08's node pool recreated with high availability; regional risk accepted until 2027-11-30."
7. Commit the design and the plan.

**Done when** `--check` prints `50 checks: 49 OK, 1 WARN, 0 FAIL` and `calder_resilience_plan.md` lists W08 with its owner. The plan feeds the Terraform topic later in Unit 21, which turns the rebuild plans into code, and the high availability topic in Unit 29.

### Check yourself

1. Calder's AI gateway W03 runs two instances with a process health check. What does rule R02 protect against?
   - A. A zone loss, which two instances can't survive without an HTTP check
   - B. A hung gateway that stays "healthy" and keeps receiving requests
   - C. A regional outage, which the health check would detect first
   - D. Losing the gateway's database, which the check would restore

   Answer: B. Cloud Foundry restarts instances it considers unhealthy. A process check only sees whether the process exists, so a hung gateway passes it; an HTTP check calls an endpoint and fails when the app stops answering.

2. Why does the draft's W02 fail the zone drill even though it runs two app instances?
   - A. Two instances are always placed in the same zone on Cloud Foundry
   - B. Its custom domain points at only one zone
   - C. Its HANA Cloud database has no replica in another zone
   - D. In-Metro DR doesn't apply to apps with a database

   Answer: C. The app instances survive in the remaining zone, but the database doesn't. Without a replica, the course model recreates it from backup in about three hours and loses up to 15 minutes, which misses T1's 2 hours and 5 minutes.

3. A W04 replica set has two replicas but no topology spread constraint. What is the risk?
   - A. Kyma refuses to schedule more than one replica in any single zone
   - B. Both replicas may be placed in one zone and go down together
   - C. The control plane then runs in one zone instead of three zones
   - D. The replicas can't use a PodDisruptionBudget

   Answer: B. Kyma runs its own components across three zones but leaves your workloads to you. Without topology spread, the scheduler may put both replicas in the same zone.

4. The draft standby for W02 has a custom domain and DNS failover. What still stops it from working?
   - A. The standby app runs one instance instead of the two it needs
   - B. Identity Authentication must be copied to the second region
   - C. The paired region `us11` doesn't support Cloud Foundry
   - D. No data in `us11`, and no Cloud Connector link to it

   Answer: D. A standby needs the data already in the second region and a path to S/4HANA. Identity Authentication is already multi-region according to SAP's reference architecture, and one standby instance is a cost choice, not a blocker.

5. The team proposes "rebuild" for the stateful W02 to save money. Why does the check refuse it?
   - A. Rebuild is only allowed for workloads that run on Kyma clusters
   - B. A rebuild can't bring back data held only in the lost region
   - C. Rebuild needs a rehearsal every month, which is too costly
   - D. Rebuild needs an SLA above 99.9% for every service in the chain

   Answer: B. Rebuilding recreates apps and configuration from code. The distributors' questions live in a database in the lost region, and HANA Cloud backups stay in that region, so a rebuilt portal would start empty or wait.

6. Your HANA Cloud database for a new tier 1 app goes live next month without a cross-region replica, "to add later". What do you do?
   - A. Nothing: a cross-region replica can be added after go-live like any other replica
   - B. Rely on In-Metro DR, which covers regional outages for HANA Cloud
   - C. Switch to the ABAP environment's multi-zone option instead
   - D. Decide now, since the replica is created only at first provisioning

   Answer: D. SAP Learning says the cross-region replica can only be created when the instance is first provisioned. In-Metro DR covers the loss of a zone, not a region; adding the replica later means a new instance and a data migration.

7. W02's chain of SLAs gives 99.10% against a target of 99.5%. What does the warning tell the architect?
   - A. BTP's SLA is too low and a second region will raise it above 99.5%
   - B. The target is met, because real availability always exceeds the SLA
   - C. S/4HANA's 99.7% dominates the chain, so record the target or change it
   - D. The Cloud Connector must be replaced by a cloud-only connection

   Answer: C. The product of SLAs is a pessimistic floor, and its weakest link is S/4HANA. No BTP design can make the portal more available than the system it reads from, so the honest answer is to record the gap.

8. What does the W02 standby's break-even of about one regional outage a year mean for the decision?
   - A. The standby is clearly worth it, because regions fail about once a year
   - B. Outage cost alone doesn't justify it; the 2-hour promise does
   - C. The standby should be removed and the distributors' promise ignored
   - D. The break-even proves the course values are wrong and must change

   Answer: B. Region-wide outages are rare, so the expected disruption saved is below the standby's cost. The standby stays because of a contractual recovery time, which is why the ADR names that commitment.

## Sources

- [Resilience, High Availability, and Disaster Recovery (SAP BTP documentation, SAP-docs on GitHub, read 2026-11-27)](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/10-concepts/resilience-high-availability-and-disaster-recovery-e3ac4f7.md): services deployed across multiple AZs; SAP-managed platform backups only for some foundation services, most backups the customer's responsibility; standard DR restores productive tenants from backups with no fixed recovery timelines; In-Metro DR with synchronous replication across AZs in one region, contractual RPO 5 minutes and RTO 2 hours, annual DR test, regions on AWS and Azure, scope in the SAP BTP Disaster Recovery Overview
- [Availability Zones in the Cloud Foundry Environment (SAP BTP documentation)](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/10-concepts/availability-zones-in-the-cloud-foundry-environment-b6a7e11.md): platform components and app VMs distributed across AZs; run multiple app instances; the scheduler spreads instances across AZs; health checks restart unhealthy instances; missing instances rescheduled
- [Availability Zones in the Kyma Environment (SAP BTP documentation)](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/10-concepts/availability-zones-in-the-kyma-environment-a649bd9.md): default worker nodes and control plane in three AZs; high availability not automatic for user applications (replicas, topology spread, probes); additional worker node pools without HA sit in one random zone and the setting can't be changed in place
- [Kyma Environment Backup (SAP BTP documentation)](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/50-administration-and-ops/kyma-environment-backup-ab959cf.md): Kyma provides no point-in-time backup of objects or volumes; etcd snapshots for automatic cluster restore; GitOps recommended for objects; volume data not backed up, use VolumeSnapshots
- [Resilience of an ABAP Environment System (SAP BTP documentation)](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/50-administration-and-ops/resilience-of-an-abap-environment-system-4f380f8.md): without the multi-AZ option, system and database preferably in one AZ with automated restart; with multi_availability_zones true, app servers spread across AZs and two synchronously replicated HANA Cloud instances; ACUs unchanged, HCUs doubled; complete AZ outages need SAP's manual declaration; at least two (better three) application servers
- [Backups (ABAP environment, SAP BTP documentation)](https://github.com/SAP-docs/btp-cloud-platform/blob/main/docs/50-administration-and-ops/backups-ab4f108.md): relies on SAP HANA Cloud backups, kept up to 30 days, RPO no more than 15 minutes; point-in-time restore by service request on component BC-CP-ABA, coordinated with SAP; restores only the ABAP database
- [Increasing the Resilience of a SAP HANA Cloud (SAP Learning, read 2026-11-27)](https://learning.sap.com/courses/provisioning-and-administering-databases-in-sap-hana-cloud/increasing-the-resilience-of-a-sap-hana-cloud_da093727-bd34-4f33-b498-b9cc5eed1e7c): one or two replicas, synchronous in the same or another AZ, or asynchronous in another AZ; replicas cost extra and are production only; multi-region DR is an asynchronous active-passive replica in another region, failover triggered manually from the secondary, pairs cf-us10/cf-us11 and cf-eu10/cf-eu13 (AWS), replica created only at first provisioning; backups every 24 hours plus log backups every 15 minutes
- [Multi-Region HA/DR Resiliency for SAP BTP (SAP Architecture Center, last updated 2025-02-19)](https://architecture.learning.sap.com/docs/ref-arch/bbfc34): multi-AZ by default, multi-region is for customers to architect; two subaccounts in separate regions; DNS-based load balancers with health checks; SAP Custom Domain service for one URL; HANA Cloud replication and Advanced Event Mesh DMR for state; Multi-Region Manager sample as control plane; reference designs, not turnkey; TCO page says redundancy can double costs and Identity Authentication is already multi-region
- [btp_disaster_recovery_subaccount_pair (Terraform provider for SAP BTP, SAP on GitHub, added March 2026)](https://github.com/SAP/terraform-provider-btp/blob/main/docs/resources/disaster_recovery_subaccount_pair.md): creates a subaccount pair; Central Disaster Recovery Administrator in both subaccounts; each subaccount pairs with only one; instance pairs and subscription pairs can then be created; links SAP BTP Multi-Region Guide
- [SAP Business Technology Platform Supplemental Terms and Conditions (v11 2025, PDF)](https://assets.cdn.sap.com/agreements/product-use-and-support-terms/cls/en/sap-business-technology-platform-supplement-english-v11-2025.pdf): System Availability SLA 99.9% per month for the cloud services, deviations in the Service Description Guide; beta and free tier excluded from SLAs; platform applications must restore their running state without manual intervention; enhanced DR for some services as described in the SAP BTP Disaster Recovery Overview
