SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
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 - Overview
GraphQL – A silver bullet ? ☺
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
SOAP –
Server to Server
Data contract
Strict (wsdl)
Static (backend)
Payload
Heavy (XML, bindings,
ports, services …)
REST API –
Web to Server
Data contract
Permissive (http)
Static (backend)
Payload
Average (CRUD style APIs)
GraphQL –
Mobile to Server
Data contract
Strict (schema)
Evolutive (gateway)
Payload
Small (Get Just What
You Asked for)
GraphQL – PROS / CONS
Pros
• Network efficiency
• Lose coupling between
client and server
• Strong typing
• Live contract
Cons
• Young ecosystem
• Gateway-side
complexity
• No full usage of HTTP
• Client-side handling of
partial responses
• Mobile/Multifront usage as the golden use case
• Graph-oriented datasources
• Unifying multiple datasources
=> « Soap is undead, REST is alive and GraphQL just born »
GraphQL – To sum it up
GraphQL in the Java Ecosystem
graphql-java
schema initialization (DSL, API), query execution
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 …
schema-first code-first
From Java EE to Jakarta EE
The follow up of Java EE
The new brand name
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
First Jakarta EE version
Java EE 8 certified
More on Payara blog
Eclipse top-level project
About 40 subprojects
TCK, Spec, Implementations
From Oracle to Eclipse
13.5 million lines of code
95k files
About 400 IP reviews
What makes Jakarta EE different?
• The first new Jakarta EE specification
• To streamline integration of NoSQL databases
• Supporting all database models: Key-Value, Document, Column, Graph, Hybrid
• In a consistent way
• Leveraging an existing solution:
Moving forward Jakarta EE NoSQL
MicroProfile breaking news
Runtime support
• Training exercise, in the context of MicroProfile GraphQL initiative
• Available on GitHub, detailed in a blog post
• Also an opportunity:
– To test GlassFish 5.1
– To check portability on other application servers
– To test JNoSQL
About the demo project-Why?
Graph
QL
• 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
About the demo project-How?
Coding a Query with spqr
Coding a Mutation with spqr
Coding a Resolver with spqr
More annotations 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!
• GraphQL specification: https://facebook.github.io/graphql/
• GraphQL foundation: https://foundation.graphql.org/
• graphql-java documentation: https://www.graphql-java.com/documentation/v11/
• Bojan Tomic tutorial: https://www.howtographql.com/graphql-java/0-introduction/
• Graphql-spqr github: https://github.com/leangen/graphql-spqr
• Phillip Kruger membership project: https://github.com/phillip-kruger/membership
• Phillip Kruger video: https://www.youtube.com/watch?v=TEF4qQzCXKI&feature=youtu.be
• My demo project: https://github.com/jefrajames/spqrdemo
• KumuluzEE GraphQL:
https://github.com/kumuluz/kumuluzee-graphql/blob/master/README.md
• Eclipse MicroProfile Sandbox:
https://github.com/eclipse/microprofile-sandbox/tree/master/proposals/graphql
References
Thank you!

Contenu connexe

Tendances

An intro to GraphQL
An intro to GraphQLAn intro to GraphQL
An intro to GraphQLvaluebound
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL StackSashko Stubailo
 
Serverless GraphQL for Product Developers
Serverless GraphQL for Product DevelopersServerless GraphQL for Product Developers
Serverless GraphQL for Product DevelopersSashko Stubailo
 
Adding GraphQL to your existing architecture
Adding GraphQL to your existing architectureAdding GraphQL to your existing architecture
Adding GraphQL to your existing architectureSashko Stubailo
 
React and GraphQL at Stripe
React and GraphQL at StripeReact and GraphQL at Stripe
React and GraphQL at StripeSashko Stubailo
 
