SlideShare a Scribd company logo
1 of 122
Download to read offline
The Evolution of API Design
API
History
New API Standard
GraphQL over REST
GraphQL Fundamentals
Application
Application Database
Application DatabaseServer
rogramming
pplication
nterface
Socket Programming
Socket
Remote Procedure Call
XML-RPC
XML-RPC
Remote Procedure Call
Remote Procedure Call
XML-RPC
Simple Object Access Protocol
SOAP
SOAP-ENV : Envelope
SOAP-ENV: Header
SOAP-ENV: Body
Simple Object Access Protocol
SOAP
REpresentational State Transfer
REST
REST
• Need for efficient data loading
• Need for efficient data loading
• Variety of different frontend platforms
• Need for efficient data loading
• Variety of different frontend platforms
• Fast & Iterative development
With GraphQL,
you model your business domain as a graph
A Query Language for your APIQuery Language


• New API Standard invented by Facebook
• New API Standard invented by Facebook
• Presented publicly at React.js Conf 2015
• New API Standard invented by Facebook
• Presented publicly at React.js Conf 2015
• Declarative Data Fetching
• New API Standard invented by Facebook
• Presented publicly at React.js Conf 2015
• Declarative Data Fetching
• Single Endpoint, Single Request
• New API Standard invented by Facebook
• Presented publicly at React.js Conf 2015
• Declarative Data Fetching
• Single Endpoint, Single Request
• Strong Type System
Open Source License
BSD + Patents
Open Source License
BSD + Patents
Open Source License
BSD + Patents
Open Source License
OWFa v1.0
https://developer.github.com/v3/
https://developer.github.com/v4/
User Name
User Name
Post Title
User Name
Post Title
Follower Name
/users/<id>
/users/<id>/posts
/users/<id>/followers
/users/<id>
/users/<id>/posts
/users/<id>/followers
Fetch user data
/users/<id>
/users/<id>/posts
/users/<id>/followers
Fetch user data
/users/<id>
/users/<id>/posts
/users/<id>/followers
Fetch posts
/users/<id>
/users/<id>/posts
/users/<id>/followers
Fetch posts
/users/<id>
/users/<id>/posts
/users/<id>/followers
Fetch followers
/users/<id>
/users/<id>/posts
/users/<id>/followers
Fetch followers
/graphql
/graphql
Fetch everything with a single request
/graphql
Fetch everything with a single request
• Underfetching (N + 1 requests problem)
/users/<id>
/users/<id>/posts
/users/<id>/followers
/users/<id>
/users/<id>/posts
/users/<id>/followers
/users/<id>
/users/<id>/posts
/users/<id>/followers
/graphql
• Underfetching (N + 1 requests problem)
• Nested CompletionHandler
• Underfetching (N + 1 requests problem)
• Nested CompletionHandler
• Underfetching (N + 1 requests problem)
• Nested CompletionHandler
• Overfetching
.
.
.
.
.
.
.
.
.
• Underfetching (N + 1 requests problem)
• Nested CompletionHandler
• Overfetching
• Too Many Endpoints
Clients
/users
/usersInfo
/usersCount
/userPosts
/users
/usersInfo
/usersCount
/userPosts
/userFollowers
Clients
/userByPost
/userNameStartsK
• Underfetching (N + 1 requests problem)
• Nested CompletionHandler
• Overfetching
• Too Many Endpoints
• Versioning
• Underfetching (N + 1 requests problem)
• Nested CompletionHandler
• Overfetching
• Too Many Endpoints
• Versioning
• Schemaless
• Underfetching (N + 1 requests problem)
• Nested CompletionHandler
• Overfetching
• Too Many Endpoints
• Versioning
• Schemaless
• Slow Product Development
User Requests (per hour)
Authenticated 5000
Unauthenticated 60
User Requests (per hour)
Authenticated 5000
Unauthenticated 60
User Requests (per hour)
Authenticated 5000
Unauthenticated 60
• Node Limit

Individual Call ≦ 500,000 total nodes
• Node Limit
• Rate Limit

