SlideShare a Scribd company logo
Building a Node.JS
accelerator for your
headless Drupal
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
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
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 or PM2 (npm module)
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

PDF
DEV117 - Unleash the Power of the AppDev Pack and Node.js in Domino
PPTX
Runescape Accounts
PDF
Lambdaless and AWS CDK
PDF
Ryan Brown - Open Community
PDF
Optimizing the performance of WordPress
PDF
Building and deploying GraphQL Servers with AWS Lambda and Prisma I AWS Dev D...
PDF
AWS Lambda Function with Kotlin
PDF
Reasonable app development
DEV117 - Unleash the Power of the AppDev Pack and Node.js in Domino
Runescape Accounts
Lambdaless and AWS CDK
Ryan Brown - Open Community
Optimizing the performance of WordPress
Building and deploying GraphQL Servers with AWS Lambda and Prisma I AWS Dev D...
AWS Lambda Function with Kotlin
Reasonable app development

What's hot (17)

PDF
Building resilient serverless systems with non-serverless components (Belfast)
PPTX
Enhance WordPress Search Using Sphinx
PDF
How to fail with serverless
PDF
The Evolution of Hadoop at Stripe
PDF
Building resilient serverless systems with non-serverless components - Cardif...
PPTX
Website design & developemet
ODP
Cakefest higher education
PDF
Increasing performance with Elixir Tasks
PPTX
Vs java (1)
PPTX
Signal r azurepresentation
PPT
Widening your JavaScript Application
PPTX
AWS for the Java Developer
PPTX
2015 spice world_london_breakout
PPTX
Dead-Simple Deployment: Headache-Free Java Web Applications in the Cloud
PDF
WordCamp IL 2016 - WordPress Scale on AWS
PPS
Etech2005
PDF
Amazon Elastic Load Balancing
Building resilient serverless systems with non-serverless components (Belfast)
Enhance WordPress Search Using Sphinx
How to fail with serverless
The Evolution of Hadoop at Stripe
Building resilient serverless systems with non-serverless components - Cardif...
Website design & developemet
Cakefest higher education
Increasing performance with Elixir Tasks
Vs java (1)
Signal r azurepresentation
Widening your JavaScript Application
AWS for the Java Developer
2015 spice world_london_breakout
Dead-Simple Deployment: Headache-Free Java Web Applications in the Cloud
WordCamp IL 2016 - WordPress Scale on AWS
Etech2005
Amazon Elastic Load Balancing
Ad

Similar to Drupal Café: Building Node.js Accelerator for Your Headless Drupal (20)

PDF
Building a Node.JS accelerator for your headless Drupal backend - DrupalCamp ...
PDF
Turbocharging Drupal Syndication with Node.js
PPTX
Deploying Web Apps with PaaS and Docker Tools
PPT
Rails Vs CakePHP
PDF
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
PDF
Building a blog with an Onion Architecture
PDF
Onion Architecture and the Blog
PDF
Softshake 2013 - Let's take this offline
PDF
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
ODP
DiUS Computing Lca Rails Final
PDF
12-Step Program for Scaling Web Applications on PostgreSQL
PDF
Drupal is not your Website
ODP
A Happy Cloud Friendly Java Developer with OpenShift
PDF
Backend Development Bootcamp - Node [Online & Offline] In Bangla
PPTX
Lazy Coder Camp Edition 1
PDF
Drupal Extreme Scaling
PDF
Decoupling Drupal - Drupal Camp Toronto 2014
PPT
Introducing MongoPress
PDF
Easy Decoupled Sitebuilding with GraphQL and Next.js
PDF
Hacking Real time Messaging with Firebase
Building a Node.JS accelerator for your headless Drupal backend - DrupalCamp ...
Turbocharging Drupal Syndication with Node.js
Deploying Web Apps with PaaS and Docker Tools
Rails Vs CakePHP
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Building a blog with an Onion Architecture
Onion Architecture and the Blog
Softshake 2013 - Let's take this offline
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
DiUS Computing Lca Rails Final
12-Step Program for Scaling Web Applications on PostgreSQL
Drupal is not your Website
A Happy Cloud Friendly Java Developer with OpenShift
Backend Development Bootcamp - Node [Online & Offline] In Bangla
Lazy Coder Camp Edition 1
Drupal Extreme Scaling
Decoupling Drupal - Drupal Camp Toronto 2014
Introducing MongoPress
Easy Decoupled Sitebuilding with GraphQL and Next.js
Hacking Real time Messaging with Firebase
Ad

More from Exove (20)

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

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
Teaching material agriculture food technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
cuic standard and advanced reporting.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
PDF
KodekX | Application Modernization Development
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
20250228 LYD VKU AI Blended-Learning.pptx
Teaching material agriculture food technology
Dropbox Q2 2025 Financial Results & Investor Presentation
cuic standard and advanced reporting.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
MYSQL Presentation for SQL database connectivity
Programs and apps: productivity, graphics, security and other tools
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Advanced methodologies resolving dimensionality complications for autism neur...
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
KodekX | Application Modernization Development
Understanding_Digital_Forensics_Presentation.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Drupal Café: Building Node.js Accelerator for Your Headless Drupal

  • 1. Building a Node.JS accelerator for your headless Drupal 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. About me Kalle Varisvirta Technology Director at Exove Exove is a technology company based in Finland, Estonia and UK with over 70 professionals
  • 5. 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
  • 6. 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
  • 7. 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 :-)
  • 8. 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
  • 9. 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
  • 10. 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
  • 11. 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
  • 14. Drupal content is indexed on every change using the MongoDB indexer module 
 (drupal.org/project/ mongodb_indexer)
  • 15. 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
  • 16. For delivery, we opt for Node.JS A framework like Express or Koa is suggested for better structure
  • 18. Drupal Focusing solely in content management, not delivering any web pages outside the admin
  • 19. MongoDB indexer MongoDB indexer is just a small module we created to index Drupal’s content outside, without interfering the storage engine of Drupal
  • 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 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
  • 22. 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
  • 23. 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
  • 24. RPS Avg response time Drupal Node.JS
  • 26. 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
  • 27. 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
  • 28. 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
  • 30. Video platform project Started three years ago Started as a headless Drupal project Originally was supposed to feed content straight from Drupal
  • 31. 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
  • 32. 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
  • 33. 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
  • 34. 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
  • 35. Recap
  • 36. 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