Deploying Node.js at scale
A developer journey
@lucamaraschi
@matteocollina
DISCLAIMER
Nobody in this story, and no outfit or corporation, is
based upon an actual person or outfit in the real world.
The tale we are going to tell is completely fictional, but
based upon the combined experiences of the speakers
in building Node.js applications.
Meet bob
He is a .LAVA developer
He writes applications on the L2EE
stack, using SQLobster as a
database.
Bob reads:
Such speed
So enterprise
Wow JS
Bob decides:
Let’s rewrite my HUGE application in node.js
Using the MEAN stack
.js
How do I deploy my Javascript monolith?
I read StackOverflow!
SSH into the virtual machine
● snowflake servers
● git clone
● forever!
No Integration tests, but 100%
code coverage
The new product has huge success
Bob is happy
And the performance fall
Bob is SAAD
Such speed
So enterprise
Wow JS
But my schema is relational...
One MongoDB collection for Student
One MongoDB collection for Email populate
Facts
MongoDB has no
concept of relationship
We need relationships
in our application
Let’s build a JOIN
engine inside our
application!
Taken from the Mongoose website
Facts
MongoDB has no
concept of relationship
We need relationships
in our application
Let’s build a JOIN
engine inside our
application!
Let’s do TWO queries
to Mongo
If we used find() instead
of findOne(), we would
have done 1+N queries
Taken from the Mongoose website
NoSQL is hard!
Relational vs. NoSQL
It is not Node fault!
Deduplication is accepted
Don’t shoot in your own foot
{
"name": "Matteo",
"surname": "Collina",
"phone": "+39 347123456",
"emails": [{
"type": "university",
"address": "matteo.collina@unibo.
it"
}]
}
The fixed product has huge success
Bob is happy
again
...but my servers stop responding!!!!
Such speed
So enterprise
Wow JS
Exhausted file descriptors
Every incoming HTTP request is a file descriptor
Every outgoing HTTP request is a file descriptor
1. You receive an HTTP request call to /faulty
2. In faulty, you call service A on /doSomething
3. You pipe the result of /doSomething to the HTTP response
4. An error happens, and you do not close the HTTP response
Fixed amount
Exhausted file descriptors: solution
Replace a.pipe(b)
With pump(a, b)
We are back online!
Bob is happy
again
again
● Scaling the development team
from 1 (Bob) to 5
● Delivering more features in less
time
● 1000 unit tests!
● Serve more customers!
But the Business
(always) wants more...
Such speed
So enterprise
Wow JS
The new team
does not deliver
Bob is SAAD
MVC architecture
Really monolithic
Adding a feature means
changing all “layers” in an
application
Does not scale with the
team size
Equivalent VMs need to be
dimensioned to handle the
most demanding feature
Don’t push anything
till tomorrow..
Developing with modules
Really monolithic
Adding a feature means
changing all “layers” in an
application
Does not scale with the
team size up to a certain
point
Equivalent VMs need to be
dimensioned to handle the
most demanding feature
Productivity goes up again!
Bob is happy
again
again
again
● Scaling the development team
from 5 to 20
● Delivering even more features
in less time
● 10000 unit tests!
● Serve more customers!
But the Business
(always) wants more...
The NEW
new team
does not deliver
Bob is
DESPERATE
===
===
++
distribution
Missing Resiliency
Fault tolerance
&&
A pre-made “stack” might not be good
Let’s throw
everything away...
But .LAVA42 does it better! ;-)
Hipsters use
microservices
Such
modularity
So enterprise
Wow micro
Very
service
Microservices architecture
Really monolithic
Adding a feature means
changing all “layers” in an
application
Does not scale with the
team size up to a certain
point
Equivalent VMs need to be
dimensioned to handle the
most demanding feature
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Queue in between
How we discover the queues?
How are the back channels / response handled?
The answer to
life
universe,
and everything
The answer to
life
universe,
and everything
The answer to
everything is
service discovery
Discovery with DNS:
Meet Consul
Etcd… but CoreOS
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Scalable
Weakly consistent
Infection style
Membership protocol
● Weakly consistent vs.
strongly consistent
● Bornt for distributed
systems
● Failure detection over
the cluster
● Information
dissemination
● Equally distribution of
the workload
Advantages
Such
consistency
So infectious
Wow failure
detection
Very
distributed
Common implementations
Hashicorp SERF
If you are into GO
mrhooray/swim-js
If you are into JS ;-)
But a new cluster node is added...
How to rebalance the cluster topology?
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Consistent hashring
PROBLEM
How can I find a server over
an unstable network?
SOLUTION
Each server and keys are
hashed in a circular
hashspace
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Advantages
● Easier to avoid
hotspots
● Enable partitioning
● Predictable elasticity
● Easy replication
● Scalability and
Availability
● Local state
mcollina/upring
What if Bob was working for Uber? ;-)
Application-level sharding
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
The fourth secret of Fatima
“Hyperbahn enables service discovery and routing for large-scale systems
comprised of many microservices. Distributed, fault tolerant, and highly available,
it lets one service find and communicate with others simply and reliably without
having to know where those services run.”
Featuring...
● Configuration
Discovery
● Retries
● Load Balancing
● Rate Limiting
● Circuit Breaking
● Distributed tracing
But what about HTTP?
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
TChannel is a networking framing protocol used for general
RPC, supporting out-of-order responses at extremely high
performance where intermediaries can make a forwarding
decision quickly
Tracing as a first class resident...
https://github.com/openzipkin/zipkin
WHY RPC?
Functions
Distributed
Clustered
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Operation Complexity
...but kills
DEVELOPMENT
WORKFLOW
“SERVERLESS”
is the new Hipster
Such servers
So hipster
Wow functions
Very
reactive
“FUNCTIONAL”
is the new Hipster
“DISTRIBUTED FUNCTIONS”
are the future!
Don’t be too late!
@lucamaraschi
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
matteo.collina@nearform.com
luca.maraschi@nearform.com
Conclusions
● Think about choosing a technology
● Node.js works at scale
● You can implement any architecture with Node.js

