SlideShare a Scribd company logo
Building a Node.JS
accelerator for your
headless Drupal backend
Kalle Varisvirta @kvirta
Technology Director
Exove @exove
Pre-requisites
Moderate understanding of PHP and Javascript
Moderate understanding of Drupal’s internals
Some idea of how NoSQL, SOLR and Varnish work
What you’ll learn
What’s headless Drupal
Why use headless Drupal
How to speed up headless Drupal content delivery with
Node.JS in real life
Why to speed up Drupal content delivery with Node.JS
About me
Kalle Varisvirta
Technology Director at Exove
Exove is a technology company based in Finland,
Estonia and UK with over 70 professionals
So, what’s a
headless
Drupal?
Drupal
Typically Drupal gets a
HTTP request and responds
with an HTML page
Theming is done in Drupal
No front-end framework is
used
Drupal
User
Headless Drupal
When you add a front-end
framework and let it do the
theming, you get headless
Drupal
Drupal will then deliver
content in JSON
Drupal
User
Front-end framework
Why headless Drupal?
If you want full control over the display of your content
If you want to create a app-like experience
If you want to create an app :-)
Why not headless 

Drupal?
More manual labor than regular Drupal
Half of Drupal’s functionality is ignored, as it won’t
affect how the content is displayed
Headless Drupal
App, you say?
When just delivering
content, Drupal doesn’t care
what happens downstream
Drupal
iOS
app
Android
app
Smart TV
app
Drupal
site
Headless Drupal
Drupal is delivering content
in JSON via HTTP, so
caching is a valid option for
anonymous users
Using a Varnish layer to
cache the JSON will make
your site fast enough for
most setups
Drupal
Varnish
iOS
app
Android
app
Smart TV
app
Drupal
site
Authenticated users
Authenticated users in Drupal, especially with long
content listings from Views, makes things complicated
If you have a lot of authenticated users concurrently
using your headless Drupal, you’ll be in trouble fast
Solution
The architecture
Drupal content is
indexed on every
change using the
MongoDB indexer
module 

(drupal.org/project/
mongodb_indexer)
We’re using MongoDB
here as a storage
We could be using any
NoSQL, including
search platforms like
Elasticsearch or Apache
SOLR
We prefer a real
database for fast
indexing
For delivery, we opt for
Node.JS
A framework like
Express or Koa is
suggested for better
structure
A deeper

look
Drupal
Focusing solely in content management, not delivering
any web pages outside the admin
MongoDB
indexer
MongoDB indexer is
just a small module we
created to index
Drupal’s content
outside, without
interfering the storage
engine of Drupal
MongoDB
indexer
MongoDB indexer is
just a small module we
created to index
Drupal’s content
outside, without
interfering the storage
engine of Drupal
MongoDB
We chose MongoDB over other NoSQL systems due
to the popularity and fast development
It’s had its issues, but they’ve fixed them all
Now expecting Wired Tiger storage engine that’ll
improve the locking mechanism
Delivery
We have optimized data in the MongoDB
We want to deliver it out, fast
We want to be able to do some logic while delivering it
Node.JS
Node.JS is Javascript running on the server
The Javascript is ran by Chrome’s Javascript engine,
the V8
It’s non-blocking, event-based and when used
correctly, blazing fast
RPS Avg response time
Drupal
Node.JS
Node.JS
Cluster (npm module)
Forever (npm module)
Node.JS frameworks
Express
Koa
Node.JS
For a PHP programmer, it’s quite a change
Due to the you need to understand parallel
programming
There are npm modules there to help with that, too
During the lifetime our big project (24 months) both
Node.JS and MongoDB have evolved quite a bit
Node.JS
The code is very simple as it’s mostly just passing
information out from the MongoDB
If you’re building a REST api, as you should, you can
add filters to the calls and pass them on to the
MongoDB
But… you can also check for user session and fetch
user-related content
REST API
REST API allows writing, too, so you’ll have to handle
the writes
Most of writing in these cases are left to the Node
app -level
Obviously, writes reaching the Drupal are also
possible
Real world 

case?
Video platform project
Started three years ago
Started as a headless Drupal project
Originally was supposed to feed content straight from
Drupal
Drupal optimizations
It’s not like we didn’t think of the performance early on
The Drupal 7 was built on MongoDB field storage and
thus standing on a fast database
The Views feeds (JSON) were coming from SOLR
backend
Caching feeds
Downstream clients want integration feeds limited by
time
Time attribute by seconds of the last fetch
To deal with existing content
To deal with changed content
We tried to cache to Varnish, it didn’t work at all
We need a new approach
Indexing outside of Drupal felt like the only way out
First we decided we’ll go with SOLR via ApacheSOLR
integration
Distribution by a simple REST API
Later on, we wrote the MongoDB indexer and switched
to MongoDB fully
Video content management
system
(Drupal 7)
Linear television
data 

