SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Downloaden Sie, um offline zu lesen
GraphQL / RESTful
The dead RESTful API && Approach to Hypermedia
minayaleon@gmail.com
RESTful is dead?
if google says it then it is true.
or not?
minayaleon@gmail.com
Why?
• Requires many requests to obtain the necessary data in a view of our
application
• If the endpoint changes then the clients fall
• The error codes 2XX, 3XX, 4XX or 5XX are not used
• It does not have a formalized type system losing the power of tools
like Swagger to document
• REST is very old 
minayaleon@gmail.com
GraphQL
• It was created by Facebook
• Is a query language for APIs and for executing queries by using a type
system you define for your data
• Use a strong typing system
• It isn't tied to any specific database or storage engine and is instead
backed by your existing code and data.
minayaleon@gmail.com
Wait, I have a gift
minayaleon@gmail.com
minayaleon@gmail.com
Bad Decisions
minayaleon@gmail.com
1 2
RequirementsTools
Know your needs
minayaleon@gmail.com
1 2
Requirements Tools
Conclusions I
• Know your needs
• Know the tools
• Choose the best tool, choose it yourself
• No more “X is dead”
minayaleon@gmail.com
2018A look at the current state of the APIs &&
Web
minayaleon@gmail.com
Contracts
minayaleon@gmail.com
https://api.lifetap.com
- Native App Lifetap
- Web Lifetap
But…
• Change the endpoint
• Add new input parameters in the endpoints
• We launch a new version
• http://api.lifetap.com/v1, http://api.lifetap.com/v2
• More and more features
minayaleon@gmail.com
Broken Contracts
minayaleon@gmail.com
What should we do?...
minayaleon@gmail.com
And when can not?
Conclusions II
• We have forgotten the most important features of the web: Evolution
• The web has survived more than 30 years
• We must create Evolvable APIs
minayaleon@gmail.com
How to create APIs
designed to evolve?
minayaleon@gmail.com
RESTful Foundation
REST
Shared
Vocabularies
Hypermedia
Evolvable APIs
minayaleon@gmail.com
The Glory of REST
Martin Fowler
Hypermedia
But, it is not new 
minayaleon@gmail.com
Your project uses hypermedia
• But it is very limited
minayaleon@gmail.com
Hypermedia - Controls
Home
• One single URL (Home)
• The APIs are navigable
Types of controls
• How does an application
navigate?
• IANA define 80 types of links
• We can create more types
minayaleon@gmail.com
Hypermedia - IANA
Hypermedia
http://api.lifetap.com
The clients now can navigate
they don't need to know
others URLs
HATEOAS
minayaleon@gmail.com
Hypermedia
minayaleon@gmail.com
HAL
(Hypertext Application Language)
Hypermedia - Actions
minayaleon@gmail.com
Hypermedia – Actions
minayaleon@gmail.com
Siren
Specification for
representing entities
Shared Vocabularies
it is not new, either 
minayaleon@gmail.com
Shared Vocabularies
• Types and Properties
• screma.org has defined 600 types and 870 properties.
• We can create more types and properties
• The data models should not be exposed, they must be normalized.
• The clients should know the types and properties
minayaleon@gmail.com
Shared Vocabularies
minayaleon@gmail.com
Shared Vocabularies (Swagger &
OpenAPI)
minayaleon@gmail.com
Use Case: Convert MOV to MP4
API
192.168.5.67
Process
195.168.5.56
• Request
• Queries
• CRUD
• and more…
• Jobs
• Sync DB
• Video Convert
• CDN
https://proc.lifetap.com/upload-videohttps://api.lifetap.com/upload-video
SSH
1
2
minayaleon@gmail.com
RESTful
Real Application
minayaleon@gmail.com
minayaleon@gmail.com
Use nouns, no verbs.
Resource Name
• When we write code, we name the
methods with verbs that describe
their functionality. For example,
get_users or getUsers. This is fine in
the code. But it's also common in
URLs and it's not a good practice
• keep it simple
• The important is focus on the nouns
that describe each resource. Now, to
operate on our resource we will use
HTTP verbs.
Relations
• What happens when our
resources are related?
/getUsers, /getUserById, /createUser, /editUser
/users, /users/:id, /products, /orders
/orders/:id/products
/projects/:id/segments/:id/qualifications
minayaleon@gmail.com
Methods
HTTP Verbs CRUD Action
GET Read Use GET requests to retrieve resource representation/information
only
POST Create Use POST APIs to create new resources
PUT Update/Replace Use PUT APIs to update existing resource
PATCH Update/Modify HTTP PATCH requests are to make partial update on a resource
DELETE Delete As the name applies, DELETE APIs are used to delete resources
minayaleon@gmail.com
Errors Code
Code Description
200 OK
400 Bad Request
401 Unauthorized
404 Resource not found
500 Internal Server Error
minayaleon@gmail.com
Sources
• https://martinfowler.com/articles/richardsonMaturityModel.html
• https://swagger.io/specification/
• https://www.iana.org/assignments/link-relations/link-relations.xhtml
• https://schema.org
• http://stateless.co/hal_specification.html
• http://hyperschema.org/mediatypes/siren
• https://apigility.org/documentation/api-primer/halprimer
• https://platzi.com/blog/como-crear-apis/
minayaleon@gmail.com
minayaleon@gmail.com
https://www.linkedin.com/in/minayaleon
https://github.com/minayaleon
http://www.zend-rad.com
http://www.codepso.com
Thank You
minayaleon@gmail.com
Juan Minaya Leon

