Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Building a Firehose with NodeJS
Search
Luca Grulla
April 23, 2012
Technology
140
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Building a Firehose with NodeJS
August 2011 Forward First Tuesday - building a firehose in nodeJS
Luca Grulla
April 23, 2012
More Decks by Luca Grulla
See All by Luca Grulla
JavaScriptTesting
lucagrulla
1
1.2k
Il grande bluff delle stime
lucagrulla
0
360
Other Decks in Technology
See All in Technology
2026TECHFRESH畢業分享會 - Lightning Talk - 打造精準高效的 MCP 設計模式與測試實務
line_developers_tw
PRO
0
890
失敗を経て、Harness Engineering で 大切にしたいことを考える / Learning from Failure: What Matters in Harness Engineering
bitkey
PRO
1
340
MIERUNE JCT 発表資料「宇宙から伊能忠敬ごっこ」
syuchimu
0
210
失敗を資産に変えるClaude Code
shinyasaita
0
590
SONiC Scale-Up Working Group から探る Scale-UpやUltraEthernet機能の実装方法
ebiken
PRO
2
140
Microsoft Build Keynoteふりかえり
tomokusaba
0
120
やさしいA2A入門
minorun365
PRO
12
1.8k
protovalidate-es を導入してみた
bengo4com
0
180
[モダンアプリ勉強会]今更聞けないGit/GitHub入門
tsukuboshi
0
370
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
240
フロンティアAIのゲート化と地政学リスク
nagatsu
0
130
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.9k
Featured
See All Featured
New Earth Scene 8
popppiees
3
2.3k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
It's Worth the Effort
3n
188
29k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
420
WENDY [Excerpt]
tessaabrams
11
38k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
170
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
140
sira's awesome portfolio website redesign presentation
elsirapls
0
280
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Un-Boring Meetings
codingconduct
0
310
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Transcript
Firehose Building a real-‐1me data stream with NodeJS
Luca Grulla@Forward London, 2/8/2011
Introduc1on Or what we wanted to build
We like to have a (near) real-‐1me view of
the data stream
Resilient
Scalable
Accurate (but not necessarily precise)
None
Verse and Chorus Or how we built it
Stack • NodeJS (0.4.9) • CoffeeScript •
ZeroMQ
Architecture
Interlude Or joys and pi4alls of building a tail
library for node
Living the asynchronous dream
Living the asynchronous dream • Error manifests itself
only at high throughput (7MB/secs) • The few implementa1ons you can find around are wrong (including Log.io – we are planning to contribute back)
Breathing in an asynchronous way
Learnings • You need to think asynchronous to write
asynchronous code • Dispatch internal events if you need to keep control of the flow • “Internal queues” to scale(up to a certain limit)
Performance • Beyond 5MB we start to fill the
internal queue • We are limited by IO, not from CPU/memory • Consistent throughput
Solo Or a short rant on declara<ve vs
impera<ve style
Event-‐driven approach • Event-‐driven is implicitly declara1ve – You
tell to the world that something just happened and do not care of what next • Fire events instead of passing around states – It’s cleaner – It’s simpler to maintain – It’s idioma1c
None
Ques1ons ?
References • npm install tail • hhps://github.com/forward/node-‐tail