(ERP)
Drupal 7 site
Drupal 7 site
Wordpress site
iOS app
Android app
Samsung
SmartTV app
MongoDB and Node.JS
RESTAPI
Indexing is done using a
Drupal module, MongoDB
indexer
Recap
Recap
Headless Drupal is when you use Drupal only for the
data and theme/display somewhere else
Headless Drupal needs performance that Drupal might
not be able to provide
MongoDB indexer will index your Drupal entities to
MongoDB
From MongoDB, it’s easy to distribute your data with
Node.JS and enjoy the high performance
Thank you!
Questions?

More Related Content

What's hot (20)

PDF
Drupal 8 Configuration Management
Exove
 
PDF
Keystone.js 101
Alexander Roche
 
PDF
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
Exove
 
PDF
CQ5 and Sling overview
Bertrand Delacretaz
 
PDF
Caching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Acquia
 
PPTX
Using MAMP for Web Development
Eric Greene
 
PDF
Tech Stack Ideas
nsclark
 
PDF
Moving from PHP to a nodejs full stack CMS
Make & Build
 
PDF
Everything You Need to Know About the Top Changes in Drupal 8
Acquia
 
PDF
Adobe AEM for Business Heads
Yash Mody
 
PPTX
A Minimalist’s Attempt at Building a Distributed Application
David Hoerster
 
PDF
Node js projects
💾 Radek Fabisiak
 
PPTX
MEAN Stack
RoshanTak1
 
PPTX
Catch 22: FLex APps
Yash Mody
 
PPTX
Mern stack developement
kalyankumar836878
 
PDF
Node js (runtime environment + js library) platform
Sreenivas Kappala
 
PPTX
Iconus 2016
Mark Roden
 
PDF
Become a Better Developer with Debugging Techniques for Drupal (and more!)
Acquia
 
PDF
MEAN Stack WeNode Barcelona Workshop
Valeri Karpov
 
PPTX
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB
 
Drupal 8 Configuration Management
Exove
 
Keystone.js 101
Alexander Roche
 
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
Exove
 
CQ5 and Sling overview
Bertrand Delacretaz
 
Caching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Acquia
 
Using MAMP for Web Development
Eric Greene
 
Tech Stack Ideas
nsclark
 
Moving from PHP to a nodejs full stack CMS
Make & Build
 
Everything You Need to Know About the Top Changes in Drupal 8
Acquia
 
Adobe AEM for Business Heads
Yash Mody
 
A Minimalist’s Attempt at Building a Distributed Application
David Hoerster
 
Node js projects
💾 Radek Fabisiak
 
MEAN Stack
RoshanTak1
 
Catch 22: FLex APps
Yash Mody
 
Mern stack developement
kalyankumar836878
 
Node js (runtime environment + js library) platform
Sreenivas Kappala
 
Iconus 2016
Mark Roden
 
Become a Better Developer with Debugging Techniques for Drupal (and more!)
Acquia
 
MEAN Stack WeNode Barcelona Workshop
Valeri Karpov
 
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB
 

Similar to Building a Node.JS accelerator for your headless Drupal backend - DrupalCamp London 2015 (20)

PDF
Drupal Café: Building Node.js Accelerator for Your Headless Drupal
Exove
 
PDF
Turbocharging Drupal Syndication with Node.js
Exove
 
PDF
Decoupled Drupal: What This Means for Developers
Acquia
 
PDF
Introduction to Node.js: perspectives from a Drupal dev
mcantelon
 
PPTX
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
DrupalCamp Kyiv
 
PDF
Drupal Is Not Your Web Site
Phase2
 
PPTX
Drupal as a data server
Jay Friendly
 
PDF
Bringing Interactivity to Your Drupal Site with Node.js Integration
Acquia
 
PDF
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Exove
 
PPTX
After the LAMP, it's time to get MEAN
Jeff Fox
 
PDF
Drupal is not your Website
Phase2
 
PDF
How to Successfully Implement Headless Drupal
Acquia
 
PDF
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
Exove
 
PDF
What is Headless and headless 101 at Acquia.pdf
Allie Jones
 
PPTX
Introduction to Node.js
Winston Hsieh
 
PDF
The Decoupled CMS in Financial Services
Open Source Strategy Forum
 
