SlideShare a Scribd company logo
Kotlin Backend
Rest & GraphQL
About Me
● Blog
○ https://animus.design
● GitLab
○ https://gitlab.com/AnimusDesign
● Job: Tech Lead @ Equinox
● Personal Projects
○ Music Recommendation System
○ Kotlin Examples
○ New Web Framework in Kotlin
○ Content Creation Service
Over ten years of experience. With a focus on
functional reactive full stack development. Utilizing
Kotlin to ease delivering of the domain to the client.
Early adopter of multi-platform to share code across
multiple targets.
What is GraphQL
● GraphQL is a newish API format developed by FaceBook for React. First released in 2015
○ Primarily used by Javascript Frameworks
● It is strongly typed, with a schema. Allowing for autocompletion, and is self documenting.
● You specify what data you wish to receive. In that vein you can chain multiple queries, without hitting
multiple endpoints.
○ Think of it as akin to sql, with functions instead of a language, but you still specify the returns.
● Advanced
○ Can whitelist queries run in production, limiting ad hoc queries.
○ Can build fragments that act as building blocks inside queries.
● Hacker News Discussion on Switching to GraphQL
Simple Query
Complex Query
GraphQL Additions
● GraphQL is a specification, additional libraries/frameworks expand its capabilities.
○ Much like an api gateway for REST, joining microservices.
● This is required because the structure of the data is put on the client instead of the server.
● Relay & Relay Modern from FaceBook, allow data binding to components, caching, etc.
● Apollo acts as a GraphQL API GateWay, with monitoring, alerting, and other features.
○ Client supports caching, binding, and managing local state of the application.
● Important
○ Support outside of JavaScript is weak. As an example JVM doesn’t support caching in Apollo, but
supports performance tracing.
● I will be focusing on Apollo
GraphQL Schema Stitching
● Schema stitching combines several GraphQL end points into one.
● Equivalent to an api gateway.
● When making a query, it will route the request to the proper service.
Why is the Framework Important?
● Isomorphic rendering, or server side rendering with GraphQL
● Caching, to limit hitting the primary data source repeatedly.
● How the javascript/Client interacts with the data layer.
● Whether the build process verifies the requested fields are in the schema.
● Performance monitoring, and trace monitoring.
● Schema stitching, or combining multiple graphql services together.
In short your framework choice will largely dictate your backend
language.
Why use GraphQL
● You’re using a javascript web/mobile framework.
● With Apollo client for web and mobile.
● Limits the data requested.
● Can whitelist queries, verifying what is queried in production.
● Less data requested, means less transfer.
○ Customize the data you retrieve from the data source.
● Reduce number of api calls.
● Strongly typed response.
● No need to maintain / generate swagger documentation.
Why Apollo?
● Polyglot support Swift (iOS), Kotlin (Android), JavaScript (vue, react, angular)
clients.
● Wide range of backend server support
○ With varying levels of support..
■ Tracing is supported in Java and other languages, see here for latest
supported languages.
○ Caching javascript only at this time.
● Integration with pager-duty and data dog, easing monitoring.
● Shiny dashboard with pretty lines.
● Better community integration, things like React router for isomorphic
rendering.
● Professional support
Backend MakeUp
● API
○ Jooby
■ HTTP Routing Library
○ Java-GraphQL
■ FrameWork for GraphQL
○ Graphql-spqr
■ Java 8+ Bindings easing definition, but not targeted towards
kotlin.
○ Jooq
■ Database layer that acts as a thin layer for operations.
○ Hikari CP
■ Connection pooling for the database.
● Apollo
○ GraphQL GateWay Server
○ Performance Monitoring
● Graphite + Grafana Monitoring
Project Structure
● Base Structure we will be working with.
● api
○ Is the backend GraphQL and Rest layer.
● database
○ The database interaction library.
● Web
○ A react frontend
● Anything gradle is build related.
DataBase
● Auto generated java classes via jooq.
● No hand writing or mapping to database.
● Generated via a gradle build file.
● Utilizes environment variables to integrate
with your pipeline.
● Looks strikingly like SQL.
Data Model
● Name Basic - Provides information on actors, writers, crews, etc.
● Title Basic - Common information on a title can be a movie or tv episode.
● Title AKA - Title also known as a table of other title names, not used.
● Title Episode - Maps a parent title (TV Show), to seasons, episode numbers, and episode
ids.
● Title Crew - Takes a title id and provides a list of directors and writers.
Pulled from IMBD sample data set. Small sample set of movies, tv shows, writers, directors, and
actors.
https://www.imdb.com/interfaces/
Jooby: HTTP API GraphQl & Rest
● GraphQL requires a single POST or GET endpoint
● Supports multi versioned REST endpoints
● Swagger and RAML generation for Rest
● Metrics, supporting graphite, data dog and more.
● Docker support
● A number of other modules
● Running on Netty an asynchronous event server
○ Can run on other servers.
● Support for hot reloading, i.e. automatic recompilation.
There are a Plethora of HTTP Services
Choose what works for you!
● Vertx
● DropWizard
● Javalin
● Spark
● Ktor
● I’m sure I’m forgetting something.
Jooby Making End Points
● Closures, lambda functions included in a type safe DSL builder.
● Supports MVC class based method (My preference)
Jooby Closure REST EndPoint
● A type safe builder for your end points in the run section for Jooby.
● Supports arguments and parameters.
● Each http verb is a seperate function
Class MVC Rest EndPoint
- Each Class is a
path
- Annotated with
the HTTP verb
- Can annotate
with sub path
- Automatic
conversion to
json
Single GraphQL EndPoint
- Data classes for response and post
body.
- Read the post body.
- Submit to the schema executor
- Return response.
GraphQL Java
● Strong Community, very active development.
● Support for Apollo (minus caching) and Relay, plus more.
● A number of additions to ease development.
○ https://github.com/graphql-java/awesome-graphql-java
● Can design schema first or classes first.
● Automatic integration with spring.
Limitations of GraphQL Java
● Kotlin is not a first class citizen.
● Builders, that feel a bit heavy in comparison to Kotlin Syntax.
● Documentation is a bit scarce.
● Wiring type definitions, to query resolvers is verbose.
● Doesn’t feel like idiomatic Kotlin
○ There is one Wrapper in Kotlin, but it is not overly active
● Enter GraphQL SPQR.
○ An annotation library that makes adding types and queries very simple.
○ The downside is it doesn’t support Kotlin Data Classes
■ Need to fall back to java in some instances.
■ May encounter esoteric bugs with annotations in Kotlin.
GraphQL Object Definition
● Basic Java POJO
● Annotations for the Getters
Or This Works
● Class constructor with
annotations.
● Common class so can be used
across platforms.
● This is the JVM implementation.
GraphQL Service
Generating the Schema
● Instantiate the Pet Service a singleton
● Instantiate the schema, passing any singletons you develop.
Demo Time
● Data store is using sample data from
IMDB
● REST + GraphQL Endpoints
○ Hot Reloading
● Apollo Engine Integration
○ GraphQL Query Tracing
● Grafana showing Jooby metrics
● Docker build
● Maybe a kotlin + react fetching from
the API.
Closing Thoughts
VertX
If you’re looking for a highly concurrent distributed backend layer. Look at VertX.
● Works with an event loop, and worker pools.
○ Passing information through a message bus.
■ Which can be centralized
■ And accessed from a number of languages.
● Can start with just http endpoints and add more later.
● Built in clustering and service discovery.
● First class Kotlin support.
● Polyglot (Java, Kotlin, Groovy, Scala, Javascript, Ruby)
● HTTP end points, as well as custom TCP/UDP services.
● Akin to an actor model.
● Great GraphQL support.
Changing your data store
● Neo4j (graph database has built in graphql
support).
● In built use of GraphQL Java and Apollo
● But you have to change your data store…
● Called the Grand Stack
Could we create new annotations?
Questions ?

