The programming approach with microservices splits monolithic software into bites. The individual pieces keep themselves up to date and the programmer’s work is accelerated. Who would not have lost count of the number of cups of coffee drunk during the waiting time of a build or deployment? The microservice approach aims to put an end to this.
SAP Cloud Platform Extension Factory – Microservice as a Service
SAP’s answer to this trend is Cloud Platform Extension Factory – the commercial hosting offer for microservices or “lambdas” as they are called by SAP. It was presented in October 2018 and has since been rolled out successively.
SAP Cloud Platform Extension Factory has predefined interfaces with SAP C/4HANA and SAP Cloud Platform Services. Integrations for SAP Commerce Cloud have been available since the beginning of 2019. This is where we start to have a look at how the SAP Commerce Cloud development is going to change in a future cloud-native world.
Kyma: Open Source Platform for cloud-native intelligent enterprises
If you look under the hood of SAP Cloud Platform Extension Factory, you will find Kyma, the Open Source Initiative by SAP. Last October, the platform project was published which combines the applications and services of third-party providers in a cloud-native environment. It can be installed on the Google Cloud Platform, Microsoft Azure or on premises.
If you go deeper into Kyma, you will learn its structure: Kyma uses Google’s Knative, an administration tool based on Kubernetes, in order to directly start programming. Between the Knative and Kubernetes layers, Istio can bring its strengths of API management and monitoring into play. Istio was developed by Google and IBM to increase the utilization and system stability of a cluster.
Kyma and SAP Commerce Cloud
When using Kyma, we noticed the high development speed. The installation instructions therefore changed abruptly one day in late autumn 2017 since they no longer focused on the installation of Microsoft Azure but specifically on Google Cloud Platform. With the start of version 0.7 in February 2018, the installation of Azure again became part of the documentation. Moreover, Knative was newly implemented with version 0.8 in March 2018.
With SAP Commerce Cloud Version 1808, an SAP Cloud Platform Extension Factory was integrated. It is very easy to connect a shop system with a microservice. Kyma generates a link with token that will be included in SAP Commerce and used to establish the connection, which is secured via SSL.
SAP Commerce development with Kyma: terminology
Once the connection has been established, you will find yourself in a world of interesting terms that are explained in short now.
Kyma generates “lambdas”. These are functions triggered and executed by an event. “Node.js skills” are needed here to develop the lambdas.
If a lambda has delivered a content to the shop system, it will receive a business event note. Here, the SAP Commerce Cloud Business Event System comes into play, which controls order processes for instance. The microservice is integrated into the shop logic by combining lambdas and business events.
It is decided within a business event which event will be called next. Once the result of a Web service has, for instance, been OK, NOK or CANCEL, the next steps will be started. These are transitions that are used to select an event.
Experiences made when installing Kyma locally
As is usual with experiments, the system appeared to be very erratic at the beginning until we understood the particularities of the underlying minikube. It is recommended that you wait a little while after every step during the installation as sometimes the initialization of the Kyma system is not finished. In the background, many services depending on each other are booted up. No starts are alike.
We have adjusted the “installation/scripts/minikube.sh” script by adding proxy settings as well as a “dockerconfig”. Talking about scripts: Minikube should only be started via Kyma scripts and not with the Minikube start command. This may destroy the configuration.
We have started a Nginx server for the communication of our test shop system with the local Kyma installation. The corresponding Kyma URLs had to be entered in the host file of our test shop. The SAP Cloud Platform Extension Factory solution eliminates this basic work.
Technologies are evolving; what counts is knowledge and experience. SAP’s step towards microservices is another opportunity to provide process knowledge. It is conceivable, for instance, to use a unit calculator that converts a square meter price into the corresponding number of rolls that are finally thrown into the shopping cart. Or the simplified access to customer-specific prices from an ERP system.
Now it’s getting interesting: if the ERP system is converted to SAP S/4HANA, the integrity of the shop remains unchanged, i.e. no restart, no deployment. In the microservice, only one switch is implemented on a new external system. And then you deserve to enjoy your cup of coffee!