Weitere ähnliche Inhalte

Was ist angesagt?

App Store Rankings - iOS App Store ASO
App Store Rankings - iOS App Store ASOApp Store Rankings - iOS App Store ASO
App Store Rankings - iOS App Store ASO
Alexey Malafeev
 

Was ist angesagt? (20)

DCI - Free Seo Tools
DCI - Free Seo ToolsDCI - Free Seo Tools
DCI - Free Seo Tools
 
API Trends: What to expect in 2012
API Trends: What to expect in 2012API Trends: What to expect in 2012
API Trends: What to expect in 2012
 
apidays LIVE Paris - Exploring an API with Blocks by Larry Kluger
apidays LIVE Paris - Exploring an API with Blocks by Larry Klugerapidays LIVE Paris - Exploring an API with Blocks by Larry Kluger
apidays LIVE Paris - Exploring an API with Blocks by Larry Kluger
 
Sonja madsen speaker slides espc 2013
Sonja madsen speaker slides espc 2013Sonja madsen speaker slides espc 2013
Sonja madsen speaker slides espc 2013
 
React & GraphQL
React & GraphQLReact & GraphQL
React & GraphQL
 
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauretapidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
apidays LIVE Paris - The Augmented API Design Reviewer by Arnaud Lauret
 
In app search 1
In app search 1In app search 1
In app search 1
 
Practical Semantic Web
Practical Semantic WebPractical Semantic Web
Practical Semantic Web
 
Technical SEO Checklist for Beginners
Technical SEO Checklist for BeginnersTechnical SEO Checklist for Beginners
Technical SEO Checklist for Beginners
 
JSON API Standards
JSON API StandardsJSON API Standards
JSON API Standards
 
Visbility at the Edge - Deep Insights from Your API
 Visbility at the Edge - Deep Insights from Your API Visbility at the Edge - Deep Insights from Your API
Visbility at the Edge - Deep Insights from Your API
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
Real World Challenges in Enterprise Search
Real World Challenges in Enterprise SearchReal World Challenges in Enterprise Search
Real World Challenges in Enterprise Search
 
What’s the big deal with Graph Databases?
What’s the big deal with Graph Databases?What’s the big deal with Graph Databases?
What’s the big deal with Graph Databases?
 
Introducing Swagger
Introducing SwaggerIntroducing Swagger
Introducing Swagger
 
App Store Rankings - iOS App Store ASO
App Store Rankings - iOS App Store ASOApp Store Rankings - iOS App Store ASO
App Store Rankings - iOS App Store ASO
 
Mobile and Desktop SEO Audits - Rocks Digital Marketing Conference 2018
Mobile and Desktop SEO Audits - Rocks Digital Marketing Conference 2018Mobile and Desktop SEO Audits - Rocks Digital Marketing Conference 2018
Mobile and Desktop SEO Audits - Rocks Digital Marketing Conference 2018
 
Clickslide pitchdeck
Clickslide pitchdeckClickslide pitchdeck
Clickslide pitchdeck
 
SEO Audits - Performing a Technical SEO Audit from an Agency Perspective
SEO Audits - Performing a Technical SEO Audit from an Agency PerspectiveSEO Audits - Performing a Technical SEO Audit from an Agency Perspective
SEO Audits - Performing a Technical SEO Audit from an Agency Perspective
 
Getting your hands on graphs
Getting your hands on graphsGetting your hands on graphs
Getting your hands on graphs
 

Ähnlich wie GraphQL or RESTful

Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?
Akana
 

Ähnlich wie GraphQL or RESTful (20)

Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?
 
Write Generic Code with the Tooling API
Write Generic Code with the Tooling APIWrite Generic Code with the Tooling API
Write Generic Code with the Tooling API
 
Punta Dreamin 17 Generic Apex and Tooling Api
Punta Dreamin 17 Generic Apex and Tooling ApiPunta Dreamin 17 Generic Apex and Tooling Api
Punta Dreamin 17 Generic Apex and Tooling Api
 
