SlideShare a Scribd company logo
1 of 39
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

Drupal 8 Configuration Management
Drupal 8 Configuration ManagementDrupal 8 Configuration Management
Drupal 8 Configuration ManagementExove
 
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015Exove
 
Caching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Caching Strategies for Scaling Drupal: Common Missteps vs Best PracticesCaching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Caching Strategies for Scaling Drupal: Common Missteps vs Best PracticesAcquia
 
Using MAMP for Web Development
Using MAMP for Web DevelopmentUsing MAMP for Web Development
Using MAMP for Web DevelopmentEric Greene
 
Tech Stack Ideas
Tech Stack IdeasTech Stack Ideas
Tech Stack Ideasnsclark
 
Moving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMoving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMake & Build
 
Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Acquia
 
Adobe AEM for Business Heads
Adobe AEM for Business HeadsAdobe AEM for Business Heads
Adobe AEM for Business HeadsYash Mody
 
A Minimalist’s Attempt at Building a Distributed Application
A Minimalist’s Attempt at Building a Distributed ApplicationA Minimalist’s Attempt at Building a Distributed Application
A Minimalist’s Attempt at Building a Distributed ApplicationDavid Hoerster
 
Catch 22: FLex APps
Catch 22: FLex APpsCatch 22: FLex APps
Catch 22: FLex APpsYash Mody
 
Node js (runtime environment + js library) platform
Node js (runtime environment + js library) platformNode js (runtime environment + js library) platform
Node js (runtime environment + js library) platformSreenivas Kappala
 
Become a Better Developer with Debugging Techniques for Drupal (and more!)
Become a Better Developer with Debugging Techniques for Drupal (and more!)Become a Better Developer with Debugging Techniques for Drupal (and more!)
Become a Better Developer with Debugging Techniques for Drupal (and more!)Acquia
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopValeri Karpov
 
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN StackMongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN StackMongoDB
 

What's hot (20)

Drupal 8 Configuration Management
Drupal 8 Configuration ManagementDrupal 8 Configuration Management
Drupal 8 Configuration Management
 
Keystone.js 101
Keystone.js 101Keystone.js 101
Keystone.js 101
 
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
Start with Bolt and Go Ez - eZ Publish Summer Camp 2015
 
CQ5 and Sling overview
CQ5 and Sling overviewCQ5 and Sling overview
CQ5 and Sling overview
 
Caching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Caching Strategies for Scaling Drupal: Common Missteps vs Best PracticesCaching Strategies for Scaling Drupal: Common Missteps vs Best Practices
Caching Strategies for Scaling Drupal: Common Missteps vs Best Practices
 
Using MAMP for Web Development
Using MAMP for Web DevelopmentUsing MAMP for Web Development
Using MAMP for Web Development
 
Tech Stack Ideas
Tech Stack IdeasTech Stack Ideas
Tech Stack Ideas
 
Moving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMoving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMS
 
Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8
 
Adobe AEM for Business Heads
Adobe AEM for Business HeadsAdobe AEM for Business Heads
Adobe AEM for Business Heads
 
A Minimalist’s Attempt at Building a Distributed Application
A Minimalist’s Attempt at Building a Distributed ApplicationA Minimalist’s Attempt at Building a Distributed Application
A Minimalist’s Attempt at Building a Distributed Application
 
Node js projects
Node js projectsNode js projects
Node js projects
 
MEAN Stack
MEAN Stack MEAN Stack
MEAN Stack
 
Catch 22: FLex APps
Catch 22: FLex APpsCatch 22: FLex APps
Catch 22: FLex APps
 
Mern stack developement
Mern stack developementMern stack developement
Mern stack developement
 
Node js (runtime environment + js library) platform
Node js (runtime environment + js library) platformNode js (runtime environment + js library) platform
Node js (runtime environment + js library) platform
 
Iconus 2016
Iconus 2016Iconus 2016
Iconus 2016
 
Become a Better Developer with Debugging Techniques for Drupal (and more!)
Become a Better Developer with Debugging Techniques for Drupal (and more!)Become a Better Developer with Debugging Techniques for Drupal (and more!)
Become a Better Developer with Debugging Techniques for Drupal (and more!)
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
 
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN StackMongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
 

Similar to Building a Node.JS accelerator for your headless Drupal backend

