SlideShare a Scribd company logo
Developing realtime apps with Drupal and NodeJS
About myself
Ivo Nellis
CTO, Fenomen Veebiagentuur

● Working with Drupal since 2007
● Contributed mostly to Estonian translations
● Main focus: Drupal, Node.js, MongoDB

                                   Skype: ivonellis
                                  Twitter: ivonellis
                                 ivo@fenomen.ee
Developing realtime apps
 with Node.js and Drupal
           Ivo Nellis
     Fenomen veebiagentuur
With Node.js, you can
  write web applications
Perfect for fast, scalable, light-weight data-
 intensive and real-time web applications

Recommended for you

Canonical Ubuntu OpenStack Overview Presentation
Canonical Ubuntu OpenStack Overview PresentationCanonical Ubuntu OpenStack Overview Presentation
Canonical Ubuntu OpenStack Overview Presentation

Canonical Ubuntu OpenStack Overview Presentation Contact Indonesia: Frans Thamura, Meruvian, +62 8557888699, frans@meruvian.com

canonical ubuntu openstack overview presentation
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...

***** DevOps Masters Program : https://www.edureka.co/masters-program/devops-engineer-training ***** This DevOps Docker Commands tutorial ( Docker Tutorial Blog Series: https://goo.gl/z93Ed1 ) will introduce you to the most commonly used Docker commands. The Hands-On session is performed on an Ubuntu-64 bit machine in which Docker is installed. To learn how Docker can be used to integrate multiple DevOps tools, watch the video titled 'DevOps Tools', by clicking this link: https://goo.gl/up9iwd

docker tutorialdocker trainingdocker compose
Integrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and CamelIntegrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and Camel

Apache Camel has been the Swiss knife of integrating heterogeneous systems for more than a decade. Claus Ibsen explains how Camel adapts to the newest changes with microservices and cloud computing! Apache Camel integrations written on top of Quarkus start in a matter of milliseconds and consume just a few tens of megabytes of RAM. We will explain the technology and show a demo including the famous Quarkus dev mode. Then you will learn how the outstanding integration capabilities of Apache Camel enrich the serverless architectures based on Knative and CamelK!

apache camelquarkuscamelk
Node.js project is new
       Relatively...
1990                 2000                                  2010


                                                             Node.js


                                             Ruby on Rails



                                        ASP.NET

                          Java


                    PHP


       Python



Perl




                   Created 2009 by Ryan Dahl
With node, you can write
      in JavaScript
  or in something that compiles to JS
           (CoffeeScript, ...)
Server-side JavaScript is great!
● JavaScript is the core of modern Web
   ○ A lot of existing JS developers
   ○ Familiarity with asynchronous programming model
● Share code between client and server
   ○ Can use existing libraries on server side as well.
● It's fast ... and it's getting faster every day
   ○ Huge competition between browser vendors

Recommended for you

What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain. What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.

Read to learn what Mule Runtime Fabric (RTF) and Anypoint RTF are, how you can leverage these integration engines, the best adoption strategies, and the right way to conduct the risk-cost-benefit analysis for your business.

mule 4.3what’s mule 4.3anypoint rtf
Kasten K10 Data Management in Kubernetes
Kasten K10 Data Management in KubernetesKasten K10 Data Management in Kubernetes
Kasten K10 Data Management in Kubernetes

"Connaissez vous Kasten, avez vous l'occasion de manipuler des outils Cloud avancés comme K-10, K-8, Kibana ou Argo CD ?

big datadevopseks
Mutiny + quarkus
Mutiny + quarkusMutiny + quarkus
Mutiny + quarkus

This document provides an overview of reactive programming concepts and technologies. It defines reactive programming as using asynchronous and non-blocking code to build responsive and resilient applications. It discusses reactive concepts like the event loop, back pressure, and overflow management. Frameworks like Vert.x and libraries like SmallRye Mutiny that support reactive programming on the JVM are also introduced. The key advantages of reactive programming are supporting more concurrent connections using fewer threads and efficiently processing asynchronous data streams.