More Related Content

What's hot (20)

PDF
Introduction to DevOps and the Practical Use Cases at Credit OK
Kriangkrai Chaonithi
 
PDF
GraphQL & Relay
Viacheslav Slinko
 
PDF
GraphQL + relay
Cédric GILLET
 
PDF
Apache Beam @ GCPUG.TW Flink.TW 20161006
Randy Huang
 
PPTX
Introduction to GraphQL
Rodrigo Prates
 
PPTX
GraphQL Introduction
Serge Huber
 
PDF
The Apollo and GraphQL Stack
Sashko Stubailo
 
PDF
GraphQL ♥︎ GraphDB
GraphRM
 
PDF
Adding GraphQL to your existing architecture
Sashko Stubailo
 
PPTX
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
Ayla Khan
 
PDF
REST vs GraphQL
Squareboat
 
PDF
Improving Mobile Payments With Real time Spark
datamantra
 
PPTX
Introduction to Ruby Native Extensions and Foreign Function Interface
Oleksii Sukhovii
 
PDF
GraphQL (Graphene-Django)
Selo Lee
 
PDF
GraphQL in an Age of REST
Yos Riady
 
PPTX
Python Streaming Pipelines with Beam on Flink
Aljoscha Krettek
 
PDF
GraphQL across the stack: How everything fits together
Sashko Stubailo
 
