SlideShare a Scribd company logo
1 of 25
Download to read offline
Boost Your API with
Running spqr and JNoSQL on Glassfish 5.1
What are we going to speak about?
A few words about @jefrajames
Speaker me = SpeakerOf.setLastName(“James”)
.setFirstName(“Jean-François”)
.setBackground(Period.ofYears(33))
.setCompany(“Worldline”)
.setLocation(“France”)
.addSkill(“Software Architecture”, Year.parse (“1990”))
.addSkill(“Java”, Year.parse (“1997”));
A few requests about @theJiBz
Let’s go to http://localhost:4000/ !
GraphQL – Not a silver bullet, again…
GraphQL – But a new way to design API !
Facebook introduced GraphQL at their Reactjs
conference in 2015.
GraphQL is a query language and runtime
that we can use to build and expose APIs as a
strongly-typed schema instead of hundreds of
REST endpoints.
Your clients see the schema. They write a query
for what they want. They send it over and get
back exactly the data they asked for and
nothing more.
Spec: https://facebook.github.io/graphql/draft/
GraphQL – A bit of history and context
GraphQL (now) – Mobile era
Schema as a contract
Get only what you asked for
High entry cost
Graph oriented APIs
RESTful API (00’) – Web era
Loosely coupled systems
Full usage of HTTP and browser features
Loose data contract
CRUD style APIs
SOAP (90’) – Server era
The big guns out:
WS-Security, WS-AtomicTransaction, WS-
ReliableMessaging …
Tight coupling between server and client
Heavy resources usage (big payload)
GraphQL – PROS / CONS
Pros
• Network performance
improved
• Lose coupling between
client and server
• Strong typing
• Developer tooling
Cons
• Young ecosystem
• N+1 to be solved
• No full usage of HTTP
• Partially complete
response to be handled
GraphQL in the Java Ecosystem
graphql-java
schema initialization (DSL, API), query execution, error management
Rel: 11.0, Oct 2018
graphql-java-tools
schema-first
Rel: 5.4.1, Nov 2018
spqr
code-first
Rel: 0.9.9, Dec 2018
graphql-java-servlet
HTTP transport
Rel: 7.2.0, Feb 2018
OR AND
Schema-first vs code-first
Schema
DSL
written
Java class
Java class
Java classSpecialized
Java class
GraphQLRootResolver
GraphQLResolver<>
GraphQLScalarType
Etc …
Annotated
Java class
Annotated
Java class
Annotated
Java class
Annotated
Java class
@GraphQLQuery
@GraphQLMutation
@GraphQLArgument
@GraphQLInputField
Etc …
From Java EE to Jakarta EE
The follow up of Java EE
The new brand name of the platform
Transferred from Oracle to Eclipse
Foundation in 2018
New governance model and
specification process in place
Started in 2016
In reaction to Java EE inertia
Focus on Microservices
Eclipse project
Dynamic and innovative
An incubator for Jakarta EE
Previously Java EE Ref. Impl.
Now an Eclipse Project
5.1 released in Jan 2019
Fisrt Jakarta EE version
Java EE 8 certified
More on Payara blog
Eclipse top-level project
About 40 subprojects
TCK
Specifications
Implementations
What makes Jakarta EE different?
MicroProfile breaking news
Runtime support
Runtime Provider Java SE 11 support Java EE Version MP Version
GlassFish 5.1 Eclipse n 8 1.0
Payara 5.184 Payara y 8 2.0
TomEE 8.0 M1 TomiTribe y WebProfile 8 1.3 (partial)
OpenLiberty 19.0.0.1 IBM y 8 2.1
WildFly 15.0.1 Red Hat y 8 1.4 (Partial)
Thorntail 2.3.0 Red Hat y y 2.1
KumuluzEE 3.1.0 Open Source y 8 1.2
Helidon Oracle ? none 1.2
SmallRye 2 Open Source ? none 2.1
• A Java framework that streamlines integration of NoSQL databases
• A set of APIs to interact with NoSQL databases in a standard way
• Support of Key-Value, Document, Column, Graph databases
• The starting point for the first Jakarta EE new specification
Introduction to JNoSQL
• Training exercise
• In the context of MicroProfile GraphQL initiative
• Also an opportunity:
– To test GlassFish 5.1
– To test JNoSQL
– To check portability on other application servers
About the demo project-Why?
• Starting from the graphql-java-tutorial from Bojan Tomic
• Switching from schema-first to code-first
• Maximum CDI use, minimum graphql-servlet use
• Plus JNoSQL in the picture
• Available on GitHub
About the demo project-How?
Coding a Query with spqr
Coding a Mutation with spqr
Coding a Resolver with spqr
• CDI beans everywhere: repositories, GraphQL classes, AuthContext
• Generic CDI extension to create the schema
• Plus a specific @GraphQLComponent CDI stereotype
• Schema dynamically generated at application startup
CDI integration
• DocumentCollectionManager CDI producer required
• Use of JNoSQL template enabling select, insert and singleResult operations
• JNoSQL Annotations on domain objects: @Entity, @Id, @Column,
• Real simplification for the developer
JNoSQL integration
• Started in Dec. 2018
• Creating a specification-based, easy to use, annotation-based API around CDI,
JSON-P and JSON-B for GraphQL
• The initial goal would be to create a code-first approach (similar to JAX-RS)
• Following the "code-first approach", We propose to leverage existing solutions.
The content proposed is heavily influenced by GraphQL SPQR.
MicroProfile GraphQL-What for?
MicroProfile GraphQL-Who are we?
Andy McCright (IBM)
Phillip Kruger (Red Hat)
Jean-Baptiste Roux (Worldline)
Bojan Tomic (ServiceNow, spqr)
Jean-François James (Worldline)
Adam Anderson (IBM)
You are welcome!
Thank you!