quarkusmutinyreactive
But SSJS has been done before..

 Jaxer Rhino Ringo
Ejscript Spludo LiveWire
Node.js is built on
 Google V8 JS engine
Fast, Single runtime = less compability
                issues
Node.js is asynchronous
    & event driven
   and it's great for real-time apps
Apache request lifecycle


 Incoming requests




                     Child processes / threads

Recommended for you

Integrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetesIntegrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetes

Apache Camel has fundamentally changed the way Java developers build system-to-system integrations by using enterprise integration patterns (EIP) with modern microservice architectures. In this session, we’ll show you best practices with Camel and EIPs, in the world of Spring Boot microservices running on Kubernetes. We'll also discuss practices how to build truly cloud-native distributed and fault-tolerant microservices and we’ll introduce the upcoming Camel 3.0 release, which includes serverless capabilities via Camel K. This talk is a mix with slides and live demos.

apache camelkubernetesintegration
Building Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Building Multi-Site and Multi-OpenStack Cloud with OpenStack CascadingBuilding Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Building Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading

The slides used in the speech "Building multi-site and multi-openstack cloud with OpenStack cascading" in OpenStack Paris summit 2014. The slides cover the requirement and driving forces, case study of VDF, technologies eloboration and demo of OpenStack cascading.

openstack cascading
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker

This document provides an introduction to Docker. It begins by introducing the presenter and agenda. It then explains that containers are not virtual machines and discusses the differences in architecture and benefits. It covers the basic Docker workflow of building, shipping, and running containers. It discusses Docker concepts like images, containers, and registries. It demonstrates basic Docker commands. It shows how to define a Dockerfile and build an image. It discusses data persistence using volumes. It covers using Docker Compose to define and run multi-container applications and Docker Swarm for clustering. It provides recommendations for getting started with Docker at different levels.

triforktriforkselecteddocker
The cost of I/O
L1-cache                                                      3 cycles
L2-cache                                                   14 cycles
RAM                                                      250 cycles
Disk                                     41 000 000 cycles
Network                               240 000 000 cycles
           http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/

           http://duartes.org/gustavo/blog/post/what-your-computer-does-while-you-wait
Node.js event loop


 Incoming requests




                     I/O callback



                           I/O request




                           Single process
Hello World!
var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': text/plain'});
  res.end('Hello Worldn');
}).listen(8000);

                        ●   Node itself does not provide much
                        ●   No "standard" webserver features:
                        ●   No authentication
                        ●   No session handling
                        ●   No cookies
                        ●   No email
                        ●   No templating system
                        ●   No MVC or framework layer
You need to extend
●   Active community
●   Node package manager (npm) is great
●   10913 packages as of 06/2012
●   Simple one-line installation
●   Manages all the dependencies for you

$ npm install express
var express = require("express");

Recommended for you

Docker
DockerDocker
Docker

Docker allows building, shipping, and running applications in portable containers. It packages an application with all its dependencies into a standardized unit for software development. Major cloud providers and companies support and use Docker in production. Containers are more lightweight and efficient than virtual machines, providing faster launch times and allowing thousands to run simultaneously on the same server. Docker simplifies distributing applications and ensures a consistent environment.

containerizationdockervirtualization
Kafka Quotas Talk at LinkedIn
Kafka Quotas Talk at LinkedInKafka Quotas Talk at LinkedIn
Kafka Quotas Talk at LinkedIn

The document discusses implementing client quotas in Apache Kafka to ensure fair sharing of broker resources among clients. It describes enforcing quotas based on client IDs and overriding quotas for specific clients. Metrics are used to monitor client throughput and enforce quotas by delaying requests if clients exceed their limits. The approach aims to improve performance for well-behaved clients by preventing a few misbehaving clients from impacting others. Evaluation results show improved throughput and latency for clients when quotas are enforced.

linkedinapachequotas
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction

This document provides an overview of Kubernetes, an open-source system for automating deployment, scaling, and management of containerized applications. It describes Kubernetes' architecture including nodes, pods, replication controllers, services, and networking. It also discusses how to set up Kubernetes environments using Minikube or kubeadm and get started deploying pods and services.

