lessons learned integrating drupal with nodejs/mongodb powered web services

Download Lessons Learned Integrating Drupal with nodejs/mongodb Powered Web Services

Post on 05-Dec-2014

10.413 views

Category:

Technology

4 download

Embed Size (px)

DESCRIPTION

 

TRANSCRIPT

  • 1. Drupal and Node.js Ad hoc caches & Scalable Drupal powered web services
  • 2. /about/me Founder @Chief Geek @
  • 3. Theres a module for that!
  • 4. Multiple response format (REST, XMLRPC,JSON, JSON-RPC, SOAP, AMF) Pluggeble access control Amazing integration with available modules (Views, System, node, taxonomy, authentication ... )
  • 5. but....
  • 6. If all you have is a hammer, Everything looks like a nail
  • 7. Gavris AppSmall ec2 instance1.7 GB of Ram
  • 8. All Memory - 1700MB Free Memory - 1500MB Avg Drupal process size ~ 30MB1500 / 30 = 50 Concurrent
  • 9. IntroducingNode.jsNode is a server-side JavaScript interpreterthat changes the notion of how a servershould work.Its goal is to enable a programmer to buildhighly-scalable applications and write codethat handles tens of thousands ofsimultaneous connections on one, and onlyone, physical machine.
  • 10. IntroducingNode.jsNode is a server-side JavaScript interpreter thatchanges the notion of how a server should work.Its goal is to enable a programmer to buildhighly-scalable applications and write code thathandles tens of thousands of simultaneousconnections on one, and only one, physicalmachine.
  • 11. IntroducingNode.js Built on the V8 engine (chromes veryfast browser engine). Can handle thousands of concurrentconnections with minimal overhead. Ability to share code between server andclient Vibrant Community Great package management (npm)
  • 12. All Memory - 1700MB Free Memory - 150000k example node.js process size ~ 100k1500000 / 100 = 15000 Concurrent
  • 13. But If we improve concurrency by 500X wont that just - Jam Mysql even more?
  • 14. IntroducingMongoDB Document oriented storage Full index support (+geo) Replication and High Availability Querying Map Reduce
  • 15. +Both: speak Javascript Understand json documents Are Very fast are very popular and together are a path well traveled (relatively speaking)
  • 16. WhenTousethispattern? JSON APIs Single Page Apps Shelling out to unix tools Streaming Data Soft Realtime Applications
  • 17. WhenNOTtousethispattern? CPU Heavy tasks Simple CRUD / HTML apps Just for the BuzzWord compliance.
  • 18. Letslookindepthintooneoftheseusecases... JSON APIs Single Page Apps Shelling out to unix tools Streaming Data Soft Realtime Applications
  • 19. 1. Node based API Serverserves mobile/widgets etc..2. MongoDB databasestores state.3. Services module dealswith interacting with Drupal4. Drupal is the front forcontent creation
  • 20. Swifto DEMO
  • 21. 1. Node based API Serverserves mobile/widgets etc..2. MongoDB databasestores state.3. Services module dealswith interacting with Drupal4. Drupal is the front forcontent creation
  • 22.