PDF
Showcasing drupal
Opevel
 
PPTX
What is Headless and headless 101 at Acquia
Allie Jones
 
PDF
RESTful with Drupal - in-s and out-s
Kalin Chernev
 
PDF
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 
Drupal Café: Building Node.js Accelerator for Your Headless Drupal
Exove
 
Turbocharging Drupal Syndication with Node.js
Exove
 
Decoupled Drupal: What This Means for Developers
Acquia
 
Introduction to Node.js: perspectives from a Drupal dev
mcantelon
 
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
DrupalCamp Kyiv
 
Drupal Is Not Your Web Site
Phase2
 
Drupal as a data server
Jay Friendly
 
Bringing Interactivity to Your Drupal Site with Node.js Integration
Acquia
 
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Exove
 
After the LAMP, it's time to get MEAN
Jeff Fox
 
Drupal is not your Website
Phase2
 
How to Successfully Implement Headless Drupal
Acquia
 
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
Exove
 
What is Headless and headless 101 at Acquia.pdf
Allie Jones
 
Introduction to Node.js
Winston Hsieh
 
The Decoupled CMS in Financial Services
Open Source Strategy Forum
 
Showcasing drupal
Opevel
 
What is Headless and headless 101 at Acquia
Allie Jones
 
RESTful with Drupal - in-s and out-s
Kalin Chernev
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 
Ad

More from Exove (20)

PDF
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
PDF
Data security in the age of GDPR – most common data security problems
Exove
 
PDF
Provisioning infrastructure to AWS using Terraform – Exove
Exove
 
PDF
Advanced custom fields in Wordpress
Exove
 
PDF
Introduction to Robot Framework – Exove
Exove
 
PDF
Jenkins and visual regression – Exove
Exove
 
PDF
Server-side React with Headless CMS – Exove
Exove
 
PDF
WebSockets in Bravo Dashboard – Exove
Exove
 
PDF
Diversity in recruitment
Exove
 
PDF
Saavutettavuus liiketoimintana
Exove
 
PDF
Saavutettavuus osana Eläkeliiton verkkosivu-uudistusta
Exove
 
PDF
Mitä saavutettavuusdirektiivi pitää sisällään
Exove
 
PDF
Creating Landing Pages for Drupal 8
Exove
 
PDF
GDPR for developers
Exove
 
PDF
Managing Complexity and Privacy Debt with Drupal
Exove
 
PDF
Life with digital services after GDPR
Exove
 
PDF
GDPR - no beginning no end
Exove
 
PDF
Developing truly personalised experiences
Exove
 
PDF
Customer Experience and Personalisation
Exove
 
PDF
Adventures In Programmatic Branding – How To Design With Algorithms And How T...
Exove
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Data security in the age of GDPR – most common data security problems
Exove
 
Provisioning infrastructure to AWS using Terraform – Exove
Exove
 
Advanced custom fields in Wordpress
Exove
 
Introduction to Robot Framework – Exove
Exove
 
Jenkins and visual regression – Exove
Exove
 
Server-side React with Headless CMS – Exove
Exove
 
WebSockets in Bravo Dashboard – Exove
Exove
 
Diversity in recruitment
Exove
 
Saavutettavuus liiketoimintana
Exove
 
Saavutettavuus osana Eläkeliiton verkkosivu-uudistusta
Exove
 
Mitä saavutettavuusdirektiivi pitää sisällään
Exove
 
Creating Landing Pages for Drupal 8
Exove
 
GDPR for developers
Exove
 
Managing Complexity and Privacy Debt with Drupal
Exove
 
Life with digital services after GDPR
Exove
 
GDPR - no beginning no end
Exove
 
Developing truly personalised experiences
Exove
 
Customer Experience and Personalisation
Exove
 
Adventures In Programmatic Branding – How To Design With Algorithms And How T...
Exove
 
Ad

Recently uploaded (20)

PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Digital Circuits, important subject in CS
contactparinay1
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 

