SlideShare a Scribd company logo
GraphQL
vs
Traditional REST API
Vladimir DejanovićJavaDaya
05 May 2018
@VladimirD_42@javadayistanbul
Let’s Meet
@VladimirD_42
Vladimir Dejanović
@javadayistanbul
Let’s Meet
@VladimirD_42
Vladimir Dejanović
@javadayistanbul
Let’s Meet
@VladimirD_42
Vladimir Dejanović
@javadayistanbul
Let’s Meet
@VladimirD_42
Vladimir Dejanović and Others...
@javadayistanbul
Agenda
@VladimirD_42@javadayistanbul
Agenda
@VladimirD_42
REST
@javadayistanbul
Agenda
@VladimirD_42
REST
GraphQL
@javadayistanbul
Agenda
@VladimirD_42
REST
GraphQL vs REST
GraphQL
@javadayistanbul
Agenda
@VladimirD_42
REST
GraphQL vs REST
Questions
GraphQL
@javadayistanbul
@VladimirD_42
What is REST?
@javadayistanbul
REST
@VladimirD_42
http://www.ics.uci.edu/~fielding/pubs
/dissertation/rest_arch_style.htm
@javadayistanbul
REST
@VladimirD_42
Client-Server Architecture
@javadayistanbul
REST
@VladimirD_42
Client-Server Architecture
Statelessness
@javadayistanbul
REST
@VladimirD_42
Client-Server Architecture
Cacheability
Statelessness
@javadayistanbul
REST
@VladimirD_42
Client-Server Architecture
Cacheability
Layered System
Statelessness
@javadayistanbul
REST
@VladimirD_42
Client-Server Architecture
Cacheability
Layered System
Statelessness
Code on Demand (Optional)
@javadayistanbul
REST
@VladimirD_42
Client-Server Architecture
Cacheability
Layered System
Statelessness
Code on Demand (Optional)
Uniform Interface
@javadayistanbul
REST in real life
@VladimirD_42@javadayistanbul
REST in real life
@VladimirD_42@javadayistanbul
REST in real life
@VladimirD_42@javadayistanbul
REST in real life
@VladimirD_42@javadayistanbul
Simple Blog
@VladimirD_42@javadayistanbul
Simple Blog
@VladimirD_42@javadayistanbul
Author
id
name
Simple Blog
@VladimirD_42@javadayistanbul
Author
id
name
Post
id
title
body
authorId
Simple Blog
@VladimirD_42@javadayistanbul
Author
id
name
Post
id
title
body
authorId
Comment
id
text
postId
authorId
Simple Blog
@VladimirD_42@javadayistanbul
Simple Blog REST Code
@VladimirD_42@javadayistanbul
https://github.com/vladimir-dejanovic/graphql
-vs-traditional-rest-api-conftalk_demo
Tag: rest-0.1
@VladimirD_42
What is GraphQL?
@javadayistanbul
GraphQL
@VladimirD_42@javadayistanbul
GraphQL is a query language
for APIs
@VladimirD_42
GraphQL
is
specification
@javadayistanbul
GraphQL
@VladimirD_42@javadayistanbul
graphql-java
GraphQL
@VladimirD_42@javadayistanbul
Talking is boring
Show Code
Simple Blog GraphQL Code
@VladimirD_42@javadayistanbul
https://github.com/vladimir-dejanovic/graphql
-vs-traditional-rest-api-conftalk_demo
Tag: graphql-0.1
GraphQL
@VladimirD_42
Client-Server Architecture
Cacheability
Layered System
Statelessness
Code on Demand (Optional)
Uniform Interface
@javadayistanbul
GraphQL
@VladimirD_42
Client-Server Architecture
Cacheability
Layered System
Statelessness
Code on Demand (Optional)
Uniform Interface
@javadayistanbul
GraphQL
@VladimirD_42
Client-Server Architecture
Cacheability
Layered System
Statelessness
Code on Demand (Optional)
Uniform Interface
@javadayistanbul
GraphQL
@VladimirD_42
Client-Server Architecture
Cacheability
Layered System
Statelessness
Code on Demand (Optional)
Uniform Interface
@javadayistanbul
GraphQL
@VladimirD_42
Client-Server Architecture
Cacheability
Layered System
Statelessness
Code on Demand (Optional)
Uniform Interface
@javadayistanbul
GraphQL
@VladimirD_42
Client-Server Architecture
Cacheability
Layered System
Statelessness
Code on Demand (Optional)
Uniform Interface
@javadayistanbul
GraphQL
@VladimirD_42
Client-Server Architecture
Cacheability
Layered System
Statelessness
Code on Demand (Optional)
Uniform Interface
@javadayistanbul
REST
@VladimirD_42
Schema optional
@javadayistanbul
REST
@VladimirD_42
Schema optional
@javadayistanbul
Good practice, but still optional
GraphQL
@VladimirD_42
Schema is mandatory
@javadayistanbul
GraphQL
@VladimirD_42@javadayistanbul
GraphQL
@VladimirD_42@javadayistanbul
GraphQL
@VladimirD_42@javadayistanbul
GraphQL
@VladimirD_42@javadayistanbul
GraphQL
@VladimirD_42@javadayistanbul
GraphQL
@VladimirD_42@javadayistanbul
@VladimirD_42@javadayistanbul
ref: https://i0.wp.com/keyholesoftware.com/wp-content/uploads/HATEOAS.png
REST
Simple Blog GraphQL Code
@VladimirD_42@javadayistanbul
https://github.com/vladimir-dejanovic/graphql
-vs-traditional-rest-api-conftalk_demo
Tag: graphql-0.2
GraphQL
@VladimirD_42@javadayistanbul
Post
Comment
Author
GraphQL
@VladimirD_42@javadayistanbul
Post
Comment
Author
GraphQL
@VladimirD_42@javadayistanbul
Post
Comment
Author
GraphQL
@VladimirD_42@javadayistanbul
Post
Comment
Author
GraphQL
@VladimirD_42@javadayistanbul
Post
Comment
Author
GraphQL
@VladimirD_42@javadayistanbul
Post
Comment
Author
Simple Blog GraphQL Code
@VladimirD_42@javadayistanbul
https://github.com/vladimir-dejanovic/graphql
-vs-traditional-rest-api-conftalk_demo
Tag: graphql-0.3
GraphQL
@VladimirD_42@javadayistanbul
GraphQL is a query language
for APIs
GraphQL
@VladimirD_42@javadayistanbul
API
GraphQL
@VladimirD_42@javadayistanbul
Powerful query language
GraphQL
@VladimirD_42@javadayistanbul
Client call the shots
GraphQL
@VladimirD_42@javadayistanbul
Post
Comment
Author
GraphQL
@VladimirD_42@javadayistanbul
Post
Comment
Author
@VladimirD_42
Abuse of GraphQL
query {
allPosts {
title
comments {
text
createdBy {
name
posts {
title
comments {
text
@javadayistanbul
@VladimirD_42
Abuse of GraphQL
query {
allPosts {
title
comments {
text
createdBy {
name
posts {
title
comments {
text
@javadayistanbul
Protect from Abuse
@VladimirD_42@javadayistanbul
Protect from Abuse
@VladimirD_42
Time out
@javadayistanbul
Protect from Abuse
@VladimirD_42
Time out
@javadayistanbul
Max Query Depth
Protect from Abuse
@VladimirD_42
Time out
@javadayistanbul
Max Query Depth
Max Query Complexity
Protect from Abuse
@VladimirD_42
Time out
@javadayistanbul
Max Query Depth
Max Query Complexity
Throttling
GraphQL query language for API
@VladimirD_42@javadayistanbul
GraphQL query language for API
@VladimirD_42
Query
@javadayistanbul
GraphQL query language for API
@VladimirD_42
Query
@javadayistanbul
Mutation
Simple Blog GraphQL Code
@VladimirD_42@javadayistanbul
https://github.com/vladimir-dejanovic/graphql
-vs-traditional-rest-api-conftalk_demo
Tag: graphql-0.4
GraphQL query language for API
@VladimirD_42
Query
@javadayistanbul
Mutation
Subscription
GraphQL questions to ask
@VladimirD_42@javadayistanbul
GraphQL questions to ask
@VladimirD_42@javadayistanbul
Error Responses
GraphQL questions to ask
@VladimirD_42@javadayistanbul
Error Responses
Performance & Cache
GraphQL questions to ask
@VladimirD_42@javadayistanbul
Error Responses
Performance & Cache
Authentication & Authorisation
@VladimirD_42
GraphQL
vs
Traditional REST API
@javadayistanbul
GraphQL vs Traditional REST API
@VladimirD_42
Similar, but different
@javadayistanbul
GraphQL vs Traditional REST API
@VladimirD_42
Similar, but different
@javadayistanbul
Tools & knowledge
GraphQL vs Traditional REST API
@VladimirD_42
Similar, but different
@javadayistanbul
Tools & knowledge
“Old Tricks” can be used
GraphQL vs Traditional REST API
@VladimirD_42@javadayistanbul
GraphQL rich SDL
GraphQL vs Traditional REST API
@VladimirD_42@javadayistanbul
GraphQL rich SDL
GraphQL powerful Query Lang
@VladimirD_42
Thank You
@javadayistanbul
Questions
@VladimirD_42
@VladimirD_42
vladimir@itshark.xyz
@javadayistanbul

More Related Content

PDF
Devoxx France 2018 GraphQL vs Traditional REST API
PDF
GeeCON 2018 GraphQL vs Traditional REST API
PDF
GraphQL vs Traditional Rest API [GeeCon Prague 2018]
PDF
Graphql
PPTX
Introduction to GraphQL
PDF
GraphQL in an Age of REST
PDF
Intro to GraphQL
PDF
REST vs GraphQL
Devoxx France 2018 GraphQL vs Traditional REST API
GeeCON 2018 GraphQL vs Traditional REST API
GraphQL vs Traditional Rest API [GeeCon Prague 2018]
Graphql
Introduction to GraphQL
GraphQL in an Age of REST
Intro to GraphQL
REST vs GraphQL

What's hot (19)

PDF
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open Web
PDF
How to GraphQL
PDF
GraphQL Search
PPTX
Introduction to graphQL
PDF
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
PPTX
GraphQL Introduction
PPT
Graphql presentation
PDF
GraphQL: The Missing Link Between Frontend and Backend Devs
PPTX
An intro to GraphQL
PDF
Introduction to GraphQL
PDF
GraphQL London January 2018: Graphql tooling
PDF
Modular GraphQL with Schema Stitching
PDF
GraphQL: Enabling a new generation of API developer tools
PDF
PDF
GraphQL + relay
PPTX
GraphQL Introduction
PPTX
Refactoring Design Patterns the Functional Way (in Scala)
PPTX
Taking Control of your Data with GraphQL
PDF
Better APIs with GraphQL
Kafka and GraphQL: Misconceptions and Connections | Gerard Klijs, Open Web
How to GraphQL
GraphQL Search
Introduction to graphQL
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL Introduction
Graphql presentation
GraphQL: The Missing Link Between Frontend and Backend Devs
An intro to GraphQL
Introduction to GraphQL
GraphQL London January 2018: Graphql tooling
Modular GraphQL with Schema Stitching
GraphQL: Enabling a new generation of API developer tools
GraphQL + relay
GraphQL Introduction
Refactoring Design Patterns the Functional Way (in Scala)
Taking Control of your Data with GraphQL
Better APIs with GraphQL
Ad

Similar to Java Day Istanbul 2018 GraphQL vs Traditional REST API (20)

PDF
GraphQL in Java World [Workshop RivieraDev 2019]
PDF
What limitations & problems of REST API can be solved with GraphQL [jPrime 2019]
PDF
GraphQL vs Traditional Rest API
PDF
REST API vs gRPC, which one should you use in breaking a monolith [Dev conf 2...
PPTX
Building GraphQL API in C#.pptx
PDF
GraphQL and its schema as a universal layer for database access
PDF
wepik-enhancing-web-development-with-nodejs-graphql-a-practical-guide-2024041...
PDF
GraphQL-ify your API - JFall 2022
PDF
GraphQL-ify your APIs
PPTX
GraphQL_devoxx_2023.pptx
PDF
Our Hybrid Future: WordPress As Part of the Stack
PDF
An introduction to GraphQL in .NET Core
PDF
Our Hybrid Future: WordPress As Part of the Stack #WCNYC
PPTX
Building GraphQL APIs in C#
PPTX
Xamarin + GraphQL
PPTX
GraphQL-ify your APIs
PPTX
Building GraphQL API in C#.pptx
PDF
An introduction to GraphQL
PPTX
Xamarin + GraphQL
PDF
Spring GraphQL
GraphQL in Java World [Workshop RivieraDev 2019]
What limitations & problems of REST API can be solved with GraphQL [jPrime 2019]
GraphQL vs Traditional Rest API
REST API vs gRPC, which one should you use in breaking a monolith [Dev conf 2...
Building GraphQL API in C#.pptx
GraphQL and its schema as a universal layer for database access
wepik-enhancing-web-development-with-nodejs-graphql-a-practical-guide-2024041...
GraphQL-ify your API - JFall 2022
GraphQL-ify your APIs
GraphQL_devoxx_2023.pptx
Our Hybrid Future: WordPress As Part of the Stack
An introduction to GraphQL in .NET Core
Our Hybrid Future: WordPress As Part of the Stack #WCNYC
Building GraphQL APIs in C#
Xamarin + GraphQL
GraphQL-ify your APIs
Building GraphQL API in C#.pptx
An introduction to GraphQL
Xamarin + GraphQL
Spring GraphQL
Ad

More from Vladimir Dejanovic (14)

PDF
Micronaut, Dragon-Slayer (Spring/boot) or just another framework [GeeCON Krak...
PDF
What Users Want, A/B testing explained [CodeteCon 2018]
PDF
REST API vs gRPC, which one should you use in breaking a monolith [Kdg.net 2018]
PDF
Java land What Users Want, A/B testing explained
PDF
JavaLand gRPC vs REST API
PDF
Java One Secret of developing high performance website, with no budget
PDF
Voxxed Days Belgrade - Changing wheels on moving car, from monolith to micros...
PDF
What users want [DevoxxPL]
PDF
Secret of developing high performance website, with no budget in small amount...
PDF
Changing wheels on moving car, from monolith to microservices by using api's V2
PDF
Changing wheels on moving car, from monolith to microservices by using api's
PDF
Pain of growing up, and moving to large scale
PDF
Protocol buffers and Microservices
ODP
What users want
Micronaut, Dragon-Slayer (Spring/boot) or just another framework [GeeCON Krak...
What Users Want, A/B testing explained [CodeteCon 2018]
REST API vs gRPC, which one should you use in breaking a monolith [Kdg.net 2018]
Java land What Users Want, A/B testing explained
JavaLand gRPC vs REST API
Java One Secret of developing high performance website, with no budget
Voxxed Days Belgrade - Changing wheels on moving car, from monolith to micros...
What users want [DevoxxPL]
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 V2
Changing wheels on moving car, from monolith to microservices by using api's
Pain of growing up, and moving to large scale
Protocol buffers and Microservices
What users want

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Electronic commerce courselecture one. Pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Encapsulation_ Review paper, used for researhc scholars
Reach Out and Touch Someone: Haptics and Empathic Computing
Dropbox Q2 2025 Financial Results & Investor Presentation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Electronic commerce courselecture one. Pdf
MYSQL Presentation for SQL database connectivity
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectral efficient network and resource selection model in 5G networks
Digital-Transformation-Roadmap-for-Companies.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

Java Day Istanbul 2018 GraphQL vs Traditional REST API