构建实时Web应用的Node.js框架:Nombo

jopen 10年前

Nombo 是一个开源 Node.js 框架,用来构建实时的 web 应用和丰富可伸缩的云应用。

关键特性:

Scalability
  • Nombo is launched as multiple node processes - This is all automated; you just specify how many load balancers, workers and stores to use and Nombo takes care of deployment and management. This lets you use all CPU cores on your machine/instance.
  • Worker processes are highly parallelized (share literally no resources - User data is bound only to the workers which need it) - This offers almost infinite vertical scalability.
Asset Delivery
  • All HTTP assets are automatically minified and gzipped to reduce file size.
  • Server side caching greatly minimizes disk IO operations.
  • Strong client side caching greatly decreases application load time on subsequent visits and reduces the stress on your server.
  • Nombo lets you bundle scripts, templates, stylesheets and images (images referenced in the CSS are also automatically loaded and cached).
  • Customizable preload screen which shows accurate loading percentage when your app is accessed for the first time.
Realtime IO
  • From inside your client-side scripts you can call methods of server-side CommonJS modules called sims (Server Interface Modules). These let your clients easily interact with your backend.
  • From inside sims you can react to client input by emitting events to particular sockets or sessions (a session is associated with a group of sockets belonging to the same client) or broadcast to all connected sockets.
  • You can define middleware functions for various client-server interactions. For example there are middleware segments for dealing with HTTP requests and some for dealing with IO (socket) requests.
  • You can easily store volatile in-memory data through a session object. This data will automatically be mapped to one of possibly multiple data stores based on your session ID.
Reliability
  • Multiple workers provide a more consistent performance.
  • Worker crashes are completely transparent to clients. The worker is automatically respawned - All session data and server event handlers are kept intact.
Code Structure
  • Client side scripts can be loaded statically (at compile time) or dynamically (at runtime).
  • Client scripts have the same structure as server-side Node.js modules and Nombo SIMs (CommonJS) - Like Node.js modules, each script operates in its own isolated scope.
  • Allows you to import scripts which have global scope (e.g. jQuery, jQuery UI, Backbone, AngularJS...) - In Nombo, these are referred to as libs (libraries).

项目主页:http://www.open-open.com/lib/view/home/1388478149844