This website define our expertise of migrating monolithic software like Organization Product sales and Procurement Model(ESPM) and SAP HANA Interactive Training (Glow) jogging on SAP Cloud Platform, Neo atmosphere (Neo) to a microservice-centered application managing on SAP Cloud System, Cloud Foundry surroundings (Cloud Foundry) and highlights a several lessons we figured out together the way.
For a normal overview and tips for refactoring monolithic apps to microservices certification, consider a appear at the Best Practices for Adapting SAP Cloud Platform Application to the Cloud Foundry Ecosystem tutorial.
Reworking a monolithic software into microservices certification is a form of application refactoring, whereby application performance is envisioned to remain the same but brings in the positive aspects of microservices certification.
Our team refactored two apps, applying a distinctive approach for just about every. I’ll clearly show you what we did with these purposes and share what we figured out from the practical experience.
Organization Revenue and Procurement Product (ESPM)
The ESPM application is a reference application that demonstrates how to construct applications in the Neo surroundings of SAP Cloud Platform and deploy them to a Java runtime.
ESPM Monolith Architecture
Migration Tactic: Common Codebase
To quickly transform this software to a microservice-dependent application, we chose to utilize a frequent codebase tactic. We determined to break up the front end and the back again conclude code. This tactic is not new, as the Neo setting presently supports deploying the front stop independently in an HTML5 container and the again end in a Java Runtime container.
The software, which was packaged as Java web archive (war), experienced the Java again stop implementation and static world-wide-web webpages in the identical Java website undertaking. Our first action was splitting this into two areas:
- The entrance conclude, which provided the static net information
- The again conclusion, made up of the company logic composed in Java
In addition to splitting the software, two new significant pieces of the overall architecture involve the application router (AppRouter) ingredient and User Account and Authentication assistance (UAA).
The software was not making use of any native SAP HANA capabilities, so we moved to PostgreSQL, which is an open up resource relational database that’s out there, by default, on Cloud Foundry. For the reason that the Java Persistence API (JPA) was made use of for persistence it was less complicated to go from SAP HANA in Neo to PostgreSQL database in Cloud Foundry as there were being modifications in only databases configuration and motorists.
ESPM Microservice Architecture
Steps for refactoring ESPM
- Split static web information and Java again close code into two different modules.
- Combine the application router (AppRouter) into the world-wide-web module and configure it.
The AppRouter constitutes a singular entry issue into a microservice-centered architecture. The widespread tips from XS superior programming model is to offer the static net written content into the AppRouter itself. This benefits in AppRouter and website module operating as a solitary microservice, that constitutes the front conclusion. In addition to routing, you have to also configure the AppRouter to delegate authentication and authorization to UAA, so that the person microservices certification do not have to deal with this facet.
- Build the application router configuration file (xs-application.json).
Th xs-application.json file incorporates routing details for requests from the website module to the java again finish. This file is used by the AppRouter to dispatch requests to the back again finish, authenticate users, and so on.
- Enable databases binding in the Java back again finish.
The Neo ecosystem works by using Java Naming and Directory Interface (JNDI) binding, while Cloud Foundry makes use of company binding the code need to hence be adapted accordingly. A variety of open up source libraries like Spring Cloud Connectors can help.
- Configure authentication and authorization.
Use the built-in container authentication offered with the SAP Java buildpack or the Spring protection library.
- Make the application security descriptor (xs-protection.json) and define all the scopes for authorization right here.
- Generate the software manifest.yml
Amid other points application manifests inform Cloud Foundry how many situations to produce and how a great deal memory to allocate to the solutions that the programs ought to use.
The migrated ESPM application can be observed in Github
- A minimum established of ways are demanded to migrate a straightforward application from Neo to Cloud Foundry.
- We could not migrate the complete software because of to lacking solutions, like Document Providers, in the Cloud Foundry surroundings. We applied a proxy application operating on Neo to consume Doc Providers from Neo in Cloud Foundry.
SAP HANA Interactive Schooling (Glow)
SAP HANA Interactive Schooling, or Glow, is a demo software…