SlideShare a Scribd company logo
REST in pieces
REST in pieces
Semiserious comparison of modern approaches
~$ whoami ↩
Paolo “Stick” Pustorino
#stickgrinder (almost everywhere)
CEO / COO @ SparkFabrik Srl
DRUMMER @ A couple of metal bands m/_
WIZARD @ Cormyr’s Royal Court
FATHER @ Casamia
ANCHE @ Basta
~$ ls -alh ↩
What makes a great API
Which tools are available
Use-cases showdown
~$ iostat ↩
Completeness
Fairness
Experience
Substance
Openness
Lolcatz
*****
*****
*****
*****
*****
*****
REST in pieces
REST in pieces
A cut above the
REST
What makes you API really stand out?
(from my perspective)
~$ curl -i -X GET https://stick.says/api-rules/1 ↩
URI should be nouns, not verbs
Verbs are already hard-coded in HTTP (GET, POST, …) so help yourself with
sensible semantics.
/cars
/users
/books/{id}
/getAllCars
/userRemove
/books/{id}/remove
~$ curl -i -X GET https://stick.says/api-rules/2 ↩
Never alter the state by GETs
We are not talking quantum physics, so you can observe things without changing their status!
HTTP supports state-alteration verbs. Use ‘em!
POST /cars
DELETE /users/{uid}
PUT /books/{id}
GET /addCar
GET /userRemove
GET /books/{id}/update
~$ curl -i -X GET https://stick.says/api-rules/3 ↩
Don’t mix plurals and singulars
Don’t try to exaggerate semantics expressivity, keep things simple and use plurals.
GET /users
DELETE /users/{id}
POST /users/{id}/reviews
GET /users
(right but inconsistent with the following)
DELETE /user/{id}
POST /user/{id}/review
~$ curl -i -X GET https://stick.says/api-rules/4 ↩
Use sub-resources as relational maps
Resource relations can be seen as ownership: hierarchical mapping helps here.
GET /users/{uid}/reviews
PUT /users/{uid}/reviews/{rid}
GET /reviews?byUser={uid}
PUT /userReviews/{rid}
~$ curl -i -X GET https://stick.says/api-rules/5 ↩
Specify formats in HTTP headers
Exchange format information in HTTP headers and leave other means alone to avoid confusion
and messing with priorities.
Content-Type : application/json
Accept : text/xml
PUT /reviews.json
GET /reviews?format=xml
~$ curl -i -X GET https://stick.says/api-rules/6 ↩
Caching is built-in HTTP
You can save traffic and help frontend applications deliver light-speed experience with HTTP
caching strategies. Server-to-server connections can benefit too.
Etag
Vary
Cache-Control
Proxy-Revalidate
max-age
(not a silver bullet)
no-cache
(implement proper invalidation instead)
~$ curl -i -X GET https://stick.says/api-rules/7 ↩
Collections should be filterable, sortable and pageable
That’s what query parameters are there for! Be creative and use powerful expressions.
GET /users?sort=-age,+name
GET /users/{uid}/reviews?rate>=3&published=1
GET /books?format=[epub,mobi]
GET /users?sortAsc=name&sortDesc=age
GET /userReviews?uid={uid}&rate>=3
GET /books?format=epub&format=mobi
~$ curl -i -X GET https://stick.says/api-rules/8 ↩
Version your API
Or kittens will die en-masse on a per-request basis!
Really, you can break outdated consumers if you don’t.
GET /v1/users?sort=-age,+name
POST api.v2.stick.says/users
GET /users?format=old
POST /users?format=2017
~$ curl -i -X GET https://stick.says/api-rules/9 ↩
Return meaningful status codes
HTTP status codes are to machines what error payloads are to humans. Use both and don’t return
meaningless 200 OK all around.
401 UNAUTHORIZED
{
"errors": [
{
"user_msg": "You shall nooot paaass!!!",
"internal_msg": "Balrogs are not welcome",
"code": 666,
“info": "http://stick.says/docs/v1/errors/666"
}
]
}
200 OK
{
“status” : “error”,
"user_msg": "You shall nooot paaass!!!",
"internal_msg": "Balrogs are not welcome",
"code": 666,
“info": "http://stick.says/docs/v1/errors/666"
}
~$ curl -i -X GET https://stick.says/api-rules/10 ↩
Support modern authorization methods
Allow apps and services to act on behalf of users with clear scopes and tough security. Remember
authentication and authorization are not the same!
Oauth2
JWT-Tokens
Client credentials
Basic-Auth (acceptable for S2S)
Session handling
REST
assured
Which options are available?
The Drupal way
~$ cat DRUPAL_WAY.txt | grep “pros” ↩
Drupal is finally PHP
REST is almost built-in (REST UI module helps if you like admin UIs)
Pervasive HATEOAS support via HAL
Leverages Symfony’s HTTP exceptions
Resource editing backend comes free
Views are natively RESTful
~$ cat DRUPAL_WAY.txt | grep “cons” ↩
Role-based permissions are not handled by middleware (@FIXME)
No PUTs, just PATCHes (really…)
Can’t do without HATEOAS / HAL (bloated output)
Its endpoint mapping is not ideal
RESTful Views are naive
Heavy bootstrap times
Still hard to integrate continuously
Full-stack frameworks
~$ cat FULLSTACK_FW.txt | grep “pros” ↩
Tailored persistence layer
Complex logic is often easy to implement
Small footprint
Easier multi-environment workflow (you only depend on code)
Continuous integration is a gas
Great cross-framework packages and extensions
~$ cat FULLSTACK_FW.txt | grep “cons” ↩
You may have to implement authentication by yourself
No built-in backoffice for resource management
You have to write all by yourself (even CRUD)
Boilerplate / redundant code across projects
Codebase policies / opinionation is often up to you
~$ cat FULLSTACK_FW.txt | grep “opts” ↩
Laravel / Lumen
Symfony 2/3 / Silex
Lithium (yes, still a good option if you don’t mind getting your hands dirty)
Slim and the like
Dedicated frameworks
~$ cat DEDICATED_FW.txt | grep “pros” ↩
All the pros of full-stack frameworks
Highly opinionated approach
Out-of-the-box support for most REST-related aspects (auth/auth, status-code
mapping, rate-limiting, versioning, format negotiation, etc)
Automatic API documentation generation
~$ cat DEDICATED_FW.txt | grep “cons” ↩
Smaller userbase / community
Few contribution, rely heavily on the shoulder of single maintainers
Risk to end up drowned in a fish bowl
* not that true for Dingo and not that issue for PHP Platform
~$ cat DEDICATED_FW.txt | grep “opts” ↩
API Platform
Dingo API (awesome package for Laravel and Lumen)
Epiphany
Recess PHP
API generation platforms
~$ cat API_PLATFORMS.txt | grep “pros” ↩
Make creating basic (and complex) APIs a breeze
Accessible to non-developers (or better said, frontend developers)
Make you focus on frontend application
Provide basic content management features
Generates API documentation
Pretty easy to scale with native cloud-oriented mindset
(often) Generates client SDKs (even for a number of platforms)
~$ cat API_PLATFORMS.txt | grep “cons” ↩
Logic is in configuration, not code (much like Drupal)
Smaller communities than Drupal
Higher vendor lock-in
Hard to use in team (not friendly to multi-environment workflows)
Suboptimal deployment to production
Rely on older PHP/FW versions
~$ cat API_PLATFORMS.txt | grep “opts” ↩
DreamFactory API Automation Platform (written in Laravel)
Zend Apigility
FRAPI
deployd (it’s node.js, not PHP, but it’s really good!)
put yourself to
REST
What to chose for you next API?
~$ diff use_cases..drupal_8 ↩
Use Drupal 8 when...
You are exposing actual content via REST API
Your business logic is already on Drupal and REST becomes a necessary addition
Some specific feature of Drupal, unrelated to REST makes it the best candidate for
your project (and you can bear with the… rest, er…)
~$ diff use_cases..fullstack_fw ↩
Use a full-stack framework when...
You need fluid teamwork, multi-env workflow, fast testing, etc.
You want hassle-free Continuous Integration and Deploy
Your application has lot of custom functions aside “editorial” content management
You want to swim in the ocean, not a bathtub
You must provide enterprise-class support on the long term
~$ diff use_cases..dedicated_fw ↩
Use a dedicated framework when...
You want to speed up development, leveraging good boilerplate code
You want hassle-free Continuous Integration and Deploy
Your application is bound to remain a REST API
You don’t mind getting your hand dirty (smaller community)
You can afford supporting yourself on the long term (yes, even forking the framework)
~$ diff use_cases..api_platforms ↩
Use an API platform when...
You want to speed up development, leveraging easy low-coding tools
Your focus is on thick frontend application
You are akin to pay for managed cloud services
Heavy teamwork on the backend is not in sight
You don’t mind locking to vendors
give it a
REST!
Enough blah blah blah...
Wanna chat?
THANKS
REST in pieces

