Skip to content

IPC-based publish / subscribe server architecture on node.js

Notifications You must be signed in to change notification settings

petrjanda/anthill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ANTHILL - IPC publish / subscribe architecture for node.js

Motivation

Node.js application run in a single process. Its essential of how node.js work and can probably handle thousands of concurrent connections. Nevertheless development of one monolithic app has certaion disadvantages:

  • One failing piece of app can take it all down
  • Can be harder to plugin new component
  • Its harder to decouple system components
  • Make it more difficult to manage the whole development
  • etc.

The other way around is to split your app into pieces. In node.js that could be the separate processes. One process then take care about certain thing, certain subset of domain logic you intend to solve.

Architecture

The whole solution build on top of Dnode by James Halliday, the RPC library to allow inter process communication. It works even with Ruby, Perl or Java. Anthill builds on top of that and add publish / subscribe architecture. Your processes do their work themselves, and emit the events to outside world in case something important happened. There might be someone else interested about that. Other process then just subscribe for a given events.

License

Copyright (c) 2011 Petr Janda

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

IPC-based publish / subscribe server architecture on node.js

Resources

Stars

Watchers

Forks

Packages

No packages published