SlideShare a Scribd company logo
Turbocharging Drupal 
syndication with Node.JS 
Kalle Varisvirta 
Technology Director
Pre-requisites 
Moderate understanding of PHP and Javascript 
Moderate understanding of Drupal’s internals 
Some idea of how MySQL, NoSQL, SOLR and Varnish 
work
What you’ll learn 
How to speed up Drupal content delivery with Node.JS 
in real life 
Why to speed up Drupal content delivery with Node.JS 
How does Node.JS scale compared to Drupal/PHP
About me 
Kalle Varisvirta 
Technology Director at Exove 
Exove is a technology company based in Finland, 
Estonia and UK with over 70 professionals
The project 
The customer is Nelonen, a Finnish TV broadcaster 
owned by Sanoma 
The platform is used by their subscription video and 
catchup video on-demand service
The architecture
The architecture 
A video content management system 
It gets fed by linear TV programming as well as 
uploaded content 
It’s supposed to deliver all content to downstream 
clients, multiple websites, mobile and TV apps and 
other CMSs
The architecture 
Of videos, the system only handles metadata 
Any uploaded videos are moved away from the CMS, 
to a separate stream controlled by the CMS 
Videos are streamed from multiple streaming locations 
as directed by the CMS
Video content management 
system 
(Drupal 7) 
Linear television 
data 
(ERP) 
Drupal 7 site Wordpress site
Drupal 
Focusing solely in content management, not delivering 
any web pages outside the admin 
There are custom modules for 
Integrating to linear TV ERP system 
Controlling the video binary management system 
Marking videos ready to display
Video content management 
system 
(Drupal 7) 
Linear television 
data 
(ERP) 
Drupal 7 site Wordpress site
Video content management 
system 
(Drupal 7) 
Linear television 
data 
(ERP) 
Drupal 7 site 
Drupal 7 site 
iOS app 
Wordpress site 
Samsung 
SmartTV app 
Android app
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
Drupal optimizations 
MongoDB field storage 
Is faster 
Isn’t compatible with Views, unless used with Entity 
Field Queries 
EFQ’s didn’t originally work well with MongoDB, 
e.g. booleans just didn’t work 
Eventually, isn’t worth the trouble
Syndicating content 
Big feeds are always too slow if coming from Drupal 
Storage doesn’t make a difference (MySQL, 
MongoDB, SOLR) 
Field API is extensible and flexible and thus - slow
Fields API 
40 fields per item, 1000 items in feed page 
40 000 calls to every hook per page load
Hey, 
can’t you just 
cache it?
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 
Caching just doesn’t cut it well
Indexing 
outside
We need a new approach 
Indexing outside of Drupal felt like the only way out 
We decided we’ll go with SOLR via ApacheSOLR 
integration 
Distribution by a simple REST API
We need a new approach 
Due to very frequent updates in popularity data and the 
need the order by popularity, SOLR indexing was found 
too slow 
All data was moved to MongoDB except full-text 
search backend
Video content management 
system 
(Drupal 7) 
Linear television 
data 
(ERP) 
Drupal 7 site 
Drupal 7 site 
MongoDB, SOLR and 
Node.JS REST API 
iOS app 
Wordpress site 
Samsung 
SmartTV app 
Android app
Video content management 
system 
(Drupal 7) 
Linear television 
data 
(ERP) 
Drupal 7 site 
Drupal 7 site 
Indexing is done using a 
Drupal module, MongoDB 
indexer 
MongoDB, SOLR and 
Node.JS REST API 
iOS app 
Wordpress site 
Samsung 
SmartTV app 
Android app
MongoDB indexer 
MongoDB indexer uses a straight connection to the 
MongoDB 
We have an indexing API on the roadmap, but 
currently don’t have a need for it 
MongoDB indexer also de-normalizes the data for 
optimized distribution by the Node.JS REST API 
It’s a contributed module, currently waiting approval
Delivery & 
distribution
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 
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 
No Node.JS framework used 
No fronting Nginx used, requests are passed from the 
main program to separate sub-programs manually 
Running on three nodes, sharing a MongoDB replica 
set and fronted by a F5 load balancer
Node.JS 
The code is very simple as it’s mostly just passing 
information out from the MongoDB 
There are filters in the API that are validated and used 
for filtering, other than that, very little processing is 
done 
The backend has also some special services
API
Node.JS 
Cluster (npm module) 
Forever (npm module)
Node.JS 
For a PHP programmer, it’s quite a change 
Due to the asynchronous nature, parallel programming 
understanding is needed 
There are npm modules there to help 
During the lifetime of the project (18 months) both 
Node.JS and MongoDB have evolved quite a bit
What’s next?
Node.JS optimizations 
Separating different Node.JS services 
Moving MongoDB’s out from the Node.JS servers 
MongoDB’s are very, very IO intensive
Drupal optimizations 
Moving integrations outside Drupal for clarity 
Using a fake Drupal 8 REST API to connect the 
integrations to the Drupal 
To be able to upgrade some time soon 
We released out ‘fake Drupal 8 REST API’ module, 
it’s in sandbox pending approval
Thank you! 
Questions?