More Related Content

KEY
Why I Love TorqueBox (And Why You Will Too)
PPTX
A Tale of Two Apps
KEY
Scale like a pro with Gearman
PPTX
Gearman, Supervisor and PHP - Job Management with Sanity!
PPTX
Using Doctrine Migrations to Synchronize Databases
PPTX
Click’n’Deploy | SuperSpeakers @CodeCamp Iasi, 2014
PDF
Andrii Shumada "No excuses for not writing tests"
PDF
Improve the deployment process step by step
Why I Love TorqueBox (And Why You Will Too)
A Tale of Two Apps
Scale like a pro with Gearman
Gearman, Supervisor and PHP - Job Management with Sanity!
Using Doctrine Migrations to Synchronize Databases
Click’n’Deploy | SuperSpeakers @CodeCamp Iasi, 2014
Andrii Shumada "No excuses for not writing tests"
Improve the deployment process step by step

What's hot (20)

PDF
Madison PHP 2015 - DevOps For Small Teams
PDF
Web Leaps Forward
PPTX
vBrownBag DevOps Series: Puppetinabox
PDF
Background processes and tasks in an async world
PDF
Continuous Delivery in Java
PDF
Node & Express as Workflow Tools
PDF
WebRTC - Brings Real-Time to the Web
PDF
PDF
Tipping the scale - Eyal Eizenberg - Wix
PDF
Intro to React
PDF
Converting LotusScript Agents to Java Agents
PDF
Rapid Digital Innovation: How Node.js Delivers
PDF
High Productivity Web Development Workflow
PDF
Viktor Turskyi "Effective NodeJS Application Development"
PDF
DevOps For Small Teams
PDF
Isomorphic web application
PPTX
Engage 2019 - De04. Java with Domino After XPages
PPTX
Aspect oriented programming
PDF
The Web We Weave :: How Web Developers Think About Performance
PDF
The Shape of Speed
Madison PHP 2015 - DevOps For Small Teams
Web Leaps Forward
vBrownBag DevOps Series: Puppetinabox
Background processes and tasks in an async world
Continuous Delivery in Java
Node & Express as Workflow Tools
WebRTC - Brings Real-Time to the Web
Tipping the scale - Eyal Eizenberg - Wix
Intro to React
Converting LotusScript Agents to Java Agents
Rapid Digital Innovation: How Node.js Delivers
High Productivity Web Development Workflow
Viktor Turskyi "Effective NodeJS Application Development"
DevOps For Small Teams
Isomorphic web application
Engage 2019 - De04. Java with Domino After XPages
Aspect oriented programming
The Web We Weave :: How Web Developers Think About Performance
The Shape of Speed
Ad

Viewers also liked (20)