More Related Content

PPT
20110606 e z_flow_gig_v1
TXT
Readme
PDF
Drupal 8 Theme System: The Backend of Frontend
PPTX
Php basics
PPTX
Cake PHP 3 Presentaion
PPT
PPT
PPTX
System performance tuning
20110606 e z_flow_gig_v1
Readme
Drupal 8 Theme System: The Backend of Frontend
Php basics
Cake PHP 3 Presentaion
System performance tuning

What's hot (19)

PDF
Active Record Introduction - 3
KEY
Drupal Meetup Lisbon
PPTX
Debugging in drupal 8
PDF
Rails ORM De-mystifying Active Record has_many
PDF
Boosting MongoDB performance
PDF
StORM preview
PDF
Lumberjack XPath 101
PPT
Wordpress install setup
PDF
Hidden gems in Apache Jackrabbit and BloomReach Forge
PPTX
PHP presentation - Com 585
PDF
lab56_db
PDF
Scaling in Mind (Case study of Drupal Core)
PDF
Mojo Facets – so, you have data and browser?
ODP
EXPath: the packaging system and the webapp framework
PDF
Codeigniter : Using Third Party Components - Zend Framework Components
TXT
Install
PPTX
CouchDb
ODP
My sql
PDF
Introduction to Drupal - Installation, Anatomy, Terminologies
Active Record Introduction - 3
Drupal Meetup Lisbon
Debugging in drupal 8
Rails ORM De-mystifying Active Record has_many
Boosting MongoDB performance
StORM preview
Lumberjack XPath 101
Wordpress install setup
Hidden gems in Apache Jackrabbit and BloomReach Forge
PHP presentation - Com 585
lab56_db
Scaling in Mind (Case study of Drupal Core)
Mojo Facets – so, you have data and browser?
EXPath: the packaging system and the webapp framework
Codeigniter : Using Third Party Components - Zend Framework Components
Install
CouchDb
My sql
Introduction to Drupal - Installation, Anatomy, Terminologies
Ad