PDF
Balkan - data eng meetup - data fusion
Balkan Misirli
 
PDF
Introduction to Modern DevOps Technologies
Kriangkrai Chaonithi
 
PDF
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
Jon Wong
 
Introduction to DevOps and the Practical Use Cases at Credit OK
Kriangkrai Chaonithi
 
GraphQL & Relay
Viacheslav Slinko
 
GraphQL + relay
Cédric GILLET
 
Apache Beam @ GCPUG.TW Flink.TW 20161006
Randy Huang
 
Introduction to GraphQL
Rodrigo Prates
 
GraphQL Introduction
Serge Huber
 
The Apollo and GraphQL Stack
Sashko Stubailo
 
GraphQL ♥︎ GraphDB
GraphRM
 
Adding GraphQL to your existing architecture
Sashko Stubailo
 
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
Ayla Khan
 
REST vs GraphQL
Squareboat
 
Improving Mobile Payments With Real time Spark
datamantra
 
Introduction to Ruby Native Extensions and Foreign Function Interface
Oleksii Sukhovii
 
GraphQL (Graphene-Django)
Selo Lee
 
GraphQL in an Age of REST
Yos Riady
 
Python Streaming Pipelines with Beam on Flink
Aljoscha Krettek
 
GraphQL across the stack: How everything fits together
Sashko Stubailo
 
Balkan - data eng meetup - data fusion
Balkan Misirli
 
Introduction to Modern DevOps Technologies
Kriangkrai Chaonithi
 
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
Jon Wong
 

Similar to Kotlin REST & GraphQL API (20)

PPTX
GraphQL-ify your APIs - Devoxx UK 2021
Soham Dasgupta
 
PDF
GraphQL Bangkok meetup 5.0
Tobias Meixner
 
PPTX
GraphQL-ify your APIs
Soham Dasgupta
 
PDF
GraphQL-ify your APIs
Soham Dasgupta
 
PDF
GraphQL for Native Apps
Emanuele Di Saverio
 
PPTX
GraphQL_devoxx_2023.pptx
Soham Dasgupta
 
PDF
GraphQL-ify your API - JFall 2022
Soham Dasgupta
 
PDF
Marco Liberati - Graph analytics
Codemotion
 
PPTX
GraphQL API Crafts presentation
Sudheer J
 
PDF
GraphQL- Presentation
Ridwan Fadjar
 
PDF
GraphQL
Cédric GILLET
 
PPTX
The API Journey: from REST to GraphQL
Haci Murat Yaman
 
PPTX
GraphQL - The new "Lingua Franca" for API-Development
jexp
 
PDF
Andrea Baldon, Emanuele Di Saverio - GraphQL for Native Apps: the MyAXA case ...
Codemotion
 
PDF
Building Fullstack Serverless GraphQL APIs In The Cloud
Nordic APIs
 
PDF
GraphQL: Enabling a new generation of API developer tools
Sashko Stubailo
 
PPTX
GraphQL Introduction with Spring Boot
vipin kumar
 
PDF
Introduction to GraphQL for beginners
Martin Pham
 
PDF
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
GreeceJS
 
PPTX
Apollo 4 Kotlin made me Graphql and I learned how to use it
João Esperancinha
 
GraphQL-ify your APIs - Devoxx UK 2021
Soham Dasgupta
 
GraphQL Bangkok meetup 5.0
Tobias Meixner
 
GraphQL-ify your APIs
Soham Dasgupta
 
GraphQL-ify your APIs
Soham Dasgupta
 
GraphQL for Native Apps
Emanuele Di Saverio
 
GraphQL_devoxx_2023.pptx
Soham Dasgupta
 
GraphQL-ify your API - JFall 2022
Soham Dasgupta
 
Marco Liberati - Graph analytics
Codemotion
 
GraphQL API Crafts presentation
Sudheer J
 
GraphQL- Presentation
Ridwan Fadjar
 
The API Journey: from REST to GraphQL
Haci Murat Yaman
 
