This public repository is read-only and no longer maintained.
The purpose of this hands-on session is to provide a deeper understanding of developing, deploying and operating cloud-native applications in the Cloud Foundry environment of SAP Cloud Platform.
Cloud Foundry is an open source Platform-as-a-Service (PaaS) technology with broad industry support. SAP Cloud Platform Cloud Foundry environment provides the benefits of the open source Cloud Foundry technology along with several, differentiating enterprise-grade features and functionalities.
A key design principle of Cloud Foundry is to build applications as scalable, stateless microservices that utilise various backing services for persistence, messaging, etc.
Microservices can be developed in practically any programming language as long as there is a corresponding Cloud Foundry buildpack. SAP Cloud Platform provides in-built support for certain buildpacks such as Java and NodeJS and allows use of any other community buildpacks.
SAP Cloud Platform includes several backing services including the flagship SAP HANA as well as other popular open source services such as PostgreSQL, RabbitMQ and Redis.
In addition, the Cloud Foundry environment of SAP Cloud Platform includes various other technical services such as Connectivity, AutoScaling, Security and Job Scheduler.
The exercises in the current hands-on utilise the following runtimes:
- Java
- NodeJS
- HTML5
For the current hands-on, various backing and technical services are used including:
- SAP HANA
- PostgreSQL
- RabbitMQ
- Connectivity
- Destination
- Authorisation & Trust Management (xsuaa)
- Application Logging
- Application Autoscaler
For application development and deployment, this hands-on uses the recently launched, powerful, web-based tooling - SAP Web IDE Full-Stack.
In particular, this hands-on uses the following capabilities of the SAP Web IDE Full-Stack:
- Application Programming Model which allows developers to focus on domain logic by providing integrated frameworks for data, service and user interface layers
- Developing Multi-Target Applications which enables holistic life cycle management of application modules aimed at disparate runtimes, and various underlying services
- Connect to Cloud Foundry services and consume them from the applications
- Using Source Control (Git) for connecting and interacting with the remote repositories
In order to elucidate the capabilities and benefits of the Cloud Foundry environment of SAP Cloud Platform, we have chosen a simple but modern business scenario for this hands-on exercise.
Think of a furniture shop business that wants to change the process of deciding which items are added to the shop. Instead of arbitrarily deciding the items in the shop, Franck (the person in charge of the department) , wants to take the following approach:
- First, create and publish a Wishlist of items he (Franck) would like to see in the shop
- Seek rating and comments from customers (like Mary in our scenario) for assessing the popularity of the items
- Franck to prioritise the items, their quantities, etc., for placing an Order
To realise the above scenario, the following microservices will be built.
First, we will have a Wishlist service for Franck to publish his Wishlist. This application will be built using:
- Application Programming Model of SAP Cloud Platform using SAP Web IDE Full-Stack
- For data persistence, this application will utilise SAP HANA
- For the front-end, this application will use SAPUI5 templates, available as a SAP Web IDE Full-stack capability.
Next, we will build upon the Wishlist service to add Ordering capabilities, for which, it is required to fetch certain data, such as product price, from on-premise backend systems. In order to connect to the backend system, this step will involve consuming various technical services from SAP Cloud Platform Cloud Foundry environment such as - connectivity, destination and xsuaa.
In order to seek ratings from customers like Mary and also involve additional customers via social channels, we will build a couple of services.
First, we will have a NodeJS based Ratings service which uses
- A simple front-end using a SAPUI5 template, for Mary to provide her ratings / comments
- PostgreSQL backing service for persisting the ratings / comments.
To engage other customers and seek greater customer input for rating the items, we will add a Tweet service that posts a message on the store's twitter account whenever a customer (like Mary) reviews any item in Franck's Wishlist. This service is also built using NodeJS. For the communication between the Ratings service and the Tweet service, we will use RabbitMQ backing service.
- Exercise 01 - What is Org and Space on CF
- Exercise 02 - Setup/System Preparation
- Exercise 03 - Publish Wishlist
- Exercise 04 - Order New Items
- Exercise 05 - Logging
- Exercise 06 - Comments and Ratings Backend
- Exercise 07 - Comments and Ratings Frontend
- Exercise 08 - Tweet Comments Backend
- Exercise 09 - Debugging
- Exercise 10 - Test Order New Items with User Input
- Exercise 11 - Autoscaling of Comments and Ratings
- Exercise 12 - Blue-Green Deployment of Comments and Ratings
This project is licensed under the SAP SAMPLE CODE LICENSE AGREEMENT except as noted otherwise in the LICENSE file.