5,000 points per hour (points ≠ call)
1
1
100
1
100
5000
1
100
5000
5101
1
100
5000
5101 / 100
= 51
Server
Server
Server
Connection
Server
Connection
Server
Connection
Architectural Style
HTTP, HTTPS Protocol
Multiple Endpoints
Schemaless
Fixed Data Structure
Versioning
Standard API
Transport Layer Agnostic
Single Endpoint
Strongly Typed Schema
Flexible Data Structure
Evolve API Without Versions
GraphQL over REST
GraphQL over REST

More Related Content

What's hot

AWS for the Java Developer
AWS for the Java DeveloperAWS for the Java Developer
AWS for the Java DeveloperRory Preddy
 
GraphQL as a REST API alternative
GraphQL as a REST API alternativeGraphQL as a REST API alternative
GraphQL as a REST API alternativeKamil Rykowski
 
RubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipelineRubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipelineFlorian Dutey
 
AWS Lambda Function with Kotlin
AWS Lambda Function with KotlinAWS Lambda Function with Kotlin
AWS Lambda Function with KotlinTroy Miles
 
React Component in scala.js
React Component in scala.jsReact Component in scala.js
React Component in scala.jsUnfold UI
 
Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2asim78
 
RubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applicationsRubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applicationsFlorian Dutey
 
Webservices: The RESTful Approach
Webservices: The RESTful ApproachWebservices: The RESTful Approach
Webservices: The RESTful ApproachMushfekur Rahman
 
Spark Summit - Mobius C# Binding for Apache Spark
Spark Summit - Mobius C# Binding for Apache SparkSpark Summit - Mobius C# Binding for Apache Spark
Spark Summit - Mobius C# Binding for Apache Sparkshareddatamsft
 
Gr8conf - Griffon Update
Gr8conf - Griffon UpdateGr8conf - Griffon Update
Gr8conf - Griffon UpdateAndres Almiray
 
ソーシャルゲームの課金認証共通基盤をどう設計したか
ソーシャルゲームの課金認証共通基盤をどう設計したかソーシャルゲームの課金認証共通基盤をどう設計したか
ソーシャルゲームの課金認証共通基盤をどう設計したかYugo Shimizu
 
The Holy Grail of continuous delivery in distributed teams environment
The Holy Grail of continuous delivery in distributed teams environmentThe Holy Grail of continuous delivery in distributed teams environment
The Holy Grail of continuous delivery in distributed teams environmentSzymon Kurcab
 
Scala ecosystem - Dublin Scala Meetup, Oct 2018
Scala ecosystem - Dublin Scala Meetup, Oct 2018Scala ecosystem - Dublin Scala Meetup, Oct 2018
Scala ecosystem - Dublin Scala Meetup, Oct 2018Mikhail Girkin
 
C# 8 in Libraries and Applications
C# 8 in Libraries and ApplicationsC# 8 in Libraries and Applications
C# 8 in Libraries and ApplicationsChristian Nagel
 
Avoiding GraphQL insecurities with OWASP SKF - OWASP HU meetup
Avoiding GraphQL insecurities with OWASP SKF - OWASP HU meetupAvoiding GraphQL insecurities with OWASP SKF - OWASP HU meetup
Avoiding GraphQL insecurities with OWASP SKF - OWASP HU meetupDavide Cioccia
 

What's hot (20)

AWS for the Java Developer
AWS for the Java DeveloperAWS for the Java Developer
AWS for the Java Developer
 
GraphQL as a REST API alternative
GraphQL as a REST API alternativeGraphQL as a REST API alternative
GraphQL as a REST API alternative
 
Vs java (1)
Vs java (1)Vs java (1)
Vs java (1)
 
RubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipelineRubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipeline
 
AWS Lambda Function with Kotlin
AWS Lambda Function with KotlinAWS Lambda Function with Kotlin
AWS Lambda Function with Kotlin
 
Hands on Gradle
Hands on GradleHands on Gradle
Hands on Gradle
 
React Component in scala.js
React Component in scala.jsReact Component in scala.js
React Component in scala.js
 
Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2
 
Apache Jackrabbit
Apache JackrabbitApache Jackrabbit
Apache Jackrabbit
 
RubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applicationsRubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applications
 
Rust meetup delhi nov 18
Rust meetup delhi nov 18Rust meetup delhi nov 18
Rust meetup delhi nov 18
 