kubernetesk8sdocker
express                            mongodb-native

connect           socket.io                              redis

 request             nodemailer
                                                         jquery
   underscore                  calipso
           async
           https://github.com/joyent/node/wiki/Modules
                       search.npmjs.org
                           github.com
Node.js vs Drupal
  CMS                  Modules, themes, ...      Libraries ...


                                                Calipso / etc...


  Framework                  Drupal           Express.js
                                                                 LIB
                                              Connect.js


  Scripting language          PHP
                                                   Node.js
  Web Server
                             Apache
Web sockets
  and socket.io
Realtime communication
 over HTTP is difficult
 HTTP is request - response by nature
 No good solutions (ajax, long polling)

Recommended for you

Ansible
AnsibleAnsible
Ansible

Ansible is an automation tool that can provision, configure, and deploy applications. It uses human-readable YAML files called playbooks to define automation tasks. Playbooks contain modules that specify steps like installing packages, copying files, and starting services. Ansible Tower provides a GUI and API for securely managing Ansible automation at scale. Ansible supports both Linux and Windows environments through its agentless design and built-in modules.

toolsansibleconfiguration
Linux Container Technology 101
Linux Container Technology 101Linux Container Technology 101
Linux Container Technology 101

Christian Kniep from Docker Inc. gave this talk at the Stanford HPC Conference. "This talk will recap the history of and what constitutes Linux Containers, before laying out how the technology is employed by various engines and what problems these engines have to solve. Afterward, Christian will elaborate on why the advent of standards for images and runtimes moved the discussion from building and distributing containers to orchestrating containerized applications at scale. In conclusion, attendees will get an update on what problems still hinder the adoption of containers for distributed high performance workloads and how Docker is addressing these issues." Christian Kniep is a Technical Account Manager at Docker, Inc. With a 10 year journey rooted in the HPC parts of the german automotive industry, Christian Kniep started to support CAE applications and VR installations. When told at a conference that HPC can not learn anything from the emerging Cloud and BigData companies, he became curious and was leading the containerization effort of the cloud-stack at Playstation Now. Christian joined Docker Inc in 2017 to help push the adoption forward and be part of the innovation instead of an external bystander. During the day he helps Docker customers in the EMEA region to fully utilize the power of containers; at night he likes to explore new emerging trends by containerizing them first and seek application in the nebulous world of DevOps. Watch the video: https://wp.me/p3RLHQ-i4X Learn more: http://docker.com and http://hpcadvisorycouncil.com Sign up for our insideHPC Newsletter: http://insidehpc.com

hpcsupercomputingdocker
Microservice API Gateways with NGINX
Microservice API Gateways with NGINXMicroservice API Gateways with NGINX
Microservice API Gateways with NGINX

Microservice API Gateways with NGINX Slides from talk given on Tuesday August 2nd, 2017 at the Denver Open Source Users Group (DOSUG). (NGINX is pronounced "engine x".) Microservices are a popular architectural solution. Clients of microservices may experience some difficulty keeping track of the various instances and endpoints they have to call. An API gateway can help manage large numbers of microservices and hide the infrastructure complexity from your clients. We will review a microservice architecture before and after the addition of an API gateway. An API gateway is a reverse proxy. A reverse proxy handles incoming requests from clients and calls a service to get the data to satisfy that request. The reverse proxy returns that data to the client. Many developers write these proxies by hand in custom code, not realizing there better solutions available. We will mention a number of popular solutions, some open source and some cloud-based services. For this talk, we will focus on NGINX, a popular open source reverse proxy and API Gateway. (NGINX also sells an enterprise offering, NGINX Plus, but this talk will only cover the features available in the open-source version.) We will show how to set up NGINX as an API Gateway. We will dive into the configuration and operation of NGINX.