Drupal Café: Building Node.js Accelerator for Your Headless Drupal
Drupal Café: Building Node.js Accelerator for Your Headless DrupalDrupal Café: Building Node.js Accelerator for Your Headless Drupal
Drupal Café: Building Node.js Accelerator for Your Headless DrupalExove
 
Turbocharging Drupal Syndication with Node.js
Turbocharging Drupal Syndication with Node.jsTurbocharging Drupal Syndication with Node.js
Turbocharging Drupal Syndication with Node.jsExove
 
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015: Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015: Exove
 
Building a blog with an Onion Architecture
Building a blog with an Onion ArchitectureBuilding a blog with an Onion Architecture
Building a blog with an Onion ArchitectureBarry O Sullivan
 
Onion Architecture and the Blog
Onion Architecture and the BlogOnion Architecture and the Blog
Onion Architecture and the Blogbarryosull
 
Deploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker ToolsDeploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker ToolsEddie Lau
 
Softshake 2013 - Let's take this offline
Softshake 2013 - Let's take this offlineSoftshake 2013 - Let's take this offline
Softshake 2013 - Let's take this offlineClaire Reynaud
 
Rails Vs CakePHP
Rails Vs CakePHPRails Vs CakePHP
Rails Vs CakePHPGautam Rege
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQLKonstantin Gredeskoul
 
Backend Development Bootcamp - Node [Online & Offline] In Bangla
Backend Development Bootcamp - Node [Online & Offline] In BanglaBackend Development Bootcamp - Node [Online & Offline] In Bangla
Backend Development Bootcamp - Node [Online & Offline] In BanglaStack Learner
 
Drupal Extreme Scaling
Drupal Extreme ScalingDrupal Extreme Scaling
Drupal Extreme Scalingzekivazquez
 
Hadoop at Meebo: Lessons in the Real World
Hadoop at Meebo: Lessons in the Real WorldHadoop at Meebo: Lessons in the Real World
Hadoop at Meebo: Lessons in the Real Worldvoberoi
 
DiUS Computing Lca Rails Final
DiUS  Computing Lca Rails FinalDiUS  Computing Lca Rails Final
DiUS Computing Lca Rails FinalRobert Postill
 
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015Exove
 
A Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShiftA Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShiftShekhar Gulati
 
Isomorphic js shared js with react.js
Isomorphic js  shared js with react.jsIsomorphic js  shared js with react.js
Isomorphic js shared js with react.jsSasha Snig
 
PHP is the king, nodejs is the prince and Lua is the fool
PHP is the king, nodejs is the prince and Lua is the foolPHP is the king, nodejs is the prince and Lua is the fool
PHP is the king, nodejs is the prince and Lua is the foolAlessandro Cinelli (cirpo)
 

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

Drupal Café: Building Node.js Accelerator for Your Headless Drupal
Drupal Café: Building Node.js Accelerator for Your Headless DrupalDrupal Café: Building Node.js Accelerator for Your Headless Drupal
Drupal Café: Building Node.js Accelerator for Your Headless Drupal
 
Turbocharging Drupal Syndication with Node.js
Turbocharging Drupal Syndication with Node.jsTurbocharging Drupal Syndication with Node.js
Turbocharging Drupal Syndication with Node.js
 
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015: Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
 
Building a blog with an Onion Architecture
Building a blog with an Onion ArchitectureBuilding a blog with an Onion Architecture
Building a blog with an Onion Architecture
 
Onion Architecture and the Blog
Onion Architecture and the BlogOnion Architecture and the Blog
Onion Architecture and the Blog
 
Deploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker ToolsDeploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker Tools
 
Softshake 2013 - Let's take this offline
Softshake 2013 - Let's take this offlineSoftshake 2013 - Let's take this offline
Softshake 2013 - Let's take this offline
 
Drupalcampatl d7
Drupalcampatl d7Drupalcampatl d7
Drupalcampatl d7
 
Rails Vs CakePHP
Rails Vs CakePHPRails Vs CakePHP
Rails Vs CakePHP
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
 
Backend Development Bootcamp - Node [Online & Offline] In Bangla
Backend Development Bootcamp - Node [Online & Offline] In BanglaBackend Development Bootcamp - Node [Online & Offline] In Bangla
Backend Development Bootcamp - Node [Online & Offline] In Bangla
 