Webservices: The RESTful Approach
Webservices: The RESTful ApproachWebservices: The RESTful Approach
Webservices: The RESTful Approach
 
Javantura v4 - Angular2 - Ionic2 - from birth to stable versions - Hrvoje Pek...
Javantura v4 - Angular2 - Ionic2 - from birth to stable versions - Hrvoje Pek...Javantura v4 - Angular2 - Ionic2 - from birth to stable versions - Hrvoje Pek...
Javantura v4 - Angular2 - Ionic2 - from birth to stable versions - Hrvoje Pek...
 
Spark Summit - Mobius C# Binding for Apache Spark
Spark Summit - Mobius C# Binding for Apache SparkSpark Summit - Mobius C# Binding for Apache Spark
Spark Summit - Mobius C# Binding for Apache Spark
 
Gr8conf - Griffon Update
Gr8conf - Griffon UpdateGr8conf - Griffon Update
Gr8conf - Griffon Update
 
ソーシャルゲームの課金認証共通基盤をどう設計したか
ソーシャルゲームの課金認証共通基盤をどう設計したかソーシャルゲームの課金認証共通基盤をどう設計したか
ソーシャルゲームの課金認証共通基盤をどう設計したか
 
The Holy Grail of continuous delivery in distributed teams environment
The Holy Grail of continuous delivery in distributed teams environmentThe Holy Grail of continuous delivery in distributed teams environment
The Holy Grail of continuous delivery in distributed teams environment
 
Scala ecosystem - Dublin Scala Meetup, Oct 2018
Scala ecosystem - Dublin Scala Meetup, Oct 2018Scala ecosystem - Dublin Scala Meetup, Oct 2018
Scala ecosystem - Dublin Scala Meetup, Oct 2018
 
C# 8 in Libraries and Applications
C# 8 in Libraries and ApplicationsC# 8 in Libraries and Applications
C# 8 in Libraries and Applications
 
Avoiding GraphQL insecurities with OWASP SKF - OWASP HU meetup
Avoiding GraphQL insecurities with OWASP SKF - OWASP HU meetupAvoiding GraphQL insecurities with OWASP SKF - OWASP HU meetup
Avoiding GraphQL insecurities with OWASP SKF - OWASP HU meetup
 

Similar to GraphQL over REST

Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayAmazon Web Services
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQLRodrigo Prates
 
RESTful web services with Groovy on Grails by Vugar Suleymanov
RESTful web services with Groovy on Grails by Vugar SuleymanovRESTful web services with Groovy on Grails by Vugar Suleymanov
RESTful web services with Groovy on Grails by Vugar SuleymanovVuqar Suleymanov
 
Kubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely togetherKubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely togetherEdward Wilde
 
GraphQL in an Age of REST
GraphQL in an Age of RESTGraphQL in an Age of REST
GraphQL in an Age of RESTYos Riady
 
GraphQL - The new "Lingua Franca" for API-Development
GraphQL - The new "Lingua Franca" for API-DevelopmentGraphQL - The new "Lingua Franca" for API-Development
GraphQL - The new "Lingua Franca" for API-Developmentjexp
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterSachin G Kulkarni
 
RESTful API-centric Universe
RESTful API-centric UniverseRESTful API-centric Universe
RESTful API-centric UniverseTihomir Opačić
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gatewayaws-marketing-il
 
Adriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI TalkAdriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI Talkaldur999
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIRasan Samarasinghe
 
YQL Publicis Hackday
YQL Publicis HackdayYQL Publicis Hackday
YQL Publicis HackdayPaul Donnelly
 
Use drupal 8 as a framework the romance recalibration
Use drupal 8 as a framework   the romance recalibrationUse drupal 8 as a framework   the romance recalibration
Use drupal 8 as a framework the romance recalibrationKevin Wenger
 
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...Atlassian
 
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...Atlassian
 
Neo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform OverviewNeo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform OverviewNeo4j
 
Prairie DevCon 2015 - Crafting Evolvable API Responses
Prairie DevCon 2015 - Crafting Evolvable API ResponsesPrairie DevCon 2015 - Crafting Evolvable API Responses
Prairie DevCon 2015 - Crafting Evolvable API Responsesdarrelmiller71
 
React native meetup 2019
React native meetup 2019React native meetup 2019
React native meetup 2019Arjun Kava
 