Hadoop User Group Ireland (HUG) Ireland - Eddie Baggot Presentation April 2016
Hadoop User Group Ireland (HUG) Ireland - Eddie Baggot Presentation April 2016Hadoop User Group Ireland (HUG) Ireland - Eddie Baggot Presentation April 2016
Hadoop User Group Ireland (HUG) Ireland - Eddie Baggot Presentation April 2016John Mulhall
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQLRodrigo Prates
 
GraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4j
GraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4jGraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4j
GraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4jNeo4j
 
REST vs GraphQL
REST vs GraphQLREST vs GraphQL
REST vs GraphQLSquareboat
 
Modular GraphQL with Schema Stitching
Modular GraphQL with Schema StitchingModular GraphQL with Schema Stitching
Modular GraphQL with Schema StitchingSashko Stubailo
 
Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)Rafael Wilber Kerr
 
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
 
Introduction to graphQL
Introduction to graphQLIntroduction to graphQL
Introduction to graphQLMuhilvarnan V
 
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
 
CONDG April 23 2020 - Baskar Rao - GraphQL
CONDG April 23 2020 - Baskar Rao - GraphQLCONDG April 23 2020 - Baskar Rao - GraphQL
CONDG April 23 2020 - Baskar Rao - GraphQLMatthew Groves
 
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...luisw19
 

Tendances (20)

An intro to GraphQL
An intro to GraphQLAn intro to GraphQL
An intro to GraphQL
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
 
GraphQL Fundamentals
GraphQL FundamentalsGraphQL Fundamentals
GraphQL Fundamentals
 
Serverless GraphQL for Product Developers
Serverless GraphQL for Product DevelopersServerless GraphQL for Product Developers
Serverless GraphQL for Product Developers
 
Adding GraphQL to your existing architecture
Adding GraphQL to your existing architectureAdding GraphQL to your existing architecture
Adding GraphQL to your existing architecture
 
Graphql
GraphqlGraphql
Graphql
 
React and GraphQL at Stripe
React and GraphQL at StripeReact and GraphQL at Stripe
React and GraphQL at Stripe
 
Intro to GraphQL
 Intro to GraphQL Intro to GraphQL
Intro to GraphQL
 
Hadoop User Group Ireland (HUG) Ireland - Eddie Baggot Presentation April 2016
Hadoop User Group Ireland (HUG) Ireland - Eddie Baggot Presentation April 2016Hadoop User Group Ireland (HUG) Ireland - Eddie Baggot Presentation April 2016
Hadoop User Group Ireland (HUG) Ireland - Eddie Baggot Presentation April 2016
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
GraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4j
GraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4jGraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4j
GraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4j
 
REST vs GraphQL
REST vs GraphQLREST vs GraphQL
REST vs GraphQL
 
Modular GraphQL with Schema Stitching
Modular GraphQL with Schema StitchingModular GraphQL with Schema Stitching
Modular GraphQL with Schema Stitching
 
Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)
 
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
 
Introduction to graphQL
Introduction to graphQLIntroduction to graphQL
Introduction to graphQL
 
GraphQL + relay
GraphQL + relayGraphQL + relay
GraphQL + relay
 
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
 
CONDG April 23 2020 - Baskar Rao - GraphQL
CONDG April 23 2020 - Baskar Rao - GraphQLCONDG April 23 2020 - Baskar Rao - GraphQL
CONDG April 23 2020 - Baskar Rao - GraphQL
 
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
 

Similaire à Boost your APIs with GraphQL 1.0

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
 
The GraphQL Ecosystem in 2018
The GraphQL Ecosystem in 2018The GraphQL Ecosystem in 2018
The GraphQL Ecosystem in 2018Nikolas Burk
 
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
 
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...GreeceJS
 
Training Week: GraphQL 2022
Training Week: GraphQL 2022Training Week: GraphQL 2022
Training Week: GraphQL 2022Neo4j
 
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
 
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
 
Create GraphQL server with apolloJS
Create GraphQL server with apolloJSCreate GraphQL server with apolloJS
Create GraphQL server with apolloJSJonathan Jalouzot
 
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
 
Implementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCImplementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCTim Burks
 
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...apidays
 
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
 
GraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxGraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxSoham Dasgupta
 
GraphQL- Presentation
GraphQL- PresentationGraphQL- Presentation
GraphQL- PresentationRidwan Fadjar
 
How has netflix embraced graph ql for rapid application development
How has netflix embraced graph ql for rapid application developmentHow has netflix embraced graph ql for rapid application development
How has netflix embraced graph ql for rapid application developmentjenniferCarnel1
 
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything togetherSashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything togetherReact Conf Brasil
 

Similaire à Boost your APIs with GraphQL 1.0 (20)

Graphql usage
Graphql usageGraphql usage
Graphql usage
 
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
 
The GraphQL Ecosystem in 2018
The GraphQL Ecosystem in 2018The GraphQL Ecosystem in 2018
The GraphQL Ecosystem in 2018
 
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...
 
Spring GraphQL
Spring GraphQLSpring GraphQL
Spring GraphQL
 
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
 
Training Week: GraphQL 2022
Training Week: GraphQL 2022Training Week: GraphQL 2022
Training Week: GraphQL 2022
 
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
 
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
 
Create GraphQL server with apolloJS
Create GraphQL server with apolloJSCreate GraphQL server with apolloJS
Create GraphQL server with apolloJS
 
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-ify your APIs
GraphQL-ify your APIsGraphQL-ify your APIs
GraphQL-ify your APIs
 
Implementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCImplementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPC
 
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
apidays LIVE Australia - Have your cake and eat it too: GraphQL? REST? Why no...
 
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
 
GraphQL Europe Recap
GraphQL Europe RecapGraphQL Europe Recap
GraphQL Europe Recap
 
GraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxGraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptx
 
GraphQL- Presentation
GraphQL- PresentationGraphQL- Presentation
GraphQL- Presentation
 
How has netflix embraced graph ql for rapid application development
How has netflix embraced graph ql for rapid application developmentHow has netflix embraced graph ql for rapid application development
How has netflix embraced graph ql for rapid application development
 
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything togetherSashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
Sashko Stubailo - The GraphQL and Apollo Stack: connecting everything together
 

Plus de Otávio Santana

NoSQL design pitfalls with Java
NoSQL design pitfalls with JavaNoSQL design pitfalls with Java
NoSQL design pitfalls with JavaOtávio Santana
 
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.Otávio Santana
 
Architecting Cloud Computing Solutions with Java [1.1]
Architecting Cloud Computing Solutions with Java [1.1]Architecting Cloud Computing Solutions with Java [1.1]
Architecting Cloud Computing Solutions with Java [1.1]Otávio Santana
 
Arquitetando soluções de computação em nuvem com Java
Arquitetando soluções de computação em nuvem com JavaArquitetando soluções de computação em nuvem com Java
Arquitetando soluções de computação em nuvem com JavaOtávio Santana
 
Build, run, and scale your Java applications end to end
Build, run, and scale your Java applications end to endBuild, run, and scale your Java applications end to end
Build, run, and scale your Java applications end to endOtávio Santana
 
Jakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
Jakarta NoSQL: Meet the first Jakarta EE specification in the CloudJakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
Jakarta NoSQL: Meet the first Jakarta EE specification in the CloudOtávio Santana
 
ORMs: Heroes or Villains Inside the Architecture?
ORMs: Heroes or Villains Inside the Architecture?ORMs: Heroes or Villains Inside the Architecture?
ORMs: Heroes or Villains Inside the Architecture?Otávio Santana
 
Jakarta EE Meets NoSQL at the Cloud Age
Jakarta EE Meets NoSQL at the Cloud AgeJakarta EE Meets NoSQL at the Cloud Age
Jakarta EE Meets NoSQL at the Cloud AgeOtávio Santana
 
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]Otávio Santana
 