Building a Node.JS accelerator for your headless Drupal backend - DrupalCamp London 2015

  • 1. Building a Node.JS accelerator for your headless Drupal backend Kalle Varisvirta @kvirta Technology Director Exove @exove
  • 2. Pre-requisites Moderate understanding of PHP and Javascript Moderate understanding of Drupal’s internals Some idea of how NoSQL, SOLR and Varnish work
  • 3. What you’ll learn What’s headless Drupal Why use headless Drupal How to speed up headless Drupal content delivery with Node.JS in real life Why to speed up Drupal content delivery with Node.JS
  • 4. About me Kalle Varisvirta Technology Director at Exove Exove is a technology company based in Finland, Estonia and UK with over 70 professionals
  • 6. Drupal Typically Drupal gets a HTTP request and responds with an HTML page Theming is done in Drupal No front-end framework is used Drupal User
  • 7. Headless Drupal When you add a front-end framework and let it do the theming, you get headless Drupal Drupal will then deliver content in JSON Drupal User Front-end framework
  • 8. Why headless Drupal? If you want full control over the display of your content If you want to create a app-like experience If you want to create an app :-)
  • 9. Why not headless 
 Drupal? More manual labor than regular Drupal Half of Drupal’s functionality is ignored, as it won’t affect how the content is displayed
  • 10. Headless Drupal App, you say? When just delivering content, Drupal doesn’t care what happens downstream Drupal iOS app Android app Smart TV app Drupal site
  • 11. Headless Drupal Drupal is delivering content in JSON via HTTP, so caching is a valid option for anonymous users Using a Varnish layer to cache the JSON will make your site fast enough for most setups Drupal Varnish iOS app Android app Smart TV app Drupal site
  • 12. Authenticated users Authenticated users in Drupal, especially with long content listings from Views, makes things complicated If you have a lot of authenticated users concurrently using your headless Drupal, you’ll be in trouble fast
  • 15. Drupal content is indexed on every change using the MongoDB indexer module 
 (drupal.org/project/ mongodb_indexer)
  • 16. We’re using MongoDB here as a storage We could be using any NoSQL, including search platforms like Elasticsearch or Apache SOLR We prefer a real database for fast indexing
  • 17. For delivery, we opt for Node.JS A framework like Express or Koa is suggested for better structure
  • 19. Drupal Focusing solely in content management, not delivering any web pages outside the admin
  • 20. MongoDB indexer MongoDB indexer is just a small module we created to index Drupal’s content outside, without interfering the storage engine of Drupal
  • 21. MongoDB indexer MongoDB indexer is just a small module we created to index Drupal’s content outside, without interfering the storage engine of Drupal
  • 22. MongoDB We chose MongoDB over other NoSQL systems due to the popularity and fast development It’s had its issues, but they’ve fixed them all Now expecting Wired Tiger storage engine that’ll improve the locking mechanism
  • 23. Delivery We have optimized data in the MongoDB We want to deliver it out, fast We want to be able to do some logic while delivering it
  • 24. Node.JS Node.JS is Javascript running on the server The Javascript is ran by Chrome’s Javascript engine, the V8 It’s non-blocking, event-based and when used correctly, blazing fast
  • 25. RPS Avg response time Drupal Node.JS
  • 28. Node.JS For a PHP programmer, it’s quite a change Due to the you need to understand parallel programming There are npm modules there to help with that, too During the lifetime our big project (24 months) both Node.JS and MongoDB have evolved quite a bit
  • 29. Node.JS The code is very simple as it’s mostly just passing information out from the MongoDB If you’re building a REST api, as you should, you can add filters to the calls and pass them on to the MongoDB But… you can also check for user session and fetch user-related content
  • 30. REST API REST API allows writing, too, so you’ll have to handle the writes Most of writing in these cases are left to the Node app -level Obviously, writes reaching the Drupal are also possible
  • 32. Video platform project Started three years ago Started as a headless Drupal project Originally was supposed to feed content straight from Drupal
  • 33. Drupal optimizations It’s not like we didn’t think of the performance early on The Drupal 7 was built on MongoDB field storage and thus standing on a fast database The Views feeds (JSON) were coming from SOLR backend
  • 34. Caching feeds Downstream clients want integration feeds limited by time Time attribute by seconds of the last fetch To deal with existing content To deal with changed content We tried to cache to Varnish, it didn’t work at all
  • 35. We need a new approach Indexing outside of Drupal felt like the only way out First we decided we’ll go with SOLR via ApacheSOLR integration Distribution by a simple REST API Later on, we wrote the MongoDB indexer and switched to MongoDB fully
  • 36. Video content management system (Drupal 7) Linear television data 
 (ERP) Drupal 7 site Drupal 7 site Wordpress site iOS app Android app Samsung SmartTV app MongoDB and Node.JS RESTAPI Indexing is done using a Drupal module, MongoDB indexer
  • 37. Recap
  • 38. Recap Headless Drupal is when you use Drupal only for the data and theme/display somewhere else Headless Drupal needs performance that Drupal might not be able to provide MongoDB indexer will index your Drupal entities to MongoDB From MongoDB, it’s easy to distribute your data with Node.JS and enjoy the high performance