More Related Content

What's hot

Adding GraphQL to your existing architecture
Adding GraphQL to your existing architectureAdding GraphQL to your existing architecture
Adding GraphQL to your existing architectureSashko Stubailo
 
Serverless GraphQL for Product Developers
Serverless GraphQL for Product DevelopersServerless GraphQL for Product Developers
Serverless GraphQL for Product DevelopersSashko Stubailo
 
Introduction to graphQL
Introduction to graphQLIntroduction to graphQL
Introduction to graphQLMuhilvarnan V
 
Refactoring Design Patterns the Functional Way (in Scala)
Refactoring Design Patterns the Functional Way (in Scala)Refactoring Design Patterns the Functional Way (in Scala)
Refactoring Design Patterns the Functional Way (in Scala)Kfir Bloch
 
GraphQL-ify your APIs - Devoxx UK 2021
 GraphQL-ify your APIs - Devoxx UK 2021 GraphQL-ify your APIs - Devoxx UK 2021
GraphQL-ify your APIs - Devoxx UK 2021Soham Dasgupta
 
Taking Control of your Data with GraphQL
Taking Control of your Data with GraphQLTaking Control of your Data with GraphQL
Taking Control of your Data with GraphQLVinci Rufus
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL StackSashko Stubailo
 
Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)Rafael Wilber Kerr
 
Building the Web with Gradle
Building the Web with GradleBuilding the Web with Gradle
Building the Web with GradleEric Wendelin
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsSashko Stubailo
 
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern AppsMeteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern AppsSashko Stubailo
 
Yannis Zarkadas. Enterprise data science workflows on kubeflow
Yannis Zarkadas. Enterprise data science workflows on kubeflowYannis Zarkadas. Enterprise data science workflows on kubeflow
Yannis Zarkadas. Enterprise data science workflows on kubeflowMarynaHoldaieva
 
The Graph-Native Advantage
The Graph-Native AdvantageThe Graph-Native Advantage
The Graph-Native AdvantageNeo4j
 
apidays LIVE Australia - Productising your Microservices as API Products by P...
apidays LIVE Australia - Productising your Microservices as API Products by P...apidays LIVE Australia - Productising your Microservices as API Products by P...
apidays LIVE Australia - Productising your Microservices as API Products by P...apidays
 
GraphQL: The Missing Link Between Frontend and Backend Devs
GraphQL: The Missing Link Between Frontend and Backend DevsGraphQL: The Missing Link Between Frontend and Backend Devs
GraphQL: The Missing Link Between Frontend and Backend DevsSashko Stubailo
 

What's hot (20)

Javantura v4 - Android App Development in 2017 - Matej Vidaković
Javantura v4 - Android App Development in 2017 - Matej VidakovićJavantura v4 - Android App Development in 2017 - Matej Vidaković
Javantura v4 - Android App Development in 2017 - Matej Vidaković
 
Adding GraphQL to your existing architecture
Adding GraphQL to your existing architectureAdding GraphQL to your existing architecture
Adding GraphQL to your existing architecture
 