GraphQL - The new "Lingua Franca" for API-Development
jexp
 
Andrea Baldon, Emanuele Di Saverio - GraphQL for Native Apps: the MyAXA case ...
Codemotion
 
Building Fullstack Serverless GraphQL APIs In The Cloud
Nordic APIs
 
GraphQL: Enabling a new generation of API developer tools
Sashko Stubailo
 
GraphQL Introduction with Spring Boot
vipin kumar
 
Introduction to GraphQL for beginners
Martin Pham
 
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
GreeceJS
 
Apollo 4 Kotlin made me Graphql and I learned how to use it
João Esperancinha
 
Ad

Recently uploaded (20)

PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PPTX
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Ad

Kotlin REST & GraphQL API

  • 2. About Me ● Blog ○ https://animus.design ● GitLab ○ https://gitlab.com/AnimusDesign ● Job: Tech Lead @ Equinox ● Personal Projects ○ Music Recommendation System ○ Kotlin Examples ○ New Web Framework in Kotlin ○ Content Creation Service Over ten years of experience. With a focus on functional reactive full stack development. Utilizing Kotlin to ease delivering of the domain to the client. Early adopter of multi-platform to share code across multiple targets.
  • 3. What is GraphQL ● GraphQL is a newish API format developed by FaceBook for React. First released in 2015 ○ Primarily used by Javascript Frameworks ● It is strongly typed, with a schema. Allowing for autocompletion, and is self documenting. ● You specify what data you wish to receive. In that vein you can chain multiple queries, without hitting multiple endpoints. ○ Think of it as akin to sql, with functions instead of a language, but you still specify the returns. ● Advanced ○ Can whitelist queries run in production, limiting ad hoc queries. ○ Can build fragments that act as building blocks inside queries. ● Hacker News Discussion on Switching to GraphQL
  • 6. GraphQL Additions ● GraphQL is a specification, additional libraries/frameworks expand its capabilities. ○ Much like an api gateway for REST, joining microservices. ● This is required because the structure of the data is put on the client instead of the server. ● Relay & Relay Modern from FaceBook, allow data binding to components, caching, etc. ● Apollo acts as a GraphQL API GateWay, with monitoring, alerting, and other features. ○ Client supports caching, binding, and managing local state of the application. ● Important ○ Support outside of JavaScript is weak. As an example JVM doesn’t support caching in Apollo, but supports performance tracing. ● I will be focusing on Apollo
  • 7. GraphQL Schema Stitching ● Schema stitching combines several GraphQL end points into one. ● Equivalent to an api gateway. ● When making a query, it will route the request to the proper service.
  • 8. Why is the Framework Important? ● Isomorphic rendering, or server side rendering with GraphQL ● Caching, to limit hitting the primary data source repeatedly. ● How the javascript/Client interacts with the data layer. ● Whether the build process verifies the requested fields are in the schema. ● Performance monitoring, and trace monitoring. ● Schema stitching, or combining multiple graphql services together. In short your framework choice will largely dictate your backend language.
  • 9. Why use GraphQL ● You’re using a javascript web/mobile framework. ● With Apollo client for web and mobile. ● Limits the data requested. ● Can whitelist queries, verifying what is queried in production. ● Less data requested, means less transfer. ○ Customize the data you retrieve from the data source. ● Reduce number of api calls. ● Strongly typed response. ● No need to maintain / generate swagger documentation.
  • 10. Why Apollo? ● Polyglot support Swift (iOS), Kotlin (Android), JavaScript (vue, react, angular) clients. ● Wide range of backend server support ○ With varying levels of support.. ■ Tracing is supported in Java and other languages, see here for latest supported languages. ○ Caching javascript only at this time. ● Integration with pager-duty and data dog, easing monitoring. ● Shiny dashboard with pretty lines. ● Better community integration, things like React router for isomorphic rendering. ● Professional support
  • 11. Backend MakeUp ● API ○ Jooby ■ HTTP Routing Library ○ Java-GraphQL ■ FrameWork for GraphQL ○ Graphql-spqr ■ Java 8+ Bindings easing definition, but not targeted towards kotlin. ○ Jooq ■ Database layer that acts as a thin layer for operations. ○ Hikari CP ■ Connection pooling for the database. ● Apollo ○ GraphQL GateWay Server ○ Performance Monitoring ● Graphite + Grafana Monitoring
  • 12. Project Structure ● Base Structure we will be working with. ● api ○ Is the backend GraphQL and Rest layer. ● database ○ The database interaction library. ● Web ○ A react frontend ● Anything gradle is build related.
  • 13. DataBase ● Auto generated java classes via jooq. ● No hand writing or mapping to database. ● Generated via a gradle build file. ● Utilizes environment variables to integrate with your pipeline. ● Looks strikingly like SQL.
  • 14. Data Model ● Name Basic - Provides information on actors, writers, crews, etc. ● Title Basic - Common information on a title can be a movie or tv episode. ● Title AKA - Title also known as a table of other title names, not used. ● Title Episode - Maps a parent title (TV Show), to seasons, episode numbers, and episode ids. ● Title Crew - Takes a title id and provides a list of directors and writers. Pulled from IMBD sample data set. Small sample set of movies, tv shows, writers, directors, and actors. https://www.imdb.com/interfaces/
  • 15. Jooby: HTTP API GraphQl & Rest ● GraphQL requires a single POST or GET endpoint ● Supports multi versioned REST endpoints ● Swagger and RAML generation for Rest ● Metrics, supporting graphite, data dog and more. ● Docker support ● A number of other modules ● Running on Netty an asynchronous event server ○ Can run on other servers. ● Support for hot reloading, i.e. automatic recompilation.
  • 16. There are a Plethora of HTTP Services Choose what works for you! ● Vertx ● DropWizard ● Javalin ● Spark ● Ktor ● I’m sure I’m forgetting something.
  • 17. Jooby Making End Points ● Closures, lambda functions included in a type safe DSL builder. ● Supports MVC class based method (My preference)
  • 18. Jooby Closure REST EndPoint ● A type safe builder for your end points in the run section for Jooby. ● Supports arguments and parameters. ● Each http verb is a seperate function
  • 19. Class MVC Rest EndPoint - Each Class is a path - Annotated with the HTTP verb - Can annotate with sub path - Automatic conversion to json
  • 20. Single GraphQL EndPoint - Data classes for response and post body. - Read the post body. - Submit to the schema executor - Return response.
  • 21. GraphQL Java ● Strong Community, very active development. ● Support for Apollo (minus caching) and Relay, plus more. ● A number of additions to ease development. ○ https://github.com/graphql-java/awesome-graphql-java ● Can design schema first or classes first. ● Automatic integration with spring.
  • 22. Limitations of GraphQL Java ● Kotlin is not a first class citizen. ● Builders, that feel a bit heavy in comparison to Kotlin Syntax. ● Documentation is a bit scarce. ● Wiring type definitions, to query resolvers is verbose. ● Doesn’t feel like idiomatic Kotlin ○ There is one Wrapper in Kotlin, but it is not overly active ● Enter GraphQL SPQR. ○ An annotation library that makes adding types and queries very simple. ○ The downside is it doesn’t support Kotlin Data Classes ■ Need to fall back to java in some instances. ■ May encounter esoteric bugs with annotations in Kotlin.
  • 23. GraphQL Object Definition ● Basic Java POJO ● Annotations for the Getters
  • 24. Or This Works ● Class constructor with annotations. ● Common class so can be used across platforms. ● This is the JVM implementation.
  • 26. Generating the Schema ● Instantiate the Pet Service a singleton ● Instantiate the schema, passing any singletons you develop.
  • 27. Demo Time ● Data store is using sample data from IMDB ● REST + GraphQL Endpoints ○ Hot Reloading ● Apollo Engine Integration ○ GraphQL Query Tracing ● Grafana showing Jooby metrics ● Docker build ● Maybe a kotlin + react fetching from the API.
  • 29. VertX If you’re looking for a highly concurrent distributed backend layer. Look at VertX. ● Works with an event loop, and worker pools. ○ Passing information through a message bus. ■ Which can be centralized ■ And accessed from a number of languages. ● Can start with just http endpoints and add more later. ● Built in clustering and service discovery. ● First class Kotlin support. ● Polyglot (Java, Kotlin, Groovy, Scala, Javascript, Ruby) ● HTTP end points, as well as custom TCP/UDP services. ● Akin to an actor model. ● Great GraphQL support.
  • 30. Changing your data store ● Neo4j (graph database has built in graphql support). ● In built use of GraphQL Java and Apollo ● But you have to change your data store… ● Called the Grand Stack
  • 31. Could we create new annotations?

Editor's Notes

  • #14: Show Jooq Build gradle in idea
  • #16: Walk through