microservicesapi gatewaynginx
Solution: Web sockets
●   Websocket API is a part of HTML5 spec
●   New protocol: ws:// & wss://
●   Persistant connection
●   Both parties can send data at any time
●   Native support in Chrome, Firefox, IE10
●   With node.js and socket.io you can use Web
    Sockets today

                http://socket.io/
Socket.io client & server
<script src="/socket.io/socket.io.js"></script>
<script>
  var socket = io.connect('http://localhost');
  socket.on('news', function (data) {
    console.log(data);
  });
</script>
------------------------------------------------
-
var io = require('socket.io').listen(80);

io.sockets.on('connection', function (socket) {
  socket.emit('news', { hello: 'world' });
});
Combining Drupal, Node.
  js and Web sockets
       When and how?
When should I consider it?
● Doing it all on Apache & Drupal becomes too
  expensive and unscalable
  ○   Chat, messaging
  ○   Liveblog
  ○   Streaming data (logs, etc...)
  ○   API layer for a mobile app
  ○   Realtime widgets (sports, stocks)
  ○   Games
  ○   etc...

Recommended for you

Abc of docker
Abc of dockerAbc of docker
Abc of docker

The document discusses Docker, a container management service that allows applications and dependencies to be shipped in lightweight executable packages called containers. It describes how Docker can be used for fast and consistent application delivery, responsive deployment and scaling, and running more workloads on the same hardware. Key Docker features include being easily scalable, enabling faster configuration and increased productivity, reducing infrastructure costs, and providing application isolation. The document also covers Docker architecture, objects like images and containers, and benefits such as cost savings, rapid deployment, simplicity and security. It notes some limitations and provides important links for additional information.

dockerbasic of docker
Working with kubernetes
Working with kubernetesWorking with kubernetes
Working with kubernetes

Providing introduction to kubernetes, various components and architecture. intended for beginers looking to understand the basics, evaluating kubernetes. Also talks about the alternatives such as Swarm, Diego, Nomad etc. Information on resource monitoring using kubernetes using heapster and cAdvisor

cluster managementgifeecloud
Node js
Node jsNode js
Node js

Node.js is an asynchronous event-driven JavaScript runtime that uses non-blocking I/O to build scalable network applications. It allows for the creation of web servers and networking tools using a event-driven, non-blocking I/O model rather than the traditional threaded model. Node.js is popular because it uses JavaScript and allows code reuse on both the server-side and client-side, offers high performance and scalability for real-time applications, and has a large passionate community supporting its use.

How?
● A: Write your own Node server
  ○ Write your own module code for Drupal
  ○ Write your own client code


● B: Build on the existing Drupal nodejs
  module
  ○ provides node.js server with socket.io support
  ○ provides a drupal module that integrates with it
  ○ focuses mainly on realtime updates

            http://drupal.org/project/nodejs
nodejs module for Drupal
Enables realtime communication
  Provides a module



    Drupal                                           Client
                                                     Clients



                      Node.js & socket.io
                          Provides a server script
Broadcast messages

Recommended for you

GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime Web

Talks about how Node.js and Socket.io are changing the way how Realtime apps are being developed today .

realtime webnode.jssocket.io
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin Shanghai

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, especially for real-time web applications with many concurrent connections. The document discusses why Node.js uses an asynchronous and non-blocking model, why JavaScript was chosen as the language, and why the V8 engine is fast. It also explains why Node.js is threadless and memory efficient. Finally, it notes that the Node.js community is very active and creative.

nodejs
Why Node.js
Why Node.jsWhy Node.js
Why Node.js

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, especially for real-time web applications with many concurrent connections. The document discusses why Node.js uses an asynchronous and non-blocking model, why JavaScript was chosen as the language, and why the V8 engine is fast. It also explains why Node.js is threadless and memory efficient. Finally, it notes that the Node.js community is very active and creative.

node.jsnodecomet
Update Watchdog page realtime
Your custom module
 $message = (object) array(
    'broadcast' => TRUE,
    'data' => (object) array(
       'subject' => 'Hi!',
       'body' => 'An important message!',
    ),
    'channel' => 'my_channel',
 );
 nodejs_enqueue_message($message);