Serverless GraphQL for Product Developers
Serverless GraphQL for Product DevelopersServerless GraphQL for Product Developers
Serverless GraphQL for Product Developers
 
Introduction to graphQL
Introduction to graphQLIntroduction to graphQL
Introduction to graphQL
 
Refactoring Design Patterns the Functional Way (in Scala)
Refactoring Design Patterns the Functional Way (in Scala)Refactoring Design Patterns the Functional Way (in Scala)
Refactoring Design Patterns the Functional Way (in Scala)
 
GraphQL-ify your APIs - Devoxx UK 2021
 GraphQL-ify your APIs - Devoxx UK 2021 GraphQL-ify your APIs - Devoxx UK 2021
GraphQL-ify your APIs - Devoxx UK 2021
 
Taking Control of your Data with GraphQL
Taking Control of your Data with GraphQLTaking Control of your Data with GraphQL
Taking Control of your Data with GraphQL
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
 
GraphQL & Relay
GraphQL & RelayGraphQL & Relay
GraphQL & Relay
 
Intro to GraphQL
 Intro to GraphQL Intro to GraphQL
Intro to GraphQL
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
 
GraphQL + relay
GraphQL + relayGraphQL + relay
GraphQL + relay
 
Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)
 
Building the Web with Gradle
Building the Web with GradleBuilding the Web with Gradle
Building the Web with Gradle
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer tools
 
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern AppsMeteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
 
Yannis Zarkadas. Enterprise data science workflows on kubeflow
Yannis Zarkadas. Enterprise data science workflows on kubeflowYannis Zarkadas. Enterprise data science workflows on kubeflow
Yannis Zarkadas. Enterprise data science workflows on kubeflow
 
The Graph-Native Advantage
The Graph-Native AdvantageThe Graph-Native Advantage
The Graph-Native Advantage
 
apidays LIVE Australia - Productising your Microservices as API Products by P...
apidays LIVE Australia - Productising your Microservices as API Products by P...apidays LIVE Australia - Productising your Microservices as API Products by P...
apidays LIVE Australia - Productising your Microservices as API Products by P...
 
GraphQL: The Missing Link Between Frontend and Backend Devs
GraphQL: The Missing Link Between Frontend and Backend DevsGraphQL: The Missing Link Between Frontend and Backend Devs
GraphQL: The Missing Link Between Frontend and Backend Devs
 

Similar to Boost your API with GraphQL

Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPAndrew Rota
 
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)Pavel Chertorogov
 
Create GraphQL server with apolloJS
Create GraphQL server with apolloJSCreate GraphQL server with apolloJS
Create GraphQL server with apolloJSJonathan Jalouzot
 
The GraphQL Ecosystem in 2018
The GraphQL Ecosystem in 2018The GraphQL Ecosystem in 2018
The GraphQL Ecosystem in 2018Nikolas Burk
 
GraphQL- Presentation
GraphQL- PresentationGraphQL- Presentation
GraphQL- PresentationRidwan Fadjar
 
How easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceHow easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceLuca Mattia Ferrari
 
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...apidays
 
Training Week: GraphQL 2022
Training Week: GraphQL 2022Training Week: GraphQL 2022
Training Week: GraphQL 2022Neo4j
 
GraphQL APIs is with eZ Platform, a Symfony CMS
GraphQL APIs is with eZ Platform, a Symfony CMSGraphQL APIs is with eZ Platform, a Symfony CMS
GraphQL APIs is with eZ Platform, a Symfony CMSJani Tarvainen
 
Training Series: Build APIs with Neo4j GraphQL Library
Training Series: Build APIs with Neo4j GraphQL LibraryTraining Series: Build APIs with Neo4j GraphQL Library
Training Series: Build APIs with Neo4j GraphQL LibraryNeo4j
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentationVibhor Grover
 
Camunda GraphQL Extension (09/2017 Berlin)
Camunda GraphQL Extension (09/2017 Berlin)Camunda GraphQL Extension (09/2017 Berlin)
Camunda GraphQL Extension (09/2017 Berlin)Harald J. Loydl
 
Getting Started with Spring for GraphQL
Getting Started with Spring for GraphQLGetting Started with Spring for GraphQL
Getting Started with Spring for GraphQLVMware Tanzu
 
GraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database accessGraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database accessConnected Data World
 
GraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxGraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxSoham Dasgupta
 

Similar to Boost your API with GraphQL (20)

Spring GraphQL
Spring GraphQLSpring GraphQL
Spring GraphQL
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHP
 