Similar to REST in pieces (20)

PDF
Don't screw it up! How to build durable API
PDF
Алексей Веркеенко "Symfony2 & REST API"
PDF
Design Web Api
PDF
REST API Basics
PDF
Building RESTful APIs
PPTX
REST-API introduction for developers
PPTX
Real world RESTful service development problems and solutions
PDF
Building Awesome APIs with Lumen
PPTX
A Deep Dive into RESTful API Design Part 2
PDF
Создание API, которое полюбят разработчики. Глубокое погружение
PDF
REST API Recommendations
PDF
Designing RESTful APIs
PDF
PDF
Introduction to REST - REST Basics - JSON
PPTX
RESTful Services
PPT
RESTful SOA - 中科院暑期讲座
PDF
What is REST?
PDF
Why Laravel is the Best Choice for Developing RESTful APIs?
PPTX
Rest APIs Training
PPTX
Standards of rest api
Don't screw it up! How to build durable API
Алексей Веркеенко "Symfony2 & REST API"
Design Web Api
REST API Basics
Building RESTful APIs
REST-API introduction for developers
Real world RESTful service development problems and solutions
Building Awesome APIs with Lumen
A Deep Dive into RESTful API Design Part 2
Создание API, которое полюбят разработчики. Глубокое погружение
REST API Recommendations
Designing RESTful APIs
Introduction to REST - REST Basics - JSON
RESTful Services
RESTful SOA - 中科院暑期讲座
What is REST?
Why Laravel is the Best Choice for Developing RESTful APIs?
Rest APIs Training
Standards of rest api
Ad

