JS App Architecture


Published on

These are the slides from the presentation I gave to the Sencha meetup group in Austin, TX. It covers the NoSQL-NodeJS-ExtJS development stack at a high level.

Published in: Technology
1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

JS App Architecture

  1. 1. NoSQL, SSJS, & Sencha
  2. 2. Corey Butler 15yrs+ Web Experience Founder @ Ecor Systems, LLC Chief Consultant @ Ecor Group (we’re on senchadevs.com) DW/BI & Web Practices Ext JS Since v2. Started in the Adobe, Microsoft, & IBM worlds. Started in Fortune 500, Entrepreneur since 2000.Available Via: Blog: coreybutler.com Twitter: @goldglovecb LinkedIn.com/in/ecorsystems
  3. 3. Agenda NoSQL Overview SSJS Overview The Sencha Stack Simple Examples
  4. 4. The Stack The concept isn’t much different from traditional web architecture.
  5. 5. What is NoSQL? No defined relationships. No schemas or fixed types. NoACID?
  6. 6. What NoSQL Is NOT Hard & Fast RDBMS Replacement All Purpose Data Storage
  7. 7. NoSQL vs SQLNOSQL SQL Goal Specific  Generic Non-relational  RDBMS Map/Reduce  ANSI SQL Known Data Structure!  Predefined Data Structure No NULLS  NULLSfunction(doc) { SELECT a.pk as id, a.somefield as value if ( doc.date < Date() && typeof doc.somefield !== undefined ) { FROM TblA a INNER JOIN TblB b var resultObject = { ON a.pk = b.fk id: doc.pk, WHERE a.somevalue IN value: doc.somefield (SELECT someval FROM TblC) }; AND b.date < CURRENT_TIMESTAMP emit(resultObject); AND a.somefield <> null }}
  8. 8. Popular Choices CouchDB  Doc Store MongoDB  Doc Store w/ Key/Value Redis  Key/Value (In Memory) Riak  Dynamo-like (Commercial) Hadoop  Big Data Cassandra  BigTable CONSTANTLY GROWING kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis
  9. 9. Storage TypesKey/Value: Schemaless. Where is data stored? Disk? Memory? Distributed?Document: Like Key/Value, but semi-structured.Graph: Based on graph theory. Focuses more on relationships between objects than the objects themselves.Column/Wide: Key pointing to multiple columns (like rows in an RDBMS)
  10. 10. SSJS: Server SideJavaScript SSJS was first introduced via Netscape LiveWire in 1996, but really didn’t become practical for many until 2009. Gaining popularity because:  Faster JS Engines like Google’s V8 (Chrome), Spidermonkey (Firefox), & Rhino (Firefox).  Maturity of JavaScript/ECMAScript.  Standards like CommonJS. Useful for event-driven apps.
  11. 11. CommonJS Aims to standardize JS outside the browser. Best Practices/Metadata/Specs. Cross-Compatibility. Supports concepts like modules, file system references, exports, and other common requirements for serving applications.
  12. 12. SSJS Platforms Narwhal Most complete CommonJS implementation. Based on Rhino with JSGI Middleware. NodeJS  Non-blocking & single threaded (fast). Implements some CommonJS. Based on V8. Large and growing community.Others: Jaxer, Jack, 10gen App Server
  13. 13. NodeJSFrom nodejs.orgNode.js is a server-side JavaScriptenvironment that uses an asynchronousevent-driven model. This allows Node.js toget excellent performance based on thearchitectures of many Internet applications.Nutshell: Create apps, like web servers.
  14. 14. Example Web Server//Require the HTTP modulevar http = require(http), colors = require(colors), port = 80;//Create the serverhttp.createServer(function (req, res) { res.writeHead(200, {Content-Type: text/plain}); res.end(Hello Worldn);}).listen(port, "");//Indicate the server is runningconsole.log(Server running at;
  15. 15. NodeJS Modules Modules are plugins for Node. Lots of work already done for you. No governed quality control. Hundreds of Modules NPM is your friend.
  16. 16. NPM: Node PackageManager http://npmjs.org Install/Publish Modules Manages dependencies. Extremely simple: npm install express
  17. 17. Tying to Sencha Connect Module is part of Sencha Labs Express Module is built on Connect.
  18. 18. Examples With Sencha Sencha  NoSQL (CouchDB)  REST Proxy Sencha  NodeJS  MongoDB  REST Proxy, Express, Mongoose This Presentation  Socket.IO
  19. 19. Node Hotness Socket.IO  Web Sockets  Comparable to HTML5 SSE (Comet)  Dnode, NowJS Highly Concurrent Apps. Easy REST Development. Server-side headless browsers. Community & Momentum