And the client side implementation
Drupal.nodejs.callbacks.example = {
  callback: function(message) {
    if (message.channel == "my_channel") {
      alert(message.data);
    }
  }
}
Thank you!

Recommended for you

Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js

Node.js and MongoDB are a good fit as MongoDB provides a high-fidelity data store for Node.js applications. To get started quickly, use Nave to manage Node.js versions, npm to manage packages, Express as a web framework, Mongoose as an ODM, and EJS for templating. Key steps include setting up Bootstrap, adding authentication with Mongoose-Auth, and defining schemas like a Link schema for data.

node.js node mongodb mongodc
Nodejs
NodejsNodejs
Nodejs

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It allows JavaScript to be used for server-side scripting, enabling developers to write scalable network applications using JavaScript. Some key features of Node.js include non-blocking I/O calls, asynchronous programming, and an event loop that handles concurrency. Popular uses of Node.js include real-time web applications with websockets, fast file uploads, and any application requiring real-time data processing.

node.jsnodejsnode
Nodejs
NodejsNodejs
Nodejs

This document provides an overview of server-side JavaScript using Node.js in 3 sentences or less: Node.js allows for the development of server-side applications using JavaScript and non-blocking I/O. It introduces some theory around event loops and asynchronous programming in JavaScript. The document includes examples of building HTTP and TCP servers in Node.js and connecting to MongoDB, as well as when Node.js may and may not be suitable.

nodejs scripting language
Developing realtime apps with Drupal and NodeJS

More Related Content

What's hot

OpenStack and Kubernetes - A match made for Telco Heaven
OpenStack and Kubernetes - A match made for Telco HeavenOpenStack and Kubernetes - A match made for Telco Heaven
OpenStack and Kubernetes - A match made for Telco Heaven
Trinath Somanchi
 
Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...
Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...
Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...
Anoop Ramachandran
 
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys MeetupsMuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
Angel Alberici
 
Canonical Ubuntu OpenStack Overview Presentation
Canonical Ubuntu OpenStack Overview PresentationCanonical Ubuntu OpenStack Overview Presentation
Canonical Ubuntu OpenStack Overview Presentation
The World Bank
 
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Edureka!
 
Integrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and CamelIntegrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and Camel
Claus Ibsen
 
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain. What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
Kellton Tech Solutions Ltd
 
Kasten K10 Data Management in Kubernetes
Kasten K10 Data Management in KubernetesKasten K10 Data Management in Kubernetes
Kasten K10 Data Management in Kubernetes
Sarra Sassi
 
Mutiny + quarkus
Mutiny + quarkusMutiny + quarkus
Mutiny + quarkus
Edgar Domingues
 
Integrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetesIntegrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetes
Claus Ibsen
 
Building Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Building Multi-Site and Multi-OpenStack Cloud with OpenStack CascadingBuilding Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Building Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Joe Huang
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Frederik Mogensen
 
Docker
DockerDocker
Kafka Quotas Talk at LinkedIn
Kafka Quotas Talk at LinkedInKafka Quotas Talk at LinkedIn
Kafka Quotas Talk at LinkedIn
Aditya Auradkar
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
Peng Xiao
 
Ansible
AnsibleAnsible
Ansible
Raul Leite
 
Linux Container Technology 101
Linux Container Technology 101Linux Container Technology 101
Linux Container Technology 101
inside-BigData.com
 
Microservice API Gateways with NGINX
Microservice API Gateways with NGINXMicroservice API Gateways with NGINX
Microservice API Gateways with NGINX
Geoffrey Filippi
 
Abc of docker
Abc of dockerAbc of docker
Abc of docker
shohan_slideshare
 
Working with kubernetes
Working with kubernetesWorking with kubernetes
Working with kubernetes
Nagaraj Shenoy
 

What's hot (20)

OpenStack and Kubernetes - A match made for Telco Heaven
OpenStack and Kubernetes - A match made for Telco HeavenOpenStack and Kubernetes - A match made for Telco Heaven
OpenStack and Kubernetes - A match made for Telco Heaven
 
Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...
Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...
Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...
 
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys MeetupsMuleSoft Runtime Fabric (RTF): Foundations  : MuleSoft Virtual Muleys Meetups
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
 