More from sparkfabrik (20)

PDF
Talks on my machine: Drupal, Storybook e SDC
PDF
Talks on my machine: Drupal CMS versus The Cool Kids
PDF
Talks on my machine: Drupal: AI e Typesense come integrare la ricerca semantica
PDF
KCD Italy 2023 - Secure Software Supply chain for OCI Artifact on Kubernetes
PDF
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
PDF
IAD 2023 - 22 Years of Agile and all I got is this lousy t-shirt
PDF
2023 - Drupalcon - How Drupal builds your pages
PDF
2023 - TAC23 - Agile HR - Racconti dal fronte
PDF
CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cl...
PDF
What is the Secure Supply Chain and the Current State of the PHP Ecosystem
PDF
UX e Web sostenibile (UXday 2023).pdf
PDF
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
PDF
Deep dive nella supply chain della nostra infrastruttura cloud
PDF
KCD Italy 2022 - Application driven infrastructure with Crossplane
PDF
Come Drupal costruisce le tue pagine
PDF
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
PDF
Do you know what your Drupal is doing Observe it! (DrupalCon Prague 2022)
PPTX
Do you know what your Drupal is doing_ Observe it!
PDF
Progettare e sviluppare soluzioni serverless con AWS
PPTX
From React to React Native - Things I wish I knew when I started
Talks on my machine: Drupal, Storybook e SDC
Talks on my machine: Drupal CMS versus The Cool Kids
Talks on my machine: Drupal: AI e Typesense come integrare la ricerca semantica
KCD Italy 2023 - Secure Software Supply chain for OCI Artifact on Kubernetes
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
IAD 2023 - 22 Years of Agile and all I got is this lousy t-shirt
2023 - Drupalcon - How Drupal builds your pages
2023 - TAC23 - Agile HR - Racconti dal fronte
CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cl...
What is the Secure Supply Chain and the Current State of the PHP Ecosystem
UX e Web sostenibile (UXday 2023).pdf
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
Deep dive nella supply chain della nostra infrastruttura cloud
KCD Italy 2022 - Application driven infrastructure with Crossplane
Come Drupal costruisce le tue pagine
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
Do you know what your Drupal is doing Observe it! (DrupalCon Prague 2022)
Do you know what your Drupal is doing_ Observe it!
Progettare e sviluppare soluzioni serverless con AWS
From React to React Native - Things I wish I knew when I started

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation theory and applications.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPT
Teaching material agriculture food technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Electronic commerce courselecture one. Pdf
20250228 LYD VKU AI Blended-Learning.pptx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The AUB Centre for AI in Media Proposal.docx
Encapsulation theory and applications.pdf
A Presentation on Artificial Intelligence
Encapsulation_ Review paper, used for researhc scholars
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Per capita expenditure prediction using model stacking based on satellite ima...
Teaching material agriculture food technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

