10 Spring Boot with Kotlin, Native Image, and GraphQL

 

This chapter covers

  • Using Spring Boot with Kotlin and Kotlin DSLs
  • Using Spring Boot Native Image with GraalVM
  • Using Spring Boot with GraphQL

In the previous chapter, you explored how to deploy Spring Boot applications on various platforms. In this final chapter of this book, we’ll discuss Spring Boot with Kotlin, GraalVM Native Image, and GraphQL.

Spring Framework 5.0 provided extensive support for Kotlin programming language, and the nature of the support is such that you can develop Spring Boot applications with Kotlin without even writing a single line of Java code. Besides, Spring Boot provides several domain-specific languages (DSLs) to further simplify the code syntax.

GraalVM Native Image and GraphQL are two major technologies for which Spring Boot extends its support. Currently, these technologies have experimental support in Spring Boot, and features are under development. GraalVM Native Image turns the Spring Boot applications into an architecture-specific native executable, which has a faster start-up time and has a smaller memory footprint. GraphQL offers an alternative approach to REST APIs to develop efficient APIs. Let’s see these in practice with Spring Boot.

10.1 Spring Boot with Kotlin

10.1.1 Technique: Developing a Spring Boot application with Kotlin

10.1.2 Technique: Securing a Spring Boot Kotlin application with Spring Security

10.2 Introducing Spring Native

10.2.1 Introduction to GraalVM

10.2.2 GraalVM native image

10.2.3 Spring Boot native image

10.2.4 Technique: Generating Spring Boot native image using buildpacks

10.2.5 Technique: Generating Spring Boot native image using a Maven plugin

10.2.6 Understanding Spring AOT Maven Plugin

10.3 Spring Boot with GraphQL

10.3.1 Issues with REST

10.3.2 Introduction to GraphQL

10.3.3 Using GraphQL with Spring Boot