PDF
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017
PDF
Does Your Web App Speak Schadenfreude? - Greg Rewis - Codemotion Rome 2017
PDF
Reactive MVP - Giorgio Natili - Codemotion Rome 2017
PDF
Community in a nutshell for developers - Alessio Fattorini - Codemotion Rome ...
PDF
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017
PDF
Webhooks do's and dont's: what we learned after integrating +100 APIs - Giuli...
PDF
Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017
PDF
Component-Based UI Architectures for the Web - Andrew Rota - Codemotion Rome...
PDF
Kunos Simulazioni and Assetto Corsa, behind the scenes- Alessandro Piva, Fabr...
PDF
Invader Studios: sviluppatori da “Incubo” - Tiziano Bucci - Codemotion Rome ...
PPTX
Cyber Security in Multi Cloud Architecture - Luca Di Bari - Codemotion Rome 2017
PDF
Docker Inside/Out: the ‘real’ real-world of stacking containers in production...
ODP
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
PDF
Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...
PDF
Barbarians at the Gate(way) - Dave Lewis - Codemotion Rome 2017
PDF
Galateo semi-serio dell'Open Source - Luigi Dell' Aquila - Codemotion Rome 2017
PDF
Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...
PPTX
Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...
PDF
Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017
PDF
Handle insane devices traffic using Google Cloud Platform - Andrea Ulisse - C...
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017
Does Your Web App Speak Schadenfreude? - Greg Rewis - Codemotion Rome 2017
Reactive MVP - Giorgio Natili - Codemotion Rome 2017
Community in a nutshell for developers - Alessio Fattorini - Codemotion Rome ...
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017
Webhooks do's and dont's: what we learned after integrating +100 APIs - Giuli...
Web Based Virtual Reality - Tanay Pant - Codemotion Rome 2017
Component-Based UI Architectures for the Web - Andrew Rota - Codemotion Rome...
Kunos Simulazioni and Assetto Corsa, behind the scenes- Alessandro Piva, Fabr...
Invader Studios: sviluppatori da “Incubo” - Tiziano Bucci - Codemotion Rome ...
Cyber Security in Multi Cloud Architecture - Luca Di Bari - Codemotion Rome 2017
Docker Inside/Out: the ‘real’ real-world of stacking containers in production...
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...
Barbarians at the Gate(way) - Dave Lewis - Codemotion Rome 2017
Galateo semi-serio dell'Open Source - Luigi Dell' Aquila - Codemotion Rome 2017
Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...
Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...
Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017
Handle insane devices traffic using Google Cloud Platform - Andrea Ulisse - C...
Ad

Similar to Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016 (20)

PPTX
Microservices with Node and Docker
PDF
Divide and Conquer – Microservices with Node.js
PDF
The Happy Path: Migration Strategies for Node.js
PDF
API Microservices with Node.js and Docker
PPTX
Tef con2016 (1)
PPTX
Node.js meetup at Palo Alto Networks Tel Aviv
PDF
Introduction to Node.js
KEY
Practical Use of MongoDB for Node.js
PPTX
Microservices architecture
PDF
Node and Micro-Services at IBM
PDF
node.js and Containers: Dispatches from the Frontier
PDF
NodeJS @ ACS
PDF
node.js, javascript and the future
PDF
Introduction to Node.js
PPTX
Node.js: The What, The How and The When
PDF
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
PDF
Node.js - A Quick Tour
PDF
Slaying Monoliths with Node and Docker
PPTX
Impress Application Server for node.js (en)
PDF
What they don't tell you about micro-services
Microservices with Node and Docker
Divide and Conquer – Microservices with Node.js
The Happy Path: Migration Strategies for Node.js
API Microservices with Node.js and Docker
Tef con2016 (1)
Node.js meetup at Palo Alto Networks Tel Aviv
Introduction to Node.js
Practical Use of MongoDB for Node.js
Microservices architecture
Node and Micro-Services at IBM
node.js and Containers: Dispatches from the Frontier
NodeJS @ ACS
node.js, javascript and the future
Introduction to Node.js
Node.js: The What, The How and The When
Jeremy Edberg (MinOps ) - How to build a solid infrastructure for a startup t...
Node.js - A Quick Tour
Slaying Monoliths with Node and Docker
Impress Application Server for node.js (en)
What they don't tell you about micro-services

More from Codemotion (20)

PDF
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
PDF
Pompili - From hero to_zero: The FatalNoise neverending story
PPTX
Pastore - Commodore 65 - La storia
PPTX
Pennisi - Essere Richard Altwasser
PPTX
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
PPTX
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
PPTX
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
PPTX
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
PDF
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
PDF
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
PDF
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
PDF
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
PDF
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
PDF
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
PPTX
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
PPTX
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
PDF
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
PDF
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
PDF
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
PDF
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Pompili - From hero to_zero: The FatalNoise neverending story
Pastore - Commodore 65 - La storia
Pennisi - Essere Richard Altwasser
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019

Recently uploaded (20)

PDF
Zenith AI: Advanced Artificial Intelligence
PPT
Geologic Time for studying geology for geologist
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
STKI Israel Market Study 2025 version august
PDF
Unlock new opportunities with location data.pdf
DOCX
search engine optimization ppt fir known well about this
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Getting Started with Data Integration: FME Form 101
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Architecture types and enterprise applications.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
Tartificialntelligence_presentation.pptx
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Hybrid model detection and classification of lung cancer
PDF
August Patch Tuesday
Zenith AI: Advanced Artificial Intelligence
Geologic Time for studying geology for geologist
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
STKI Israel Market Study 2025 version august
Unlock new opportunities with location data.pdf
search engine optimization ppt fir known well about this
NewMind AI Weekly Chronicles – August ’25 Week III
Developing a website for English-speaking practice to English as a foreign la...
Getting Started with Data Integration: FME Form 101
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Univ-Connecticut-ChatGPT-Presentaion.pdf
Architecture types and enterprise applications.pdf
A novel scalable deep ensemble learning framework for big data classification...
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Hindi spoken digit analysis for native and non-native speakers
Tartificialntelligence_presentation.pptx
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
1 - Historical Antecedents, Social Consideration.pdf
Hybrid model detection and classification of lung cancer
August Patch Tuesday

Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016