Let’s Make Graph Databases Fun Again with Java [DEV6043]
Let’s Make Graph Databases Fun Again with Java [DEV6043]Let’s Make Graph Databases Fun Again with Java [DEV6043]
Let’s Make Graph Databases Fun Again with Java [DEV6043]Otávio Santana
 
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]Otávio Santana
 
The new generation of data persistence with graph
The new generation of data persistence with graphThe new generation of data persistence with graph
The new generation of data persistence with graphOtávio Santana
 
Eclipse JNoSQL updates from JCP September 11
Eclipse JNoSQL updates from JCP September 11Eclipse JNoSQL updates from JCP September 11
Eclipse JNoSQL updates from JCP September 11Otávio Santana
 
Stateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - GuatemalaStateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - GuatemalaOtávio Santana
 
Stateless Microservice Security via JWT and MicroProfile - Mexico
Stateless Microservice Security via JWT and MicroProfile - MexicoStateless Microservice Security via JWT and MicroProfile - Mexico
Stateless Microservice Security via JWT and MicroProfile - MexicoOtávio Santana
 
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Database
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL DatabaseEclipse JNoSQL: The Definitive Solution for Java and NoSQL Database
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL DatabaseOtávio Santana
 
Management 3.0 and open source
Management 3.0 and open sourceManagement 3.0 and open source
Management 3.0 and open sourceOtávio Santana
 
Building a Recommendation Engine with Java EE
Building a Recommendation Engine with Java EEBuilding a Recommendation Engine with Java EE
Building a Recommendation Engine with Java EEOtávio Santana
 
Cassandra NoSQL, NoLimits!
Cassandra NoSQL, NoLimits!Cassandra NoSQL, NoLimits!
Cassandra NoSQL, NoLimits!Otávio Santana
 

Plus de Otávio Santana (20)

NoSQL design pitfalls with Java
NoSQL design pitfalls with JavaNoSQL design pitfalls with Java
NoSQL design pitfalls with Java
 
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
 
Architecting Cloud Computing Solutions with Java [1.1]
Architecting Cloud Computing Solutions with Java [1.1]Architecting Cloud Computing Solutions with Java [1.1]
Architecting Cloud Computing Solutions with Java [1.1]
 
Arquitetando soluções de computação em nuvem com Java
Arquitetando soluções de computação em nuvem com JavaArquitetando soluções de computação em nuvem com Java
Arquitetando soluções de computação em nuvem com Java
 
Build, run, and scale your Java applications end to end
Build, run, and scale your Java applications end to endBuild, run, and scale your Java applications end to end
Build, run, and scale your Java applications end to end
 
Jakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
Jakarta NoSQL: Meet the first Jakarta EE specification in the CloudJakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
Jakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
 
ORMs: Heroes or Villains Inside the Architecture?
ORMs: Heroes or Villains Inside the Architecture?ORMs: Heroes or Villains Inside the Architecture?
ORMs: Heroes or Villains Inside the Architecture?
 
Jakarta EE Meets NoSQL at the Cloud Age
Jakarta EE Meets NoSQL at the Cloud AgeJakarta EE Meets NoSQL at the Cloud Age
Jakarta EE Meets NoSQL at the Cloud Age
 
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
 
Let’s Make Graph Databases Fun Again with Java [DEV6043]
Let’s Make Graph Databases Fun Again with Java [DEV6043]Let’s Make Graph Databases Fun Again with Java [DEV6043]
Let’s Make Graph Databases Fun Again with Java [DEV6043]
 
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
 
The new generation of data persistence with graph
The new generation of data persistence with graphThe new generation of data persistence with graph
The new generation of data persistence with graph
 
Eclipse JNoSQL updates from JCP September 11
Eclipse JNoSQL updates from JCP September 11Eclipse JNoSQL updates from JCP September 11
Eclipse JNoSQL updates from JCP September 11
 
Stateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - GuatemalaStateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - Guatemala
 