REST in pieces

  • 2. REST in pieces Semiserious comparison of modern approaches
  • 3. ~$ whoami ↩ Paolo “Stick” Pustorino #stickgrinder (almost everywhere) CEO / COO @ SparkFabrik Srl DRUMMER @ A couple of metal bands m/_ WIZARD @ Cormyr’s Royal Court FATHER @ Casamia ANCHE @ Basta
  • 4. ~$ ls -alh ↩ What makes a great API Which tools are available Use-cases showdown
  • 8. A cut above the REST What makes you API really stand out? (from my perspective)
  • 9. ~$ curl -i -X GET https://stick.says/api-rules/1 ↩ URI should be nouns, not verbs Verbs are already hard-coded in HTTP (GET, POST, …) so help yourself with sensible semantics.
  • 11. ~$ curl -i -X GET https://stick.says/api-rules/2 ↩ Never alter the state by GETs We are not talking quantum physics, so you can observe things without changing their status! HTTP supports state-alteration verbs. Use ‘em!
  • 12. POST /cars DELETE /users/{uid} PUT /books/{id} GET /addCar GET /userRemove GET /books/{id}/update
  • 13. ~$ curl -i -X GET https://stick.says/api-rules/3 ↩ Don’t mix plurals and singulars Don’t try to exaggerate semantics expressivity, keep things simple and use plurals.
  • 14. GET /users DELETE /users/{id} POST /users/{id}/reviews GET /users (right but inconsistent with the following) DELETE /user/{id} POST /user/{id}/review
  • 15. ~$ curl -i -X GET https://stick.says/api-rules/4 ↩ Use sub-resources as relational maps Resource relations can be seen as ownership: hierarchical mapping helps here.
  • 16. GET /users/{uid}/reviews PUT /users/{uid}/reviews/{rid} GET /reviews?byUser={uid} PUT /userReviews/{rid}
  • 17. ~$ curl -i -X GET https://stick.says/api-rules/5 ↩ Specify formats in HTTP headers Exchange format information in HTTP headers and leave other means alone to avoid confusion and messing with priorities.
  • 18. Content-Type : application/json Accept : text/xml PUT /reviews.json GET /reviews?format=xml
  • 19. ~$ curl -i -X GET https://stick.says/api-rules/6 ↩ Caching is built-in HTTP You can save traffic and help frontend applications deliver light-speed experience with HTTP caching strategies. Server-to-server connections can benefit too.
  • 20. Etag Vary Cache-Control Proxy-Revalidate max-age (not a silver bullet) no-cache (implement proper invalidation instead)
  • 21. ~$ curl -i -X GET https://stick.says/api-rules/7 ↩ Collections should be filterable, sortable and pageable That’s what query parameters are there for! Be creative and use powerful expressions.
  • 22. GET /users?sort=-age,+name GET /users/{uid}/reviews?rate>=3&published=1 GET /books?format=[epub,mobi] GET /users?sortAsc=name&sortDesc=age GET /userReviews?uid={uid}&rate>=3 GET /books?format=epub&format=mobi
  • 23. ~$ curl -i -X GET https://stick.says/api-rules/8 ↩ Version your API Or kittens will die en-masse on a per-request basis! Really, you can break outdated consumers if you don’t.
  • 24. GET /v1/users?sort=-age,+name POST api.v2.stick.says/users GET /users?format=old POST /users?format=2017
  • 25. ~$ curl -i -X GET https://stick.says/api-rules/9 ↩ Return meaningful status codes HTTP status codes are to machines what error payloads are to humans. Use both and don’t return meaningless 200 OK all around.
  • 26. 401 UNAUTHORIZED { "errors": [ { "user_msg": "You shall nooot paaass!!!", "internal_msg": "Balrogs are not welcome", "code": 666, “info": "http://stick.says/docs/v1/errors/666" } ] } 200 OK { “status” : “error”, "user_msg": "You shall nooot paaass!!!", "internal_msg": "Balrogs are not welcome", "code": 666, “info": "http://stick.says/docs/v1/errors/666" }
  • 27. ~$ curl -i -X GET https://stick.says/api-rules/10 ↩ Support modern authorization methods Allow apps and services to act on behalf of users with clear scopes and tough security. Remember authentication and authorization are not the same!
  • 31. ~$ cat DRUPAL_WAY.txt | grep “pros” ↩ Drupal is finally PHP REST is almost built-in (REST UI module helps if you like admin UIs) Pervasive HATEOAS support via HAL Leverages Symfony’s HTTP exceptions Resource editing backend comes free Views are natively RESTful
  • 32. ~$ cat DRUPAL_WAY.txt | grep “cons” ↩ Role-based permissions are not handled by middleware (@FIXME) No PUTs, just PATCHes (really…) Can’t do without HATEOAS / HAL (bloated output) Its endpoint mapping is not ideal RESTful Views are naive Heavy bootstrap times Still hard to integrate continuously
  • 34. ~$ cat FULLSTACK_FW.txt | grep “pros” ↩ Tailored persistence layer Complex logic is often easy to implement Small footprint Easier multi-environment workflow (you only depend on code) Continuous integration is a gas Great cross-framework packages and extensions
  • 35. ~$ cat FULLSTACK_FW.txt | grep “cons” ↩ You may have to implement authentication by yourself No built-in backoffice for resource management You have to write all by yourself (even CRUD) Boilerplate / redundant code across projects Codebase policies / opinionation is often up to you
  • 36. ~$ cat FULLSTACK_FW.txt | grep “opts” ↩ Laravel / Lumen Symfony 2/3 / Silex Lithium (yes, still a good option if you don’t mind getting your hands dirty) Slim and the like
  • 38. ~$ cat DEDICATED_FW.txt | grep “pros” ↩ All the pros of full-stack frameworks Highly opinionated approach Out-of-the-box support for most REST-related aspects (auth/auth, status-code mapping, rate-limiting, versioning, format negotiation, etc) Automatic API documentation generation
  • 39. ~$ cat DEDICATED_FW.txt | grep “cons” ↩ Smaller userbase / community Few contribution, rely heavily on the shoulder of single maintainers Risk to end up drowned in a fish bowl * not that true for Dingo and not that issue for PHP Platform
  • 40. ~$ cat DEDICATED_FW.txt | grep “opts” ↩ API Platform Dingo API (awesome package for Laravel and Lumen) Epiphany Recess PHP
  • 42. ~$ cat API_PLATFORMS.txt | grep “pros” ↩ Make creating basic (and complex) APIs a breeze Accessible to non-developers (or better said, frontend developers) Make you focus on frontend application Provide basic content management features Generates API documentation Pretty easy to scale with native cloud-oriented mindset (often) Generates client SDKs (even for a number of platforms)
  • 43. ~$ cat API_PLATFORMS.txt | grep “cons” ↩ Logic is in configuration, not code (much like Drupal) Smaller communities than Drupal Higher vendor lock-in Hard to use in team (not friendly to multi-environment workflows) Suboptimal deployment to production Rely on older PHP/FW versions
  • 44. ~$ cat API_PLATFORMS.txt | grep “opts” ↩ DreamFactory API Automation Platform (written in Laravel) Zend Apigility FRAPI deployd (it’s node.js, not PHP, but it’s really good!)
  • 45. put yourself to REST What to chose for you next API?
  • 46. ~$ diff use_cases..drupal_8 ↩ Use Drupal 8 when... You are exposing actual content via REST API Your business logic is already on Drupal and REST becomes a necessary addition Some specific feature of Drupal, unrelated to REST makes it the best candidate for your project (and you can bear with the… rest, er…)
  • 47. ~$ diff use_cases..fullstack_fw ↩ Use a full-stack framework when... You need fluid teamwork, multi-env workflow, fast testing, etc. You want hassle-free Continuous Integration and Deploy Your application has lot of custom functions aside “editorial” content management You want to swim in the ocean, not a bathtub You must provide enterprise-class support on the long term
  • 48. ~$ diff use_cases..dedicated_fw ↩ Use a dedicated framework when... You want to speed up development, leveraging good boilerplate code You want hassle-free Continuous Integration and Deploy Your application is bound to remain a REST API You don’t mind getting your hand dirty (smaller community) You can afford supporting yourself on the long term (yes, even forking the framework)
  • 49. ~$ diff use_cases..api_platforms ↩ Use an API platform when... You want to speed up development, leveraging easy low-coding tools Your focus is on thick frontend application You are akin to pay for managed cloud services Heavy teamwork on the backend is not in sight You don’t mind locking to vendors
  • 50. give it a REST! Enough blah blah blah...