1. Shubhra Kar | Products & Education
twitter:@shubhrakar mail:skar@strongloop.com
Frameworks or a Design Pattern ?
2. These guys sent me !
Bert
Belder
Ben
Noordhuis
Node Core
Raymond
Feng
Ritchie
Martori
LoopBack / Express Core
Sam
Roberts
Miroslav
Bajtos
Ryan
Graham
Plus 15 other full-time open source
developers working on Node.js core,
modules and tools.
Contributing to over 100 open source
modules.
Supporting banks, retail, IoT companies,
startups and internet companies on Node.js
3. Patterns are not created, they evolve
Right Now
— Someone on Stage
18. REST
API
PUSH
GEO
OFF
SYNC
DEVICE
USER FILE
Relational Database Clustered Database Security Gateway Cloud
Laptop ( not requested but useful)
Connections
Tablet Phone IoT SDK API SERVER
Quick Example of Use
App S
Add
App Server
Storage
Relational Database Clustered Database Security Gateway Cloud Firewall SOA Bus ( not sure on this one)
Laptop ( not requested but useful)
Connections
Tablet Phone IoT SDK API SERVER Items for ACL
Quick Example of Use
App Server
Add On
App Server
REST
API
GATEWAY
Channel SDKs
API ENGINE
C
O
N
N
E
C
T
O
R
s
A
P
I
S
D
K
s
Loopback open source Enterprise ORM framework
REST API
atabase Security Gateway Cloud Firewall SOA Bus ( not sure on this one)
Phone IoT SDK API SERVER Items for ACL
Quick Example of Use
App Server
Add On
App Server
API
Explorer
40. Blocked event loop in Meteor atmosphere
node-fibers implements co-routines. Meteor uses this to hack local thread storage allowing V8
to run multiple execution contexts each mapped to a co-routine.
FindOrAllocatePerThreadDataForThisThread() used in switching context between co-
routines
Co-routines are cooperative; the current coroutine has to yield control before another one can
run and that is what Meteor does in its process.nextTick() callback; it essentially builds
concurrent (but not parallel) green threads on a round-robin scheduler
Too many tiny tasks and not one long running one was blocking the event loop
process.nextTick() has a failsafe mechanism where it will process “x” tick callbacks before
deferring the remaining ones to the next event loop tick.
Native MongoDB driver disabled the failsafe to silence a warning message in node v0.10 about
maxtickDepth being reached
ticks parent name
2274 7.3% v8::internal::Isolate::FindOrAllocatePerThreadDataForThisThread()
1325 58.3% LazyCompile: ~<anonymous> packages/meteor.js:683
1325 100.0% LazyCompile: _tickCallback node.js:399
41. The solution
The workaround: switch fromprocess.nextTick() to setImmediate()