Spring Boot on OpenShift with SAP HANA - Red Hat Raffle
Posted by tejones in Virtual Thoughts on Sep 11, 2018 1:54:40 PMIntroduction
As a developer/solution architect/technical marketing engineer/whatever (red) hat du jour, I attend a lot of conferences. I mostly give presentations about Red Hat with SAP and other partners and work the booth on the show floor. In doing so, I get to see the infrastructure of many different venues and events. There is little consistency except the fact that the wifi is usually pretty sketchy. I also see a lot of different marketing approaches from the various Red hat marketing groups. Giveaways, booth layout and location, etc. In an effort to utilize the valuable products that Red Hat has to offer and show integration with SAP HANA from OpenShift, we created a Spring Boot service, mobile iOS scannner application and a web app to support event raffle drawings. It is available here: http://github.com/tejones/redhat-raffle-sap-hana .
Red Hat Raffle
Red Hat Raffle started with postgres as the backend database. This worked well at several events, but with SAP TechEd in Las Vegas looming, we thought it would be cool to show how an OpenShift instance could host a containerized Spring Boot application with an external SAP HANA instance using a combination of interesting and powerful technologies. Let's take a look.
The Technology
There are various projects used in this architecture. This diagram illustrates how they work together. I will discuss all of the different bits down below.
OpenShift
Spring Boot with Hibernate Running in an Embedded Tomcat
Spring Boot is one of the leading frameworks for building web applications and REST APIs and it even includes Hibernate, the leading open source ORM (Object/Relational-Mapping) to make database persistence a snap. You can read more about ORMs and how they can help expedite the development process here. The Spring Boot application runs in a lightweight embedded Tomcat Servlet Container for a powerful, low footprint runtime environment.
Hibernate
There has been limited support for SAP HANA in Hibernate for some time via the SAP HANA Hibernate Dialect (a dialect is the component that helps generate source specific SQL), but recently SAP engineers improved the dialect by fixing bugs and adding additional functionality supported in SAP HANA. There is a dialect for both row and column HANA tables.
Fabric8 and Maven
Fabric8 is a powerful platform for CI/CD in OpenShift. It allows you to quickly make and test changes. Fabric8 uses s2i (source to image) to create a container from source and deploys to OpenShift. This allowed me to rapidly develop Red Hat Raffle. It is truly a game changer in the DevOps world. Fabric8 has a handy Maven plugin which I used for my development.
Call to Action
So what next? I recommend the following:
- Clone Red Hat Raffle with SAP HANA
- Don't have SAP HANA? Get it here!
- Follow the steps in the github repository readme to run at your next event.
- Feel free to re-brand for your company. After all, we are open source!
- Use this as a starter application for other projects.
- Enjoy!
Comments