Graphql usage
Graphql usageGraphql usage
Graphql usage
 
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
 
Create GraphQL server with apolloJS
Create GraphQL server with apolloJSCreate GraphQL server with apolloJS
Create GraphQL server with apolloJS
 
The GraphQL Ecosystem in 2018
The GraphQL Ecosystem in 2018The GraphQL Ecosystem in 2018
The GraphQL Ecosystem in 2018
 
GraphQL- Presentation
GraphQL- PresentationGraphQL- Presentation
GraphQL- Presentation
 
How easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceHow easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performance
 
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
 
GraphQL-ify your APIs
GraphQL-ify your APIsGraphQL-ify your APIs
GraphQL-ify your APIs
 
Training Week: GraphQL 2022
Training Week: GraphQL 2022Training Week: GraphQL 2022
Training Week: GraphQL 2022
 
GraphQL APIs is with eZ Platform, a Symfony CMS
GraphQL APIs is with eZ Platform, a Symfony CMSGraphQL APIs is with eZ Platform, a Symfony CMS
GraphQL APIs is with eZ Platform, a Symfony CMS
 
Training Series: Build APIs with Neo4j GraphQL Library
Training Series: Build APIs with Neo4j GraphQL LibraryTraining Series: Build APIs with Neo4j GraphQL Library
Training Series: Build APIs with Neo4j GraphQL Library
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentation
 
Camunda GraphQL Extension (09/2017 Berlin)
Camunda GraphQL Extension (09/2017 Berlin)Camunda GraphQL Extension (09/2017 Berlin)
Camunda GraphQL Extension (09/2017 Berlin)
 
Getting Started with Spring for GraphQL
Getting Started with Spring for GraphQLGetting Started with Spring for GraphQL
Getting Started with Spring for GraphQL
 
GraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database accessGraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database access
 
GraphQL Europe Recap
GraphQL Europe RecapGraphQL Europe Recap
GraphQL Europe Recap
 
Vaibhav_Jain
Vaibhav_JainVaibhav_Jain
Vaibhav_Jain
 
GraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxGraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptx
 

More from Jean-Francois James

More from Jean-Francois James (6)

When GenAI meets with Java with Quarkus and langchain4j
When GenAI meets with Java with Quarkus and langchain4jWhen GenAI meets with Java with Quarkus and langchain4j
When GenAI meets with Java with Quarkus and langchain4j
 
Loom promises: be there!
Loom promises: be there!Loom promises: be there!
Loom promises: be there!
 
LyonJUG-2023-v1.0.pdf
LyonJUG-2023-v1.0.pdfLyonJUG-2023-v1.0.pdf
LyonJUG-2023-v1.0.pdf
 
ParisJUG-2022-v0.4.pdf
ParisJUG-2022-v0.4.pdfParisJUG-2022-v0.4.pdf
ParisJUG-2022-v0.4.pdf
 
Tnt 2020-jf-james
Tnt 2020-jf-jamesTnt 2020-jf-james
Tnt 2020-jf-james
 
Talk Oracle Code One 2019
Talk Oracle Code One 2019Talk Oracle Code One 2019
Talk Oracle Code One 2019
 

Recently uploaded

Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 

Recently uploaded (20)

Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

