Red Hat Raffle Powered by OpenShift and SAP HANA

Introduction

 

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.

Red Hat Raffle Architecture

 

OpenShift

 

OpenShift is Red Hat's platform as a service (PaaS), built around a core of application containers powered by Docker, with orchestration and management provided by Kubernetes, on a foundation of Red Hat Enterprise Linux. For purposes of the Red Hat Raffle architecture, I use minishift on my laptop connected to Ethernet at the booth. The Ethernet access eliminates the issue with unreliable wifi. Minishift is a single node cluster with a very minimal resource requirements. It also comes with its own Docker registry, so it is easy to install and setup. It's ideal for a single event where we may have 6,000-20,000 scans.

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: