Slides from NodejsConf.it talk
IntegratingNode.jsinto an existingtechnology stack
View Slide
Andrew Nesbittgithub.com/andrew@teabass
forwardtechnology.co.uk
Show of hands
Benefits of Node
Legacy Systems
Benefits ofintegration
Let’s do this!
1. Standalone Tools
Command line toolsAsset minificationPixel TrackersUrl shortenersInternal toolsMonitoringChat botsExamples
Legacy AppInternal toolInternal toolInternal toolInternal tool
Easy to setupVery little integrationLittle experience neededPros
Extra dependenciesKnowledge silosCons
2. Shared databases
Connect directly existing databaseRead from a data warehouseShare data with a key-value storeExamples
Legacy AppDBNode
Quick and dirtyAdapters for almost every DB availableSlow databases not a problemPros
Duplicating domain logicRace-conditionsYour DBA will likely hate youCons
3. Using APIs
Use API from existing applicationLinkedin MobileGithub DownloadsExamples
Avoid duplication of domain logicJSON APIs are lovely to work withPlays to Nodes strengthsPros
Extra load on existing applicationMight have to build/extend existing APIWhat if the legacy app goes down?Cons
4. Creating APIs
Websocket ServicesStreaming servicesAPIs for Mobile AppsProxy serivcesFile upload handlingEbay’s ql.ioExamples
DBNodeClients
Handle very loadLots of concurrent connectionsJSON comes naturallyPros
ConsYou now have a dependeny on NodeSystem adminstrationTeaching others about it
mysqlRailsDisc CacheNginxRedisNodeBrowserPusherhttp://live.mpora.comMpora Live
5. Message Queues
ZeroMQResqueRedis PubsubdnodeExamples
MessageQueueLegacy AppNodeLegacyWorker
6. Streams
Twitter, Facebook, SalesforceHTTP long pollingCometXMPPExamples
7. Embedding
Ruby RacerAndroidHadoop and TimothySprintstackPLV8Examples
create or replace functionfib(n int) returns int as $$function fib(n) {return n<2 ? n : fib(n-1) + fib(n-2)}return fib(n)$$ LANGUAGE plv8 IMMUTABLE STRICT;
http://pgeu-plv8.herokuapp.com
Legacy AppNode
Scripting within compiled languagesUse existing, battle tested softwareEnable Node on embedded devicesPros
Under heavy developmentYou need to know the host platformContext switching overheadCons
Take a unix-like approachDecoupled SystemsUse APIs to share dataPlay to node’s strengthsSummary
Node on Andriod - lanyrd.com/smpbgRails and Node.js - lanyrd.com/srmwrHadoop and Timothy - lanyrd.com/sttxxRhinode (Sprintstack) - lanyrd.com/srmwxThese slides - lanyrd.com/szwycLinks