SlideShare a Scribd company logo
1 of 89
Download to read offline
GraphQL vs
Traditional REST API
Vladimir Dejanović
Prague, 18-19 October 2018
@VladimirD_42
Vladimir Dejanović
Let’s Meet
@VladimirD_42
vladimir@itshark.xyz
http://itshark.xyz
@VladimirD_42
Vladimir Dejanović
Let’s Meet
http://itshark.xyz
@VladimirD_42
Vladimir Dejanović
Let’s Meet
@VladimirD_42
Vladimir Dejanović
Let’s Meet
and Others...
@VladimirD_42@geecon
Agenda
@VladimirD_42@geecon
Agenda
REST
@VladimirD_42@geecon
Agenda
REST
GraphQL
@VladimirD_42@geecon
Agenda
REST
GraphQL
GraphQL vs REST
@VladimirD_42@geecon
Agenda
REST
GraphQL
GraphQL vs REST
Questions
@VladimirD_42@geecon
What is REST?
@VladimirD_42@geecon
REST
http://www.ics.uci.edu/~fielding/pubs/
dissertation/rest_arch_style.htm
@VladimirD_42@geecon
REST
Client-Server Architecture
@VladimirD_42@geecon
REST
Statelessness
Client-Server Architecture
@VladimirD_42@geecon
REST
Statelessness
Cacheability
Client-Server Architecture
@VladimirD_42@geecon
REST
Statelessness
Cacheability
Layered System
Client-Server Architecture
@VladimirD_42@geecon
REST
Statelessness
Cacheability
Layered System
Client-Server Architecture
Code on Demand (Optional)
@VladimirD_42@geecon
REST
Statelessness
Cacheability
Layered System
Uniform Interface
Client-Server Architecture
Code on Demand (Optional)
@VladimirD_42@geecon
REST in real life
@VladimirD_42@geecon
REST in real life
@VladimirD_42@geecon
REST in real life
@VladimirD_42@geecon
REST in real life
@VladimirD_42@geecon
Simple Blog
@VladimirD_42@geecon
Simple Blog
Author
id
name
@VladimirD_42@geecon
Simple Blog
Author
id
name
Post
id
title
body
authorId
@VladimirD_42@geecon
Simple Blog
Author
id
name
Post
id
title
body
authorId
Comment
id
text
postId
authorId
@VladimirD_42@geecon
Simple Blog
https://github.com/vladimir-dejanovic/graphql-
vs-traditional-rest-api-conftalk_demo
Branch: rest-0.1
@VladimirD_42@geecon
What is GraphQL?
@VladimirD_42@geecon
GraphQL
GraphQL is a query language
for APIs
@VladimirD_42@geecon
GraphQL
is
specification
@VladimirD_42@geecon
GraphQL
graphql-java
@VladimirD_42@geecon
GraphQL
Talking is boring
Show Code
@VladimirD_42@geecon
Simple Blog GraphQL Code
https://github.com/vladimir-dejanovic/graphql-
vs-traditional-rest-api-conftalk_demo
Branch: graphql-0.1
@VladimirD_42@geecon
GraphQL
Statelessness
Cacheability
Layered System
Uniform Interface
Client-Server Architecture
Code on Demand (Optional)
@VladimirD_42@geecon
GraphQL
Statelessness
Cacheability
Layered System
Uniform Interface
Client-Server Architecture
Code on Demand (Optional)
@VladimirD_42@geecon
GraphQL
Statelessness
Cacheability
Layered System
Uniform Interface
Client-Server Architecture
Code on Demand (Optional)
@VladimirD_42@geecon
GraphQL
Statelessness
Cacheability
Layered System
Uniform Interface
Client-Server Architecture
Code on Demand (Optional)
@VladimirD_42@geecon
GraphQL
Statelessness
Cacheability
Layered System
Uniform Interface
Client-Server Architecture
Code on Demand (Optional)
@VladimirD_42@geecon
GraphQL
Statelessness
Cacheability
Layered System
Uniform Interface
Client-Server Architecture
Code on Demand (Optional)
@VladimirD_42@geecon
GraphQL
Statelessness
Cacheability
Layered System
Uniform Interface
Client-Server Architecture
Code on Demand (Optional)
@VladimirD_42@geecon
REST
Schema Optional
@VladimirD_42@geecon
REST
Schema Optional
Good practice, but still optional
@VladimirD_42@geecon
GraphQL
Schema is MANDATORY
@VladimirD_42@geecon
GraphQL
@VladimirD_42@geecon
GraphQL
@VladimirD_42@geecon
GraphQL
@VladimirD_42@geecon
GraphQL
@VladimirD_42@geecon
GraphQL
@VladimirD_42@geecon
GraphQL
@VladimirD_42@geecon
REST
@VladimirD_42@geecon
Simple Blog GraphQL Code
https://github.com/vladimir-dejanovic/graphql-
vs-traditional-rest-api-conftalk_demo
Branch: graphql-0.2
@VladimirD_42@geecon
GraphQL
Post
Comment
Author
@VladimirD_42@geecon
GraphQL
Post
Comment
Author
@VladimirD_42@geecon
GraphQL
Post
Comment
Author
@VladimirD_42@geecon
GraphQL
Post
Comment
Author
@VladimirD_42@geecon
GraphQL
Post
Comment
Author
@VladimirD_42@geecon
GraphQL
Post
Comment
Author
@VladimirD_42@geecon
Simple Blog GraphQL Code
https://github.com/vladimir-dejanovic/graphql-
vs-traditional-rest-api-conftalk_demo
Branch: graphql-0.3
@VladimirD_42@geecon
GraphQL
GraphQL is a query language
for APIs
@VladimirD_42@geecon
GraphQL
API
@VladimirD_42@geecon
GraphQL
Powerful Query Language
@VladimirD_42@geecon
GraphQL
Client call the shots
@VladimirD_42@geecon
GraphQL
Post
Comment
Author
@VladimirD_42@geecon
GraphQL
Post
Comment
Author
@VladimirD_42@geecon
Abuse of GraphQL
query {
allPosts {
title
comments {
text
createdBy {
name
posts {
title
comments {
text
@VladimirD_42@geecon
Abuse of GraphQL
query {
allPosts {
title
comments {
text
createdBy {
name
posts {
title
comments {
text
@VladimirD_42@geecon
Protect from Abuse
@VladimirD_42@geecon
Protect from Abuse
Time Out
@VladimirD_42@geecon
Protect from Abuse
Time Out
Max Query Depth
@VladimirD_42@geecon
Protect from Abuse
Time Out
Max Query Depth
Max Query Complexity
@VladimirD_42@geecon
Protect from Abuse
Time Out
Max Query Depth
Max Query Complexity
Throttling
@VladimirD_42@geecon
GraphQL query language for API
@VladimirD_42@geecon
GraphQL query language for API
Query
@VladimirD_42@geecon
GraphQL query language for API
Query
Mutation
@VladimirD_42@geecon
Simple Blog GraphQL Code
https://github.com/vladimir-dejanovic/graphql-
vs-traditional-rest-api-conftalk_demo
Branch: graphql-0.4
@VladimirD_42@geecon
GraphQL query language for API
Query
Mutation
Subscription
@VladimirD_42@geecon
GraphQL questions to ask
@VladimirD_42@geecon
GraphQL questions to ask
Error Responses
@VladimirD_42@geecon
GraphQL questions to ask
Error Responses
Performance & Cache
@VladimirD_42@geecon
GraphQL questions to ask
Error Responses
Performance & Cache
Authentication & Authorisation
@VladimirD_42@geecon
GraphQL
Vs
Traditional REST API
@VladimirD_42@geecon
GraphQL vs Traditional REST API
“Similar”
@VladimirD_42@geecon
GraphQL vs Traditional REST API
“Similar”
Tools & Knowledge
@VladimirD_42@geecon
GraphQL vs Traditional REST API
“Similar”
Tools & Knowledge
“Old Tricks”
@VladimirD_42@geecon
GraphQL vs Traditional REST API
GraphQL rich SDL
@VladimirD_42@geecon
GraphQL vs Traditional REST API
GraphQL rich SDL
GraphQL powerful Query Language
@VladimirD_42@geecon
Thank You
@VladimirD_42@geecon
References
https://github.com/vladimir-dejanovic/graphql-
vs-traditional-rest-api-conftalk_demo
http://www.ics.uci.edu/~fielding/pubs/dissertat
ion/rest_arch_style.htm
@VladimirD_42
Questions
@VladimirD_42
vladimir@itshark.xyz
http://itshark.xyz
@geecon

More Related Content

What's hot

What's hot (20)

Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to 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
 
REST vs GraphQL
REST vs GraphQLREST vs GraphQL
REST vs GraphQL
 
GraphQL London January 2018: Graphql tooling
GraphQL London January 2018: Graphql toolingGraphQL London January 2018: Graphql tooling
GraphQL London January 2018: Graphql tooling
 
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open Web
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open WebKafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open Web
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open Web
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
GraphQL Introduction
GraphQL IntroductionGraphQL Introduction
GraphQL Introduction
 
The 7 Deadly Sins of API Design
The 7 Deadly Sins of API DesignThe 7 Deadly Sins of API Design
The 7 Deadly Sins of API Design
 
An intro to GraphQL
An intro to GraphQLAn intro to GraphQL
An intro to GraphQL
 
Building materialised views for linked data systems using microservices
Building materialised views for linked data systems using microservicesBuilding materialised views for linked data systems using microservices
Building materialised views for linked data systems using microservices
 
How to GraphQL
How to GraphQLHow to GraphQL
How to GraphQL
 
GraphQL in an Age of REST
GraphQL in an Age of RESTGraphQL in an Age of REST
GraphQL in an Age of REST
 
From programming languages to network protocols: lessons on API design
From programming languages to network protocols: lessons on API designFrom programming languages to network protocols: lessons on API design
From programming languages to network protocols: lessons on API design
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentation
 
GraphQL Introduction
GraphQL IntroductionGraphQL Introduction
GraphQL Introduction
 
Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)Graphql Intro (Tutorial and Example)
Graphql Intro (Tutorial and Example)
 
Modular GraphQL with Schema Stitching
Modular GraphQL with Schema StitchingModular GraphQL with Schema Stitching
Modular GraphQL with Schema Stitching
 
DEVOXX UK 2018 - GraphQL as an alternative approach to REST
DEVOXX UK 2018 - GraphQL as an alternative approach to RESTDEVOXX UK 2018 - GraphQL as an alternative approach to REST
DEVOXX UK 2018 - GraphQL as an alternative approach to REST
 
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
 
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
 

Similar to GraphQL vs Traditional Rest API [GeeCon Prague 2018]

Similar to GraphQL vs Traditional Rest API [GeeCon Prague 2018] (16)

What limitations & problems of REST API can be solved with GraphQL [jPrime 2019]
What limitations & problems of REST API can be solved with GraphQL [jPrime 2019]What limitations & problems of REST API can be solved with GraphQL [jPrime 2019]
What limitations & problems of REST API can be solved with GraphQL [jPrime 2019]
 
GraphQL in Java World [Workshop RivieraDev 2019]
GraphQL in Java World [Workshop RivieraDev 2019]GraphQL in Java World [Workshop RivieraDev 2019]
GraphQL in Java World [Workshop RivieraDev 2019]
 
GraphQL vs Traditional Rest API
GraphQL vs Traditional Rest APIGraphQL vs Traditional Rest API
GraphQL vs Traditional Rest API
 
REST API vs gRPC, which one should you use in breaking a monolith [Dev conf 2...
REST API vs gRPC, which one should you use in breaking a monolith [Dev conf 2...REST API vs gRPC, which one should you use in breaking a monolith [Dev conf 2...
REST API vs gRPC, which one should you use in breaking a monolith [Dev conf 2...
 
Voxxed Days Belgrade - Changing wheels on moving car, from monolith to micros...
Voxxed Days Belgrade - Changing wheels on moving car, from monolith to micros...Voxxed Days Belgrade - Changing wheels on moving car, from monolith to micros...
Voxxed Days Belgrade - Changing wheels on moving car, from monolith to micros...
 
Xamarin + GraphQL
Xamarin + GraphQLXamarin + GraphQL
Xamarin + GraphQL
 
Micronaut, Dragon-Slayer (Spring/boot) or just another framework [GeeCON Krak...
Micronaut, Dragon-Slayer (Spring/boot) or just another framework [GeeCON Krak...Micronaut, Dragon-Slayer (Spring/boot) or just another framework [GeeCON Krak...
Micronaut, Dragon-Slayer (Spring/boot) or just another framework [GeeCON Krak...
 
REST API vs gRPC, which one should you use in breaking a monolith [Kdg.net 2018]
REST API vs gRPC, which one should you use in breaking a monolith [Kdg.net 2018]REST API vs gRPC, which one should you use in breaking a monolith [Kdg.net 2018]
REST API vs gRPC, which one should you use in breaking a monolith [Kdg.net 2018]
 
Building GraphQL APIs in C#
Building GraphQL APIs in C#Building GraphQL APIs in C#
Building GraphQL APIs in C#
 
Building GraphQL API in C#.pptx
Building GraphQL API in C#.pptxBuilding GraphQL API in C#.pptx
Building GraphQL API in C#.pptx
 
A tech writer, a map, and an app
A tech writer, a map, and an appA tech writer, a map, and an app
A tech writer, a map, and an app
 
Changing wheels on moving car, from monolith to microservices by using api's V2
Changing wheels on moving car, from monolith to microservices by using api's V2Changing wheels on moving car, from monolith to microservices by using api's V2
Changing wheels on moving car, from monolith to microservices by using api's V2
 
Multiplatform development with Kotlin
Multiplatform  development with KotlinMultiplatform  development with Kotlin
Multiplatform development with Kotlin
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learned
 
Implement Web API with Swagger
Implement Web API with SwaggerImplement Web API with Swagger
Implement Web API with Swagger
 
apidays LIVE Australia 2020 - From micro to macro-coordination through domain...
apidays LIVE Australia 2020 - From micro to macro-coordination through domain...apidays LIVE Australia 2020 - From micro to macro-coordination through domain...
apidays LIVE Australia 2020 - From micro to macro-coordination through domain...
 

More from Vladimir Dejanovic

More from Vladimir Dejanovic (10)

What Users Want, A/B testing explained [CodeteCon 2018]
What Users Want, A/B testing explained [CodeteCon 2018]What Users Want, A/B testing explained [CodeteCon 2018]
What Users Want, A/B testing explained [CodeteCon 2018]
 
Java land What Users Want, A/B testing explained
Java land What Users Want, A/B testing explainedJava land What Users Want, A/B testing explained
Java land What Users Want, A/B testing explained
 
JavaLand gRPC vs REST API
JavaLand gRPC vs REST APIJavaLand gRPC vs REST API
JavaLand gRPC vs REST API
 
Java One Secret of developing high performance website, with no budget
Java One Secret of developing high performance website, with no budgetJava One Secret of developing high performance website, with no budget
Java One Secret of developing high performance website, with no budget
 
What users want [DevoxxPL]
What users want [DevoxxPL]What users want [DevoxxPL]
What users want [DevoxxPL]
 
Secret of developing high performance website, with no budget in small amount...
Secret of developing high performance website, with no budget in small amount...Secret of developing high performance website, with no budget in small amount...
Secret of developing high performance website, with no budget in small amount...
 
Changing wheels on moving car, from monolith to microservices by using api's
Changing wheels on moving car, from monolith to microservices by using api'sChanging wheels on moving car, from monolith to microservices by using api's
Changing wheels on moving car, from monolith to microservices by using api's
 
Pain of growing up, and moving to large scale
Pain of growing up, and moving to large scalePain of growing up, and moving to large scale
Pain of growing up, and moving to large scale
 
Protocol buffers and Microservices
Protocol buffers and MicroservicesProtocol buffers and Microservices
Protocol buffers and Microservices
 
What users want
What users wantWhat users want
What users want
 

Recently uploaded

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 

GraphQL vs Traditional Rest API [GeeCon Prague 2018]