Drupal Extreme Scaling
Drupal Extreme ScalingDrupal Extreme Scaling
Drupal Extreme Scaling
 
Hadoop at Meebo: Lessons in the Real World
Hadoop at Meebo: Lessons in the Real WorldHadoop at Meebo: Lessons in the Real World
Hadoop at Meebo: Lessons in the Real World
 
DiUS Computing Lca Rails Final
DiUS  Computing Lca Rails FinalDiUS  Computing Lca Rails Final
DiUS Computing Lca Rails Final
 
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
 
A Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShiftA Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShift
 
Isomorphic js shared js with react.js
Isomorphic js  shared js with react.jsIsomorphic js  shared js with react.js
Isomorphic js shared js with react.js
 
Mongodb
MongodbMongodb
Mongodb
 
PHP is the king, nodejs is the prince and Lua is the fool
PHP is the king, nodejs is the prince and Lua is the foolPHP is the king, nodejs is the prince and Lua is the fool
PHP is the king, nodejs is the prince and Lua is the fool
 
React js basics
React js basicsReact js basics
React js basics
 

More from Exove

Data security in the age of GDPR – most common data security problems
Data security in the age of GDPR – most common data security problemsData security in the age of GDPR – most common data security problems
Data security in the age of GDPR – most common data security problemsExove
 
Provisioning infrastructure to AWS using Terraform – Exove
Provisioning infrastructure to AWS using Terraform – ExoveProvisioning infrastructure to AWS using Terraform – Exove
Provisioning infrastructure to AWS using Terraform – ExoveExove
 
Advanced custom fields in Wordpress
Advanced custom fields in WordpressAdvanced custom fields in Wordpress
Advanced custom fields in WordpressExove
 
Introduction to Robot Framework – Exove
Introduction to Robot Framework – ExoveIntroduction to Robot Framework – Exove
Introduction to Robot Framework – ExoveExove
 
Jenkins and visual regression – Exove
Jenkins and visual regression – ExoveJenkins and visual regression – Exove
Jenkins and visual regression – ExoveExove
 
Server-side React with Headless CMS – Exove
Server-side React with Headless CMS – ExoveServer-side React with Headless CMS – Exove
Server-side React with Headless CMS – ExoveExove
 
WebSockets in Bravo Dashboard – Exove
WebSockets in Bravo Dashboard – ExoveWebSockets in Bravo Dashboard – Exove
WebSockets in Bravo Dashboard – ExoveExove
 
Diversity in recruitment
Diversity in recruitmentDiversity in recruitment
Diversity in recruitmentExove
 
Saavutettavuus liiketoimintana
Saavutettavuus liiketoimintanaSaavutettavuus liiketoimintana
Saavutettavuus liiketoimintanaExove
 
Saavutettavuus osana Eläkeliiton verkkosivu-uudistusta
Saavutettavuus osana Eläkeliiton verkkosivu-uudistustaSaavutettavuus osana Eläkeliiton verkkosivu-uudistusta
Saavutettavuus osana Eläkeliiton verkkosivu-uudistustaExove
 
Mitä saavutettavuusdirektiivi pitää sisällään
Mitä saavutettavuusdirektiivi pitää sisälläänMitä saavutettavuusdirektiivi pitää sisällään
Mitä saavutettavuusdirektiivi pitää sisälläänExove
 
Creating Landing Pages for Drupal 8
Creating Landing Pages for Drupal 8Creating Landing Pages for Drupal 8
Creating Landing Pages for Drupal 8Exove
 
GDPR for developers
GDPR for developersGDPR for developers
GDPR for developersExove
 
Managing Complexity and Privacy Debt with Drupal
Managing Complexity and Privacy Debt with DrupalManaging Complexity and Privacy Debt with Drupal
Managing Complexity and Privacy Debt with DrupalExove
 
Life with digital services after GDPR
Life with digital services after GDPRLife with digital services after GDPR
Life with digital services after GDPRExove
 
GDPR - no beginning no end
GDPR - no beginning no endGDPR - no beginning no end
GDPR - no beginning no endExove
 
Developing truly personalised experiences
Developing truly personalised experiencesDeveloping truly personalised experiences
Developing truly personalised experiencesExove
 