More Related Content

PPTX
Web presentation
PPTX
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
PDF
The Netflix API for a global service
PDF
Serverless Java Challenges & Triumphs
PPTX
#JavaOne What's in an object?
PDF
Project Zero Php Quebec
PDF
OpenAPI Generator The Babel Fish of The API World - apidays Live Paris
PDF
Микросервисы со Spring Boot & Spring Cloud
Web presentation
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
The Netflix API for a global service
Serverless Java Challenges & Triumphs
#JavaOne What's in an object?
Project Zero Php Quebec
OpenAPI Generator The Babel Fish of The API World - apidays Live Paris
Микросервисы со Spring Boot & Spring Cloud

Viewers also liked (8)

PDF
Language support in searching Drupal with SOLR - Drupalcamp London 2013
PPTX
Internet Business Trends in 2014
PDF
Drupal Cafe - Nenäpäivä
PPTX
Palvelusuunnittelu ketterissä verkkoprojekteissa
PPTX
Agile Web Development, Exove seminar August 15th, 2013
PDF
Drupal Café October - DrupalCon Highlights
PPTX
Kuinka verkkokauppa taipuu kännykkään / Marblesin treenit
PDF
AppTalk Frontline: Web vs Hybrid vs Native
Language support in searching Drupal with SOLR - Drupalcamp London 2013
Internet Business Trends in 2014
Drupal Cafe - Nenäpäivä
Palvelusuunnittelu ketterissä verkkoprojekteissa
Agile Web Development, Exove seminar August 15th, 2013
Drupal Café October - DrupalCon Highlights
Kuinka verkkokauppa taipuu kännykkään / Marblesin treenit
AppTalk Frontline: Web vs Hybrid vs Native
Ad

Similar to Turbocharging Drupal Syndication with Node.js (20)

PDF
Building a Node.JS accelerator for your headless Drupal backend - DrupalCamp ...
PDF
Drupal Café: Building Node.js Accelerator for Your Headless Drupal
PDF
Showcasing drupal
PDF
Making Startups Work: Scaling Drupal for Thrillist.com
PPTX
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
PPTX
Creating Real-Time Data Mashups with Node.js and Adobe CQ by Josh Miller
PPTX
After the LAMP, it's time to get MEAN
PPTX
Creating Real-Time Data Mashups with Node.JS and Adobe CQ
PDF
Drupal Is Not Your Web Site
PDF
Introduction to Node.js: perspectives from a Drupal dev
PPT
DrupalCon Chicago 2011 ReportBack (11/03/30 - G. Bedford)
PPTX
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQ
PDF
Bringing Interactivity to Your Drupal Site with Node.js Integration
PDF
Drupal is not your Website
PDF
How we leveraged Drupal to build a leading SaaS product
PPTX
Why Enterprises Choose Drupal for Futuristic Web App Development?
PPTX
Meanstack overview
PDF
Designing and developing challenging Drupal sites
PDF
FFFast Drupal backend No kidding!
PDF
Pavel Prischepa. Fffast Drupal backend.
Building a Node.JS accelerator for your headless Drupal backend - DrupalCamp ...
Drupal Café: Building Node.js Accelerator for Your Headless Drupal
Showcasing drupal
Making Startups Work: Scaling Drupal for Thrillist.com
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
Creating Real-Time Data Mashups with Node.js and Adobe CQ by Josh Miller
After the LAMP, it's time to get MEAN
Creating Real-Time Data Mashups with Node.JS and Adobe CQ
Drupal Is Not Your Web Site
Introduction to Node.js: perspectives from a Drupal dev
DrupalCon Chicago 2011 ReportBack (11/03/30 - G. Bedford)
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQ
Bringing Interactivity to Your Drupal Site with Node.js Integration
Drupal is not your Website
How we leveraged Drupal to build a leading SaaS product
Why Enterprises Choose Drupal for Futuristic Web App Development?
Meanstack overview
Designing and developing challenging Drupal sites
FFFast Drupal backend No kidding!
Pavel Prischepa. Fffast Drupal backend.
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)

PDF
Machine learning based COVID-19 study performance prediction
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
KodekX | Application Modernization Development
PDF
cuic standard and advanced reporting.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Electronic commerce courselecture one. Pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Empathic Computing: Creating Shared Understanding
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
Machine learning based COVID-19 study performance prediction
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Spectroscopy.pptx food analysis technology
MIND Revenue Release Quarter 2 2025 Press Release
KodekX | Application Modernization Development
cuic standard and advanced reporting.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25 Week I
The AUB Centre for AI in Media Proposal.docx
Electronic commerce courselecture one. Pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
20250228 LYD VKU AI Blended-Learning.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Empathic Computing: Creating Shared Understanding
sap open course for s4hana steps from ECC to s4
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Building Integrated photovoltaic BIPV_UPV.pdf

