Now available! Red Hat OpenShift Container Platform for Linux on IBM Z and LinuxONE Learn more

Archived | Build an enterprise Swift app using services

Archived content

Archive date: 2019-05-01

This content is no longer being updated or maintained. The content is provided “as is.” Given the rapid evolution of technology, some content, steps, or illustrations may have changed.


The Swift programming language is a general-purpose language for Apple platforms and Linux. This code pattern shows you how to build an enterprise Swift application that uses multiple services and libraries when you deploy the app to the IBM Cloud platform.


This code pattern shows you how to implement new enterprise capabilities when you deploy your Swift applications to the IBM Cloud platform. You’ll use the following IBM Cloud services and libraries for the Swift language:

  • Auto Scaling
  • Alert Notification
  • Circuit Breaker
  • SwiftMetrics

You’ll learn how to scale the application, receive alerts when important events occur, and prevent the application from executing actions that are bound to fail. The application also provides UI widgets for triggering actions that can increase or decrease memory usage, HTTP response time, and the number of HTTP requests per second.



  1. The user configures the setting for the Circuit Breaker library in the code before deploying the application to IBM Cloud (using their IDE of choice).
  2. After deploying the application, the user creates a policy on IBM Cloud to set up the Auto-Scaling and Alert Notification services. This task is performed using the IBM Cloud dashboard.
  3. The user interacts with the application UI in their browser.
  4. When the user performs any action, the UI calls the Swift application back-end component.
  5. When the conditions for the Auto-Scaling policy are satisfied, the application scales in IBM Cloud. Alert notifications are sent about the current conditions of the application that are triggering the Auto-Scaling rules.
  6. When several requests for the endpoint fail, the Circuit Breaker library activates for the configured endpoint.


Ready to put this code pattern to use? Complete details on how to get started running and using this application are in the README.

Ricardo Olivieri
Ishan Gulhane