SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Introduce Resilience to your Application

Introduce resilience to your application using the SAP Cloud SDK.

Overview

🎓 intermediate 15 min. SAP Cloud SdkIntermediateSAP S 4hanaSAP Business Technology PlatformCloudJava

You will learn

  • โœ”Why you should care about resilience
  • โœ”How to make the call to the OData service resilient by using resilience decorators
  • โœ”How to write Tests for code decorated with the new resilience decorators
  • โœ”To deploy the application on the Business Technology Platform Cloud Foundry
Unknown U Unknown July 29, 2024
Created by March 6, 2019
Contributors

Prerequisites

Steps

Step 1 Resilience
โ€”

Consider the following situation: you are developing a cloud application to provide a service to your customers. In order to keep your customers happy, you’re of course interested in achieving the highest possible availability of your application.

However, cloud applications, possibly spanned across multiple services, are inherently complex. So it is safe to assume that something, somewhere will fail at some point in time. For example a call to your database might fail and cause one part of your application to fail. If other parts of your application rely on the part that has failed, these parts will fail as well. So a single failure might cascade through the whole system and break it. This is especially critical for multi-tenancy applications, where a single instance of your application serves multiple customers. A typical S/4HANA multi-tenancy application involves many downstream services, such as on-premise S/4HANA ERP systems.

Let’s look at a concrete example: Suppose you have 30 systems your cloud application is dependent on and each system has a “perfect” availability of 99.99%. This means each service is unavailable for 4.32 minutes each month (43200 min * (1 โ€“ 0.9999) = 4.32 min).

Now assume failures are cascading, so one service being unavailable means the whole application becomes unavailable. Given the equation used above, the situation now looks like this:

43200 min * (1 โ€“ 0.9999^30) = 43200 min * (1 โ€“ 0.997) = 129.6 min

So your multi-tenancy application is unavailable for more than two hours every month for every customer!

In order to avoid such scenarios, you need to equip applications with the ability to deal with failure. If an application can deal with failures, it is called resilient. So resilience is the means by which availability is achieved.

Step 2 Resilience4j
+
Step 3 Make your OData call resilient
+
Step 4 Write tests for the resilient command
+
Step 5 Deploy application to Cloud Foundry
+
Step 6 Test yourself
+
Step 7 Test yourself
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 7
1. Resilience 2. Resilience4j 3. Make your OData call resilient 4. Write tests for the resilient command 5. Deploy application to Cloud Foundry 6. Test yourself 7. Test yourself

Learn more →