Canonical Ubuntu OpenStack Overview Presentation
Canonical Ubuntu OpenStack Overview PresentationCanonical Ubuntu OpenStack Overview Presentation
Canonical Ubuntu OpenStack Overview Presentation
 
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
 
Integrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and CamelIntegrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and Camel
 
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain. What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
 
Kasten K10 Data Management in Kubernetes
Kasten K10 Data Management in KubernetesKasten K10 Data Management in Kubernetes
Kasten K10 Data Management in Kubernetes
 
Mutiny + quarkus
Mutiny + quarkusMutiny + quarkus
Mutiny + quarkus
 
Integrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetesIntegrating microservices with apache camel on kubernetes
Integrating microservices with apache camel on kubernetes
 
Building Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Building Multi-Site and Multi-OpenStack Cloud with OpenStack CascadingBuilding Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Building Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker
DockerDocker
Docker
 
Kafka Quotas Talk at LinkedIn
Kafka Quotas Talk at LinkedInKafka Quotas Talk at LinkedIn
Kafka Quotas Talk at LinkedIn
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Ansible
AnsibleAnsible
Ansible
 
Linux Container Technology 101
Linux Container Technology 101Linux Container Technology 101
Linux Container Technology 101
 
Microservice API Gateways with NGINX
Microservice API Gateways with NGINXMicroservice API Gateways with NGINX
Microservice API Gateways with NGINX
 
Abc of docker
Abc of dockerAbc of docker
Abc of docker
 
Working with kubernetes
Working with kubernetesWorking with kubernetes
Working with kubernetes
 

Similar to Developing realtime apps with Drupal and NodeJS

Node js
Node jsNode js
Node js
Chirag Parmar
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime Web
Bhagaban Behera
 
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin Shanghai
Jackson Tian
 
Why Node.js
Why Node.jsWhy Node.js
Why Node.js
guileen
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
async_io
 
Nodejs
NodejsNodejs
Nodejs
NodejsNodejs
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
Jibanananda Sana
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
Khaled Mosharraf
 
End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013
Alexandre Morgaut
 
Nodejs overview
Nodejs overviewNodejs overview
Nodejs overview
Nicola Del Gobbo
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
Richard Rodger
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
Kalp Corporate
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Vikash Singh
 
Node azure
Node azureNode azure
Node azure
Emanuele DelBono
 
JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.js
Rody Middelkoop
 
Node.js: A Guided Tour
Node.js: A Guided TourNode.js: A Guided Tour
Node.js: A Guided Tour
cacois
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
David Padbury
 
Node.js on Azure
Node.js on AzureNode.js on Azure
Node.js on Azure
Sasha Goldshtein
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
orkaplan
 

Similar to Developing realtime apps with Drupal and NodeJS (20)

Node js
Node jsNode js
Node js
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime Web
 
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin Shanghai
 
Why Node.js
Why Node.jsWhy Node.js
Why Node.js
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Nodejs
NodejsNodejs
Nodejs
 
Nodejs
NodejsNodejs
Nodejs
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013
 
Nodejs overview
Nodejs overviewNodejs overview
Nodejs overview
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Node azure
Node azureNode azure
Node azure
 
JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.js
 
Node.js: A Guided Tour
Node.js: A Guided TourNode.js: A Guided Tour
Node.js: A Guided Tour
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
 
Node.js on Azure
Node.js on AzureNode.js on Azure
Node.js on Azure
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 

More from drupalcampest

Advanced theming
Advanced themingAdvanced theming
Advanced theming
drupalcampest
 
Welcome to Drupalcamp Estonia 2012
Welcome to Drupalcamp Estonia 2012Welcome to Drupalcamp Estonia 2012
Welcome to Drupalcamp Estonia 2012
drupalcampest
 