Turbocharging Drupal Syndication with Node.js

  • 1. Turbocharging Drupal syndication with Node.JS Kalle Varisvirta Technology Director
  • 2. Pre-requisites Moderate understanding of PHP and Javascript Moderate understanding of Drupal’s internals Some idea of how MySQL, NoSQL, SOLR and Varnish work
  • 3. What you’ll learn How to speed up Drupal content delivery with Node.JS in real life Why to speed up Drupal content delivery with Node.JS How does Node.JS scale compared to Drupal/PHP
  • 4. About me Kalle Varisvirta Technology Director at Exove Exove is a technology company based in Finland, Estonia and UK with over 70 professionals
  • 5. The project The customer is Nelonen, a Finnish TV broadcaster owned by Sanoma The platform is used by their subscription video and catchup video on-demand service
  • 7. The architecture A video content management system It gets fed by linear TV programming as well as uploaded content It’s supposed to deliver all content to downstream clients, multiple websites, mobile and TV apps and other CMSs
  • 8. The architecture Of videos, the system only handles metadata Any uploaded videos are moved away from the CMS, to a separate stream controlled by the CMS Videos are streamed from multiple streaming locations as directed by the CMS
  • 9. Video content management system (Drupal 7) Linear television data (ERP) Drupal 7 site Wordpress site
  • 10. Drupal Focusing solely in content management, not delivering any web pages outside the admin There are custom modules for Integrating to linear TV ERP system Controlling the video binary management system Marking videos ready to display
  • 11. Video content management system (Drupal 7) Linear television data (ERP) Drupal 7 site Wordpress site
  • 12. Video content management system (Drupal 7) Linear television data (ERP) Drupal 7 site Drupal 7 site iOS app Wordpress site Samsung SmartTV app Android app
  • 13. 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
  • 14. Drupal optimizations MongoDB field storage Is faster Isn’t compatible with Views, unless used with Entity Field Queries EFQ’s didn’t originally work well with MongoDB, e.g. booleans just didn’t work Eventually, isn’t worth the trouble
  • 15. Syndicating content Big feeds are always too slow if coming from Drupal Storage doesn’t make a difference (MySQL, MongoDB, SOLR) Field API is extensible and flexible and thus - slow
  • 16. Fields API 40 fields per item, 1000 items in feed page 40 000 calls to every hook per page load
  • 17. Hey, can’t you just cache it?
  • 18. 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 Caching just doesn’t cut it well
  • 20. We need a new approach Indexing outside of Drupal felt like the only way out We decided we’ll go with SOLR via ApacheSOLR integration Distribution by a simple REST API
  • 21. We need a new approach Due to very frequent updates in popularity data and the need the order by popularity, SOLR indexing was found too slow All data was moved to MongoDB except full-text search backend
  • 22. Video content management system (Drupal 7) Linear television data (ERP) Drupal 7 site Drupal 7 site MongoDB, SOLR and Node.JS REST API iOS app Wordpress site Samsung SmartTV app Android app
  • 23. Video content management system (Drupal 7) Linear television data (ERP) Drupal 7 site Drupal 7 site Indexing is done using a Drupal module, MongoDB indexer MongoDB, SOLR and Node.JS REST API iOS app Wordpress site Samsung SmartTV app Android app
  • 24. MongoDB indexer MongoDB indexer uses a straight connection to the MongoDB We have an indexing API on the roadmap, but currently don’t have a need for it MongoDB indexer also de-normalizes the data for optimized distribution by the Node.JS REST API It’s a contributed module, currently waiting approval
  • 26. 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
  • 28. 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
  • 29. RPS Avg response time Drupal Node.JS
  • 30. Node.JS No Node.JS framework used No fronting Nginx used, requests are passed from the main program to separate sub-programs manually Running on three nodes, sharing a MongoDB replica set and fronted by a F5 load balancer
  • 31. Node.JS The code is very simple as it’s mostly just passing information out from the MongoDB There are filters in the API that are validated and used for filtering, other than that, very little processing is done The backend has also some special services
  • 32. API
  • 33. Node.JS Cluster (npm module) Forever (npm module)
  • 34. Node.JS For a PHP programmer, it’s quite a change Due to the asynchronous nature, parallel programming understanding is needed There are npm modules there to help During the lifetime of the project (18 months) both Node.JS and MongoDB have evolved quite a bit
  • 36. Node.JS optimizations Separating different Node.JS services Moving MongoDB’s out from the Node.JS servers MongoDB’s are very, very IO intensive
  • 37. Drupal optimizations Moving integrations outside Drupal for clarity Using a fake Drupal 8 REST API to connect the integrations to the Drupal To be able to upgrade some time soon We released out ‘fake Drupal 8 REST API’ module, it’s in sandbox pending approval