Non-Relational Revolution: Database Week SF
Non-Relational Revolution: Database Week SFNon-Relational Revolution: Database Week SF
Non-Relational Revolution: Database Week SF
 
Netflix OSS and HATEOAS deployed on production - JavaLand
Netflix OSS and HATEOAS deployed on production - JavaLandNetflix OSS and HATEOAS deployed on production - JavaLand
Netflix OSS and HATEOAS deployed on production - JavaLand
 
Non-Relational Revolution
Non-Relational RevolutionNon-Relational Revolution
Non-Relational Revolution
 
Introduction to GraphQL (MOB316-R1) - AWS re:Invent 2018
Introduction to GraphQL (MOB316-R1) - AWS re:Invent 2018Introduction to GraphQL (MOB316-R1) - AWS re:Invent 2018
Introduction to GraphQL (MOB316-R1) - AWS re:Invent 2018
 
Automation in Jira for beginners
Automation in Jira for beginnersAutomation in Jira for beginners
Automation in Jira for beginners
 
Rapid mobile development using GraphQL and AWS AppSync
Rapid mobile development using GraphQL and AWS AppSyncRapid mobile development using GraphQL and AWS AppSync
Rapid mobile development using GraphQL and AWS AppSync
 
Liferay as a headless platform
Liferay as a headless platform  Liferay as a headless platform
Liferay as a headless platform
 
Building a REST API for Longevity
Building a REST API for LongevityBuilding a REST API for Longevity
Building a REST API for Longevity
 
Building Real-Time Serverless Backends with GraphQL
Building Real-Time Serverless Backends with GraphQLBuilding Real-Time Serverless Backends with GraphQL
Building Real-Time Serverless Backends with GraphQL
 
Designing Usable APIs featuring Forrester Research, Inc.
Designing Usable APIs featuring Forrester Research, Inc.Designing Usable APIs featuring Forrester Research, Inc.
Designing Usable APIs featuring Forrester Research, Inc.
 
Building Real-Time Serverless Backends with GraphQL | AWS Floor28
Building Real-Time Serverless Backends with GraphQL | AWS Floor28Building Real-Time Serverless Backends with GraphQL | AWS Floor28
Building Real-Time Serverless Backends with GraphQL | AWS Floor28
 
Portal and Intranets
Portal and Intranets Portal and Intranets
Portal and Intranets
 
SRV315 Building Enterprise-Grade Serverless Apps
 SRV315 Building Enterprise-Grade Serverless Apps SRV315 Building Enterprise-Grade Serverless Apps
SRV315 Building Enterprise-Grade Serverless Apps
 
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
 
REST and REST-fulness
REST and REST-fulnessREST and REST-fulness
REST and REST-fulness
 
Serverless beyond AWS Lambda
Serverless beyond AWS LambdaServerless beyond AWS Lambda
Serverless beyond AWS Lambda
 
Apex Connector for Lightning Connect - Make Anything a Salesforce object
Apex Connector for Lightning Connect - Make Anything a Salesforce objectApex Connector for Lightning Connect - Make Anything a Salesforce object
Apex Connector for Lightning Connect - Make Anything a Salesforce object
 

Mehr von Juan Victor Minaya León

Mehr von Juan Victor Minaya León (9)

Software Development
Software DevelopmentSoftware Development
Software Development
 
Software Development with PHP & Laravel
Software Development  with PHP & LaravelSoftware Development  with PHP & Laravel
Software Development with PHP & Laravel
 
Git / Guía Básica
Git / Guía BásicaGit / Guía Básica
Git / Guía Básica
 
Desarrollo de Software 2013
Desarrollo de Software 2013Desarrollo de Software 2013
Desarrollo de Software 2013
 
Propuesta Arquitectura de Mensajería con Xmpp
Propuesta Arquitectura de Mensajería con XmppPropuesta Arquitectura de Mensajería con Xmpp
Propuesta Arquitectura de Mensajería con Xmpp
 
Gestión de Incidencias con Mantis BT
Gestión de Incidencias con Mantis BTGestión de Incidencias con Mantis BT
Gestión de Incidencias con Mantis BT
 
Desarrollo de Software
Desarrollo de SoftwareDesarrollo de Software
Desarrollo de Software
 
Desarrollo para dispositivos Móviles
Desarrollo para dispositivos MóvilesDesarrollo para dispositivos Móviles
Desarrollo para dispositivos Móviles
 
Guía de buenas prácticas para desarrolladores web
Guía de buenas prácticas para desarrolladores webGuía de buenas prácticas para desarrolladores web
Guía de buenas prácticas para desarrolladores web
 

Kürzlich hochgeladen

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Kürzlich hochgeladen (20)

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...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
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
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
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...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%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
 
%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
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 

GraphQL or RESTful