Implementing Drupalcamp sites
Implementing Drupalcamp sitesImplementing Drupalcamp sites
Implementing Drupalcamp sites
drupalcampest
 
Designing Drupalcamp sites
Designing Drupalcamp sitesDesigning Drupalcamp sites
Designing Drupalcamp sites
drupalcampest
 
Drupal vs. the Others
Drupal vs. the OthersDrupal vs. the Others
Drupal vs. the Others
drupalcampest
 
Migrating University of Tartu websites to Drupal
Migrating University of Tartu websites to DrupalMigrating University of Tartu websites to Drupal
Migrating University of Tartu websites to Drupal
drupalcampest
 
Drupalcamp Tallinn - Drupal 8
Drupalcamp Tallinn - Drupal 8Drupalcamp Tallinn - Drupal 8
Drupalcamp Tallinn - Drupal 8
drupalcampest
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
drupalcampest
 
Drupalcamp Estonia - Drupal 7
Drupalcamp Estonia - Drupal 7Drupalcamp Estonia - Drupal 7
Drupalcamp Estonia - Drupal 7
drupalcampest
 
Drupalcamp Estonia - Introduction to Drupal
Drupalcamp Estonia - Introduction to DrupalDrupalcamp Estonia - Introduction to Drupal
Drupalcamp Estonia - Introduction to Drupal
drupalcampest
 
Drupalcamp Estonia 2011 - Welcome
Drupalcamp Estonia 2011 - WelcomeDrupalcamp Estonia 2011 - Welcome
Drupalcamp Estonia 2011 - Welcome
drupalcampest
 

More from drupalcampest (11)

Advanced theming
Advanced themingAdvanced theming
Advanced theming
 
Welcome to Drupalcamp Estonia 2012
Welcome to Drupalcamp Estonia 2012Welcome to Drupalcamp Estonia 2012
Welcome to Drupalcamp Estonia 2012
 
Implementing Drupalcamp sites
Implementing Drupalcamp sitesImplementing Drupalcamp sites
Implementing Drupalcamp sites
 
Designing Drupalcamp sites
Designing Drupalcamp sitesDesigning Drupalcamp sites
Designing Drupalcamp sites
 
Drupal vs. the Others
Drupal vs. the OthersDrupal vs. the Others
Drupal vs. the Others
 
Migrating University of Tartu websites to Drupal
Migrating University of Tartu websites to DrupalMigrating University of Tartu websites to Drupal
Migrating University of Tartu websites to Drupal
 
Drupalcamp Tallinn - Drupal 8
Drupalcamp Tallinn - Drupal 8Drupalcamp Tallinn - Drupal 8
Drupalcamp Tallinn - Drupal 8
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
 
Drupalcamp Estonia - Drupal 7
Drupalcamp Estonia - Drupal 7Drupalcamp Estonia - Drupal 7
Drupalcamp Estonia - Drupal 7
 
Drupalcamp Estonia - Introduction to Drupal
Drupalcamp Estonia - Introduction to DrupalDrupalcamp Estonia - Introduction to Drupal
Drupalcamp Estonia - Introduction to Drupal
 
Drupalcamp Estonia 2011 - Welcome
Drupalcamp Estonia 2011 - WelcomeDrupalcamp Estonia 2011 - Welcome
Drupalcamp Estonia 2011 - Welcome
 

Recently uploaded

Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
Larry Smarr
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Erasmo Purificato
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 

Recently uploaded (20)

Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 