Customer Experience and Personalisation
Customer Experience and PersonalisationCustomer Experience and Personalisation
Customer Experience and PersonalisationExove
 
Adventures In Programmatic Branding – How To Design With Algorithms And How T...
Adventures In Programmatic Branding – How To Design With Algorithms And How T...Adventures In Programmatic Branding – How To Design With Algorithms And How T...
Adventures In Programmatic Branding – How To Design With Algorithms And How T...Exove
 
Dataohjattu asiakaskokemus
Dataohjattu asiakaskokemusDataohjattu asiakaskokemus
Dataohjattu asiakaskokemusExove
 

More from Exove (20)

Data security in the age of GDPR – most common data security problems
Data security in the age of GDPR – most common data security problemsData security in the age of GDPR – most common data security problems
Data security in the age of GDPR – most common data security problems
 
Provisioning infrastructure to AWS using Terraform – Exove
Provisioning infrastructure to AWS using Terraform – ExoveProvisioning infrastructure to AWS using Terraform – Exove
Provisioning infrastructure to AWS using Terraform – Exove
 
Advanced custom fields in Wordpress
Advanced custom fields in WordpressAdvanced custom fields in Wordpress
Advanced custom fields in Wordpress
 
Introduction to Robot Framework – Exove
Introduction to Robot Framework – ExoveIntroduction to Robot Framework – Exove
Introduction to Robot Framework – Exove
 
Jenkins and visual regression – Exove
Jenkins and visual regression – ExoveJenkins and visual regression – Exove
Jenkins and visual regression – Exove
 
Server-side React with Headless CMS – Exove
Server-side React with Headless CMS – ExoveServer-side React with Headless CMS – Exove
Server-side React with Headless CMS – Exove
 
WebSockets in Bravo Dashboard – Exove
WebSockets in Bravo Dashboard – ExoveWebSockets in Bravo Dashboard – Exove
WebSockets in Bravo Dashboard – Exove
 
Diversity in recruitment
Diversity in recruitmentDiversity in recruitment
Diversity in recruitment
 
Saavutettavuus liiketoimintana
Saavutettavuus liiketoimintanaSaavutettavuus liiketoimintana
Saavutettavuus liiketoimintana
 
Saavutettavuus osana Eläkeliiton verkkosivu-uudistusta
Saavutettavuus osana Eläkeliiton verkkosivu-uudistustaSaavutettavuus osana Eläkeliiton verkkosivu-uudistusta
Saavutettavuus osana Eläkeliiton verkkosivu-uudistusta
 
Mitä saavutettavuusdirektiivi pitää sisällään
Mitä saavutettavuusdirektiivi pitää sisälläänMitä saavutettavuusdirektiivi pitää sisällään
Mitä saavutettavuusdirektiivi pitää sisällään
 
Creating Landing Pages for Drupal 8
Creating Landing Pages for Drupal 8Creating Landing Pages for Drupal 8
Creating Landing Pages for Drupal 8
 
GDPR for developers
GDPR for developersGDPR for developers
GDPR for developers
 
Managing Complexity and Privacy Debt with Drupal
Managing Complexity and Privacy Debt with DrupalManaging Complexity and Privacy Debt with Drupal
Managing Complexity and Privacy Debt with Drupal
 
Life with digital services after GDPR
Life with digital services after GDPRLife with digital services after GDPR
Life with digital services after GDPR
 
GDPR - no beginning no end
GDPR - no beginning no endGDPR - no beginning no end
GDPR - no beginning no end
 
Developing truly personalised experiences
Developing truly personalised experiencesDeveloping truly personalised experiences
Developing truly personalised experiences
 
Customer Experience and Personalisation
Customer Experience and PersonalisationCustomer Experience and Personalisation
Customer Experience and Personalisation
 
Adventures In Programmatic Branding – How To Design With Algorithms And How T...
Adventures In Programmatic Branding – How To Design With Algorithms And How T...Adventures In Programmatic Branding – How To Design With Algorithms And How T...
Adventures In Programmatic Branding – How To Design With Algorithms And How T...
 
Dataohjattu asiakaskokemus
Dataohjattu asiakaskokemusDataohjattu asiakaskokemus
Dataohjattu asiakaskokemus
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Building a Node.JS accelerator for your headless Drupal backend

  • 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