Boost your API with GraphQL

  • 1. Boost Your API with Running spqr and JNoSQL on Glassfish 5.1
  • 2. What are we going to speak about?
  • 3. A few words about @jefrajames Speaker me = SpeakerOf.setLastName(“James”) .setFirstName(“Jean-François”) .setBackground(Period.ofYears(33)) .setCompany(“Worldline”) .setLocation(“France”) .addSkill(“Software Architecture”, Year.parse (“1990”)) .addSkill(“Java”, Year.parse (“1997”));
  • 4. A few requests about @theJiBz Let’s go to http://localhost:4000/ !
  • 5. GraphQL – Not a silver bullet, again…
  • 6. GraphQL – But a new way to design API ! Facebook introduced GraphQL at their Reactjs conference in 2015. GraphQL is a query language and runtime that we can use to build and expose APIs as a strongly-typed schema instead of hundreds of REST endpoints. Your clients see the schema. They write a query for what they want. They send it over and get back exactly the data they asked for and nothing more. Spec: https://facebook.github.io/graphql/draft/
  • 7. GraphQL – A bit of history and context GraphQL (now) – Mobile era Schema as a contract Get only what you asked for High entry cost Graph oriented APIs RESTful API (00’) – Web era Loosely coupled systems Full usage of HTTP and browser features Loose data contract CRUD style APIs SOAP (90’) – Server era The big guns out: WS-Security, WS-AtomicTransaction, WS- ReliableMessaging … Tight coupling between server and client Heavy resources usage (big payload)
  • 8. GraphQL – PROS / CONS Pros • Network performance improved • Lose coupling between client and server • Strong typing • Developer tooling Cons • Young ecosystem • N+1 to be solved • No full usage of HTTP • Partially complete response to be handled
  • 9. GraphQL in the Java Ecosystem graphql-java schema initialization (DSL, API), query execution, error management Rel: 11.0, Oct 2018 graphql-java-tools schema-first Rel: 5.4.1, Nov 2018 spqr code-first Rel: 0.9.9, Dec 2018 graphql-java-servlet HTTP transport Rel: 7.2.0, Feb 2018 OR AND
  • 10. Schema-first vs code-first Schema DSL written Java class Java class Java classSpecialized Java class GraphQLRootResolver GraphQLResolver<> GraphQLScalarType Etc … Annotated Java class Annotated Java class Annotated Java class Annotated Java class @GraphQLQuery @GraphQLMutation @GraphQLArgument @GraphQLInputField Etc …
  • 11. From Java EE to Jakarta EE The follow up of Java EE The new brand name of the platform Transferred from Oracle to Eclipse Foundation in 2018 New governance model and specification process in place Started in 2016 In reaction to Java EE inertia Focus on Microservices Eclipse project Dynamic and innovative An incubator for Jakarta EE Previously Java EE Ref. Impl. Now an Eclipse Project 5.1 released in Jan 2019 Fisrt Jakarta EE version Java EE 8 certified More on Payara blog Eclipse top-level project About 40 subprojects TCK Specifications Implementations
  • 12. What makes Jakarta EE different?
  • 14. Runtime support Runtime Provider Java SE 11 support Java EE Version MP Version GlassFish 5.1 Eclipse n 8 1.0 Payara 5.184 Payara y 8 2.0 TomEE 8.0 M1 TomiTribe y WebProfile 8 1.3 (partial) OpenLiberty 19.0.0.1 IBM y 8 2.1 WildFly 15.0.1 Red Hat y 8 1.4 (Partial) Thorntail 2.3.0 Red Hat y y 2.1 KumuluzEE 3.1.0 Open Source y 8 1.2 Helidon Oracle ? none 1.2 SmallRye 2 Open Source ? none 2.1
  • 15. • A Java framework that streamlines integration of NoSQL databases • A set of APIs to interact with NoSQL databases in a standard way • Support of Key-Value, Document, Column, Graph databases • The starting point for the first Jakarta EE new specification Introduction to JNoSQL
  • 16. • Training exercise • In the context of MicroProfile GraphQL initiative • Also an opportunity: – To test GlassFish 5.1 – To test JNoSQL – To check portability on other application servers About the demo project-Why?
  • 17. • Starting from the graphql-java-tutorial from Bojan Tomic • Switching from schema-first to code-first • Maximum CDI use, minimum graphql-servlet use • Plus JNoSQL in the picture • Available on GitHub About the demo project-How?
  • 18. Coding a Query with spqr
  • 19. Coding a Mutation with spqr
  • 20. Coding a Resolver with spqr
  • 21. • CDI beans everywhere: repositories, GraphQL classes, AuthContext • Generic CDI extension to create the schema • Plus a specific @GraphQLComponent CDI stereotype • Schema dynamically generated at application startup CDI integration
  • 22. • DocumentCollectionManager CDI producer required • Use of JNoSQL template enabling select, insert and singleResult operations • JNoSQL Annotations on domain objects: @Entity, @Id, @Column, • Real simplification for the developer JNoSQL integration
  • 23. • Started in Dec. 2018 • Creating a specification-based, easy to use, annotation-based API around CDI, JSON-P and JSON-B for GraphQL • The initial goal would be to create a code-first approach (similar to JAX-RS) • Following the "code-first approach", We propose to leverage existing solutions. The content proposed is heavily influenced by GraphQL SPQR. MicroProfile GraphQL-What for?
  • 24. MicroProfile GraphQL-Who are we? Andy McCright (IBM) Phillip Kruger (Red Hat) Jean-Baptiste Roux (Worldline) Bojan Tomic (ServiceNow, spqr) Jean-François James (Worldline) Adam Anderson (IBM) You are welcome!