Developing realtime apps with Drupal and NodeJS

  • 2. About myself Ivo Nellis CTO, Fenomen Veebiagentuur ● Working with Drupal since 2007 ● Contributed mostly to Estonian translations ● Main focus: Drupal, Node.js, MongoDB Skype: ivonellis Twitter: ivonellis ivo@fenomen.ee
  • 3. Developing realtime apps with Node.js and Drupal Ivo Nellis Fenomen veebiagentuur
  • 4. With Node.js, you can write web applications Perfect for fast, scalable, light-weight data- intensive and real-time web applications
  • 5. Node.js project is new Relatively...
  • 6. 1990 2000 2010 Node.js Ruby on Rails ASP.NET Java PHP Python Perl Created 2009 by Ryan Dahl
  • 7. With node, you can write in JavaScript or in something that compiles to JS (CoffeeScript, ...)
  • 8. Server-side JavaScript is great! ● JavaScript is the core of modern Web ○ A lot of existing JS developers ○ Familiarity with asynchronous programming model ● Share code between client and server ○ Can use existing libraries on server side as well. ● It's fast ... and it's getting faster every day ○ Huge competition between browser vendors
  • 9. But SSJS has been done before.. Jaxer Rhino Ringo Ejscript Spludo LiveWire
  • 10. Node.js is built on Google V8 JS engine Fast, Single runtime = less compability issues
  • 11. Node.js is asynchronous & event driven and it's great for real-time apps
  • 12. Apache request lifecycle Incoming requests Child processes / threads
  • 13. The cost of I/O L1-cache 3 cycles L2-cache 14 cycles RAM 250 cycles Disk 41 000 000 cycles Network 240 000 000 cycles http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/ http://duartes.org/gustavo/blog/post/what-your-computer-does-while-you-wait
  • 14. Node.js event loop Incoming requests I/O callback I/O request Single process
  • 15. Hello World! var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': text/plain'}); res.end('Hello Worldn'); }).listen(8000); ● Node itself does not provide much ● No "standard" webserver features: ● No authentication ● No session handling ● No cookies ● No email ● No templating system ● No MVC or framework layer
  • 16. You need to extend ● Active community ● Node package manager (npm) is great ● 10913 packages as of 06/2012 ● Simple one-line installation ● Manages all the dependencies for you $ npm install express var express = require("express");
  • 17. express mongodb-native connect socket.io redis request nodemailer jquery underscore calipso async https://github.com/joyent/node/wiki/Modules search.npmjs.org github.com
  • 18. Node.js vs Drupal CMS Modules, themes, ... Libraries ... Calipso / etc... Framework Drupal Express.js LIB Connect.js Scripting language PHP Node.js Web Server Apache
  • 19. Web sockets and socket.io
  • 20. Realtime communication over HTTP is difficult HTTP is request - response by nature No good solutions (ajax, long polling)
  • 21. Solution: Web sockets ● Websocket API is a part of HTML5 spec ● New protocol: ws:// & wss:// ● Persistant connection ● Both parties can send data at any time ● Native support in Chrome, Firefox, IE10 ● With node.js and socket.io you can use Web Sockets today http://socket.io/
  • 22. Socket.io client & server <script src="/socket.io/socket.io.js"></script> <script> var socket = io.connect('http://localhost'); socket.on('news', function (data) { console.log(data); }); </script> ------------------------------------------------ - var io = require('socket.io').listen(80); io.sockets.on('connection', function (socket) { socket.emit('news', { hello: 'world' }); });
  • 23. Combining Drupal, Node. js and Web sockets When and how?
  • 24. When should I consider it? ● Doing it all on Apache & Drupal becomes too expensive and unscalable ○ Chat, messaging ○ Liveblog ○ Streaming data (logs, etc...) ○ API layer for a mobile app ○ Realtime widgets (sports, stocks) ○ Games ○ etc...
  • 25. How? ● A: Write your own Node server ○ Write your own module code for Drupal ○ Write your own client code ● B: Build on the existing Drupal nodejs module ○ provides node.js server with socket.io support ○ provides a drupal module that integrates with it ○ focuses mainly on realtime updates http://drupal.org/project/nodejs
  • 27. Enables realtime communication Provides a module Drupal Client Clients Node.js & socket.io Provides a server script
  • 30. Your custom module $message = (object) array( 'broadcast' => TRUE, 'data' => (object) array( 'subject' => 'Hi!', 'body' => 'An important message!', ), 'channel' => 'my_channel', ); nodejs_enqueue_message($message);
  • 31. And the client side implementation Drupal.nodejs.callbacks.example = { callback: function(message) { if (message.channel == "my_channel") { alert(message.data); } } }