Chapter 1. Introduction to Application Development with Spring Boot
This section explains the basic concepts of application development with Red Hat runtimes. It also provides an overview about the Spring Boot runtime.
1.1. Overview of Application Development with Red Hat Runtimes
Application development using Red Hat Runtimes for OpenShift includes:
- A collection of runtimes, such as, Eclipse Vert.x, Thorntail, Spring Boot, and so on, designed to run on OpenShift.
- A prescriptive approach to cloud-native development on OpenShift.
OpenShift helps you manage, secure, and automate the deployment and monitoring of your applications. You can break your business problems into smaller microservices and use OpenShift to deploy, monitor, and maintain the microservices. You can implement patterns such as circuit breaker, health check, and service discovery, in your applications.
Cloud-native development takes full advantage of cloud computing.
You can build, deploy, and manage your applications on:
- OpenShift Container Platform
- A private on-premise cloud by Red Hat.
- Red Hat Container Development Kit (Minishift)
- A local cloud that you can install and execute on your local machine. This functionality is provided by Red Hat Container Development Kit (CDK) or Minishift.
- Red Hat CodeReady Studio
- An integrated development environment (IDE) for developing, testing, and deploying applications.
To help you get started with application development, all the runtimes are available with example applications. These example applications are accessible from the Developer Launcher. You can use the examples as templates to create your applications. For more information on example applications, see the section Introduction to example applications.
This guide provides detailed information about the Spring Boot runtime. For more information on other runtimes, see the relevant runtime documentation.
1.2. Application Development on Red Hat OpenShift using Developer Launcher
You can get started with developing cloud-native applications on OpenShift using Developer Launcher (developers.redhat.com/launch). It is a service provided by Red Hat.
Developer Launcher is a stand-alone project generator. You can use it to build and deploy applications on OpenShift instances, such as, OpenShift Container Platform or Minishift or CDK.
For more information on how to download and deploy applications on Developer Launcher, see the section Downloading and deploying applications using Developer Launcher.
1.3. Overview of Spring Boot
Spring Boot lets you create stand-alone Spring-based applications. See Additional Resources for a list of documents about Spring Boot.
Spring Boot on OpenShift combines streamlined application development capabilities of Spring Boot with the infrastructure and container orchestration functionalities of the OpenShift, such as:
- rolling updates
- service discovery
- canary deployments
- ways to implement common microservice patterns: externalized configuration, health check, circuit breaker, and failover
1.3.1. Spring Boot features and frameworks summary
This guide covers the design of modern applications using Spring Boot. These concepts support developing Web or Websocket applications using either an HTTP connector or non-blocking HTTP connector. The applications can be packaged and deployed without modification or updated to use cloud native features on OpenShift.
The features in the table below are available as a collection of example applications that run on OpenShift. Some features are native to Kubernetes, others are available from Spring Cloud Kubernetes. Features such as Actuator are available directly in Spring Boot.
Table 1.1. Features and Frameworks Summary
|Feature||Problem Addressed||Cloud Native||Framework|
Switches between services and continues to process incoming requests without interruption in case of service failure.
Spring Cloud Netflix - Hystrix
Checks readiness and liveness of the service. Service restarts automatically if probing fails.
Spring Boot Actuator
Service Discovery// include::modules/TEMPLATE_CONCEPT_explaining_a_concept.adoc[leveloffset=+1]
Discovers Service/Endpoint deployed on OpenShift and exposed behind a service or route using the service name matching a DNS entry.
Yes - using Kubernetes API
Spring Cloud Kubernetes - DiscoveryClient
Server Side Load Balancing
Handles load increases by deploying multiple service instances, and by transparently distributing the load across them.
Yes - Using internal Kubernetes Load Balancer
Makes the application independent of the environment where it runs.
Yes - Kubernetes ConfigMap or Secret
Spring Cloud Kubernetes - ConfigMap
1.3.2. Introduction to example applications
Examples are working applications that demonstrate how to build cloud native applications and services. They demonstrate prescriptive architectures, design patterns, tools, and best practices that should be used when you develop your applications. The example applications can be used as templates to create your cloud-native microservices. You can update and redeploy these examples using the deployment process explained in this guide.
The examples implement Microservice patterns such as:
- Creating REST APIs
- Interoperating with a database
- Implementing the health check pattern
- Externalizing the configuration of your applications to make them more secure and easier to scale
You can use the examples applications as:
- Working demonstration of the technology
- Learning tool or a sandbox to understand how to develop applications for your project
- Starting point for updating or extending your own use case
Each example application is implemented in one or more runtimes. For example, the REST API Level 0 example is available for the following runtimes:
The subsequent sections explain the example applications implemented for the Spring Boot runtime.