SlideShare a Scribd company logo
Drupal as a Data
Server
Using Headless Drupal
First, a look at browsers
 Browsers work with HTML
 The browser makes a request to a URL
 The server returns HTML for that URL
 HTML contains both data and structure
 The browser interprets the HTML as a web page
Browser Makes
Request
Drupal generates
HTML
Browser interprets
HTML as web page
Headless Drupal
 Some application makes a request to a URL
 The URL returns data (no structure)
 JSON
 XML
 Plist
 etc
 The application processes the data
 Wraps it in HTML
 Saves it to a database
 Inserts it into a view in an app
 etc
App Makes
Request to Drupal
Drupal generates
Data
App processes
data
Using JavaScript frameworks
with Headless Drupal
 Initial HTML and JS is served from non-Drupal
application
 JavaScript requests data (JSON etc) from Drupal
 Javascript wraps response in HTML and inserts it to
browser
 Advantages:
 Can build applications not requiring page reloads
 Data transfer is pure data (JSON etc) without structure
(HTML), making data transfer much faster
 Disadvantages
 Need to make two systems work together (Drupal + other
system, ex Angular)
Using Mobile Apps with
Headless Drupal
 App holds all page structures
 App requests data (JSON etc) from Drupal
 Application inserts data into page structure
 Advantages (over mobile browser app):
 As page structure (layout, fonts etc) do not need to be
downloaded, apps are faster than a mobile website
 Disadvantages
 Often requires separate developer for apps
 Two systems need to be maintained
Drupal Process
 Drupal separates data generation from presentation
 When Drupal is used as a webserver, the generated
data is ‘wrapped’ in HTML
 When Drupal is used as a data server (ex REST
server) the data is ‘wrapped’ in a data format (JSON,
XML etc)
Drupal
generates
data
Browser App
Data wrapped
in HTML
Data wrapped in
JSON/XML/etc
Components of a data server
 Authentication
 The method to identify the user
 Oauth
 OAuth2 (used by Google, Twitter Instagram etc)
 Sessions
 Endpoint
 The URL from which data can be retrieved
 Resources
 Retrieve data or perform an action
 Response formatters
 JSON
 XML
 Plist
Drupal 7 – Services module
 The Services module is used to create data servers in Drupal 7
 Services 7.3 ships with:
 Servers
 REST
 XMLRPC
 Authentication
 OAuth
 Sessions
 Resources
 Multiple core resources – node, taxonomy, user etc
 Data Formatters
 Bencode
 JSON
 JSONP
 PHP
 XML
Drupal 7 – Services module
 Additional modules can be downloaded to extend