Stateless Microservice Security via JWT and MicroProfile - Mexico
Stateless Microservice Security via JWT and MicroProfile - MexicoStateless Microservice Security via JWT and MicroProfile - Mexico
Stateless Microservice Security via JWT and MicroProfile - Mexico
 
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Database
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL DatabaseEclipse JNoSQL: The Definitive Solution for Java and NoSQL Database
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Database
 
Polyglot persistence
Polyglot persistencePolyglot persistence
Polyglot persistence
 
Management 3.0 and open source
Management 3.0 and open sourceManagement 3.0 and open source
Management 3.0 and open source
 
Building a Recommendation Engine with Java EE
Building a Recommendation Engine with Java EEBuilding a Recommendation Engine with Java EE
Building a Recommendation Engine with Java EE
 
Cassandra NoSQL, NoLimits!
Cassandra NoSQL, NoLimits!Cassandra NoSQL, NoLimits!
Cassandra NoSQL, NoLimits!
 

Dernier

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Dernier (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Boost your APIs with GraphQL 1.0

  • 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/ !
  • 6. GraphQL – A silver bullet ? ☺
  • 7. 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/
  • 8. GraphQL – A bit of history and context SOAP – Server to Server Data contract Strict (wsdl) Static (backend) Payload Heavy (XML, bindings, ports, services …) REST API – Web to Server Data contract Permissive (http) Static (backend) Payload Average (CRUD style APIs) GraphQL – Mobile to Server Data contract Strict (schema) Evolutive (gateway) Payload Small (Get Just What You Asked for)
  • 9. GraphQL – PROS / CONS Pros • Network efficiency • Lose coupling between client and server • Strong typing • Live contract Cons • Young ecosystem • Gateway-side complexity • No full usage of HTTP • Client-side handling of partial responses
  • 10. • Mobile/Multifront usage as the golden use case • Graph-oriented datasources • Unifying multiple datasources => « Soap is undead, REST is alive and GraphQL just born » GraphQL – To sum it up
  • 11. GraphQL in the Java Ecosystem graphql-java schema initialization (DSL, API), query execution 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
  • 12. 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 … schema-first code-first
  • 13. From Java EE to Jakarta EE The follow up of Java EE The new brand name 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 First Jakarta EE version Java EE 8 certified More on Payara blog Eclipse top-level project About 40 subprojects TCK, Spec, Implementations From Oracle to Eclipse 13.5 million lines of code 95k files About 400 IP reviews
  • 14. What makes Jakarta EE different?
  • 15. • The first new Jakarta EE specification • To streamline integration of NoSQL databases • Supporting all database models: Key-Value, Document, Column, Graph, Hybrid • In a consistent way • Leveraging an existing solution: Moving forward Jakarta EE NoSQL
  • 18. • Training exercise, in the context of MicroProfile GraphQL initiative • Available on GitHub, detailed in a blog post • Also an opportunity: – To test GlassFish 5.1 – To check portability on other application servers – To test JNoSQL About the demo project-Why? Graph QL
  • 19. • 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 About the demo project-How?
  • 20. Coding a Query with spqr
  • 21. Coding a Mutation with spqr
  • 22. Coding a Resolver with spqr
  • 24. • 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
  • 25. • 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
  • 26. • 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?
  • 27. 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!
  • 28. • GraphQL specification: https://facebook.github.io/graphql/ • GraphQL foundation: https://foundation.graphql.org/ • graphql-java documentation: https://www.graphql-java.com/documentation/v11/ • Bojan Tomic tutorial: https://www.howtographql.com/graphql-java/0-introduction/ • Graphql-spqr github: https://github.com/leangen/graphql-spqr • Phillip Kruger membership project: https://github.com/phillip-kruger/membership • Phillip Kruger video: https://www.youtube.com/watch?v=TEF4qQzCXKI&feature=youtu.be • My demo project: https://github.com/jefrajames/spqrdemo • KumuluzEE GraphQL: https://github.com/kumuluz/kumuluzee-graphql/blob/master/README.md • Eclipse MicroProfile Sandbox: https://github.com/eclipse/microprofile-sandbox/tree/master/proposals/graphql References