Similar to GraphQL over REST (20)

Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API Gateway
 
Graphql usage
Graphql usageGraphql usage
Graphql usage
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
RESTful web services with Groovy on Grails by Vugar Suleymanov
RESTful web services with Groovy on Grails by Vugar SuleymanovRESTful web services with Groovy on Grails by Vugar Suleymanov
RESTful web services with Groovy on Grails by Vugar Suleymanov
 
Kubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely togetherKubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely together
 
GraphQL in an Age of REST
GraphQL in an Age of RESTGraphQL in an Age of REST
GraphQL in an Age of REST
 
GraphQL - The new "Lingua Franca" for API-Development
GraphQL - The new "Lingua Franca" for API-DevelopmentGraphQL - The new "Lingua Franca" for API-Development
GraphQL - The new "Lingua Franca" for API-Development
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
 
RESTful API-centric Universe
RESTful API-centric UniverseRESTful API-centric Universe
RESTful API-centric Universe
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gateway
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
Adriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI TalkAdriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI Talk
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST API
 
YQL Publicis Hackday
YQL Publicis HackdayYQL Publicis Hackday
YQL Publicis Hackday
 
Use drupal 8 as a framework the romance recalibration
Use drupal 8 as a framework   the romance recalibrationUse drupal 8 as a framework   the romance recalibration
Use drupal 8 as a framework the romance recalibration
 
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
 
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
Extend Your Use of JIRA by Solving Your Unique Concerns: An Exposé of the New...
 
Neo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform OverviewNeo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform Overview
 
Prairie DevCon 2015 - Crafting Evolvable API Responses
Prairie DevCon 2015 - Crafting Evolvable API ResponsesPrairie DevCon 2015 - Crafting Evolvable API Responses
Prairie DevCon 2015 - Crafting Evolvable API Responses
 
React native meetup 2019
React native meetup 2019React native meetup 2019
React native meetup 2019
 

More from Bongwon Lee

DeprecatedAPI로 알아보는 SwiftUI
DeprecatedAPI로 알아보는 SwiftUIDeprecatedAPI로 알아보는 SwiftUI
DeprecatedAPI로 알아보는 SwiftUIBongwon Lee
 
Swift in SwiftUI
Swift in SwiftUISwift in SwiftUI
Swift in SwiftUIBongwon Lee
 
The Sandbox Container Directory
The Sandbox Container DirectoryThe Sandbox Container Directory
The Sandbox Container DirectoryBongwon Lee
 
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9Bongwon Lee
 
LetSwift 2017 - ARKit
LetSwift 2017 - ARKitLetSwift 2017 - ARKit
LetSwift 2017 - ARKitBongwon Lee
 
Realm, Mobile Database
Realm, Mobile DatabaseRealm, Mobile Database
Realm, Mobile DatabaseBongwon Lee
 
Custom Xcode Template (with VIPER)
Custom Xcode Template (with VIPER)Custom Xcode Template (with VIPER)
Custom Xcode Template (with VIPER)Bongwon Lee
 

More from Bongwon Lee (8)

DeprecatedAPI로 알아보는 SwiftUI
DeprecatedAPI로 알아보는 SwiftUIDeprecatedAPI로 알아보는 SwiftUI
DeprecatedAPI로 알아보는 SwiftUI
 
Swift in SwiftUI
Swift in SwiftUISwift in SwiftUI
Swift in SwiftUI
 
App Lifecycle
App LifecycleApp Lifecycle
App Lifecycle
 
The Sandbox Container Directory
The Sandbox Container DirectoryThe Sandbox Container Directory
The Sandbox Container Directory
 
Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9Simulator customizing & testing for Xcode 9
Simulator customizing & testing for Xcode 9
 
LetSwift 2017 - ARKit
LetSwift 2017 - ARKitLetSwift 2017 - ARKit
LetSwift 2017 - ARKit
 
Realm, Mobile Database
Realm, Mobile DatabaseRealm, Mobile Database
Realm, Mobile Database
 
Custom Xcode Template (with VIPER)
Custom Xcode Template (with VIPER)Custom Xcode Template (with VIPER)
Custom Xcode Template (with VIPER)
 

GraphQL over REST