services. Some examples:
 Servers
 SOAP server (https://www.drupal.org/project/soap_server)
 Authentication
 OAuth2 (https://www.drupal.org/project/oauth2_server)
 Resources
 User points (https://www.drupal.org/project/userpoints)
 Data formatters
 REST Server plist
(https://www.drupal.org/project/rest_server_plist)
Extending Services
 hook_services_resources()
http://www.drupalcontrib.org/api/drupal/contributions!s
ervices!docs!services.services.api.php/function/hook_
services_resources/7
 Allows for adding new resources and actions
 Systems can provide custom data
Drupal 8 – Services is in core
 Drupal 8 ships with:
 HTTP Basic Authentication
 HTTP Authentication
 Username and Password sent as HTTP headers
 Cookie
 Uses cookies
Drupal 8 – Services is in core
 Drupal 8 ships with:
 RESTful Services (REST server)
Drupal 8 – Services is in core
 Drupal 8 ships with:
 HAL – provides HAL-JSON serialization
 Serialization
 Supports JSON and XML
 Additional methods provided through the Serialization
API
Thank you!
 Check out my podcast at https://www.sensei-and-the-
geek.com/

More Related Content

What's hot (20)

PPT
ADO CONTROLS - Database usage
Muralidharan Radhakrishnan
 
PPTX
Introduction to asp.net
neeta1995
 
PDF
Building a Web Template on The Ball / OIP
Kallex
 
PPTX
ASP.NET Lecture 4
Julie Iskander
 
PPT
Ado.net
dina1985vlr
 
PPTX
SharePoint and Open XML
Becky Bertram
 
PPT
For Beginers - ADO.Net
Snehal Harawande
 
KEY
Web Application SG
Jae Sung Park
 
PDF
JAM819 - Native API Deep Dive: Data Storage and Retrieval
Dr. Ranbijay Kumar
 
PPTX
SSIS control flow
Slava Kokaev
 
PPTX
Physical architecture of sql server
Divya Sharma
 
PPTX
Ado .net
Manish Singh
 
PPTX
Ado.Net Tutorial
prabhu rajendran
 
PPT
Session x(ado.net)
Shrijan Tiwari
 
PPT
Sql server basics
Dilfaroz Khan
 
PPT
Sql Server Basics
rainynovember12
 
PDF
Users as Data
pdingles
 
PPTX
ADO.NET Introduction
Yogendra Tamang
 
PPT
Sqllite
Senthil Kumar
 
PPTX
Chapter 3: ado.net
Ngeam Soly
 
ADO CONTROLS - Database usage
Muralidharan Radhakrishnan
 
Introduction to asp.net
neeta1995
 
Building a Web Template on The Ball / OIP
Kallex
 
ASP.NET Lecture 4
Julie Iskander
 
Ado.net
dina1985vlr
 
SharePoint and Open XML
Becky Bertram
 
For Beginers - ADO.Net
Snehal Harawande
 
Web Application SG
Jae Sung Park
 
JAM819 - Native API Deep Dive: Data Storage and Retrieval
Dr. Ranbijay Kumar
 
SSIS control flow
Slava Kokaev
 
Physical architecture of sql server
Divya Sharma
 
Ado .net
Manish Singh
 
Ado.Net Tutorial
prabhu rajendran
 
Session x(ado.net)
Shrijan Tiwari
 
Sql server basics
Dilfaroz Khan
 
Sql Server Basics
rainynovember12
 
Users as Data
pdingles
 
ADO.NET Introduction
Yogendra Tamang
 
Sqllite
Senthil Kumar
 
Chapter 3: ado.net
Ngeam Soly
 

Similar to Drupal as a data server (20)

PDF
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.
TechnocratAu
 
PDF
Drupal for Mobile
littleMAS
 
PDF
Drupal Is Not Your Web Site
Phase2
 
PDF
Drupal is not your Website
Phase2
 
PDF
Decoupled drupal DcRuhr
Ahmad Hassan
 
PDF
Drupal 7 and RDF
scorlosquet
 
PDF
RESTful with Drupal - in-s and out-s
Kalin Chernev
 
PDF
Building a Node.JS accelerator for your headless Drupal backend - DrupalCamp ...
Exove
 
KEY
Drupal 6 JavaScript and jQuery
Matt Butcher
 
PDF
Decoupled Drupal: What This Means for Developers
Acquia
 
PDF
Drupal Café: Building Node.js Accelerator for Your Headless Drupal
Exove
 
PPTX
Decoupled drupal
Ahmad Hassan
 
PPTX
Drupal Introduction - Why enterprises should use it
Manish Garg
 
PDF
Introduction to drupal
Pedro Cambra
 
PPTX
Headless Drupal
UniMitySolution
 
PPTX
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
DrupalCamp Kyiv
 
PDF
Drupal and RDF
scorlosquet
 
PDF
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
DrupalDay
 
ODP
PHPNW Drupal as a Framework
digital006
 
PDF
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Exove
 
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.
TechnocratAu
 
Drupal for Mobile
littleMAS
 
Drupal Is Not Your Web Site
Phase2
 
Drupal is not your Website
Phase2
 
Decoupled drupal DcRuhr
Ahmad Hassan
 
Drupal 7 and RDF
scorlosquet
 
RESTful with Drupal - in-s and out-s
Kalin Chernev
 
Building a Node.JS accelerator for your headless Drupal backend - DrupalCamp ...
Exove
 
Drupal 6 JavaScript and jQuery
Matt Butcher
 
Decoupled Drupal: What This Means for Developers
Acquia
 
Drupal Café: Building Node.js Accelerator for Your Headless Drupal
Exove
 
Decoupled drupal
Ahmad Hassan
 
Drupal Introduction - Why enterprises should use it
Manish Garg
 
Introduction to drupal
Pedro Cambra
 
Headless Drupal
UniMitySolution
 
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
DrupalCamp Kyiv
 
Drupal and RDF
scorlosquet
 
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
DrupalDay
 
PHPNW Drupal as a Framework
digital006
 
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Exove
 
Ad

Recently uploaded (20)

PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Digital Circuits, important subject in CS
contactparinay1
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Ad

Drupal as a data server

  • 1. Drupal as a Data Server Using Headless Drupal
  • 2. First, a look at browsers  Browsers work with HTML  The browser makes a request to a URL  The server returns HTML for that URL  HTML contains both data and structure  The browser interprets the HTML as a web page
  • 4. Headless Drupal  Some application makes a request to a URL  The URL returns data (no structure)  JSON  XML  Plist  etc  The application processes the data  Wraps it in HTML  Saves it to a database  Inserts it into a view in an app  etc
  • 5. App Makes Request to Drupal Drupal generates Data App processes data
  • 6. Using JavaScript frameworks with Headless Drupal  Initial HTML and JS is served from non-Drupal application  JavaScript requests data (JSON etc) from Drupal  Javascript wraps response in HTML and inserts it to browser  Advantages:  Can build applications not requiring page reloads  Data transfer is pure data (JSON etc) without structure (HTML), making data transfer much faster  Disadvantages  Need to make two systems work together (Drupal + other system, ex Angular)
  • 7. Using Mobile Apps with Headless Drupal  App holds all page structures  App requests data (JSON etc) from Drupal  Application inserts data into page structure  Advantages (over mobile browser app):  As page structure (layout, fonts etc) do not need to be downloaded, apps are faster than a mobile website  Disadvantages  Often requires separate developer for apps  Two systems need to be maintained
  • 8. Drupal Process  Drupal separates data generation from presentation  When Drupal is used as a webserver, the generated data is ‘wrapped’ in HTML  When Drupal is used as a data server (ex REST server) the data is ‘wrapped’ in a data format (JSON, XML etc)
  • 9. Drupal generates data Browser App Data wrapped in HTML Data wrapped in JSON/XML/etc
  • 10. Components of a data server  Authentication  The method to identify the user  Oauth  OAuth2 (used by Google, Twitter Instagram etc)  Sessions  Endpoint  The URL from which data can be retrieved  Resources  Retrieve data or perform an action  Response formatters  JSON  XML  Plist
  • 11. Drupal 7 – Services module  The Services module is used to create data servers in Drupal 7  Services 7.3 ships with:  Servers  REST  XMLRPC  Authentication  OAuth  Sessions  Resources  Multiple core resources – node, taxonomy, user etc  Data Formatters  Bencode  JSON  JSONP  PHP  XML
  • 12. Drupal 7 – Services module  Additional modules can be downloaded to extend services. Some examples:  Servers  SOAP server (https://www.drupal.org/project/soap_server)  Authentication  OAuth2 (https://www.drupal.org/project/oauth2_server)  Resources  User points (https://www.drupal.org/project/userpoints)  Data formatters  REST Server plist (https://www.drupal.org/project/rest_server_plist)
  • 14. Drupal 8 – Services is in core  Drupal 8 ships with:  HTTP Basic Authentication  HTTP Authentication  Username and Password sent as HTTP headers  Cookie  Uses cookies
  • 15. Drupal 8 – Services is in core  Drupal 8 ships with:  RESTful Services (REST server)
  • 16. Drupal 8 – Services is in core  Drupal 8 ships with:  HAL – provides HAL-JSON serialization  Serialization  Supports JSON and XML  Additional methods provided through the Serialization API
  • 17. Thank you!  Check out my podcast at https://www.sensei-and-the- geek.com/