Angel \”Java\” Lopez on Blog

August 25, 2011

AjFabriq on NodeJs (Part 1) Introduction

Filed under: AjFabriq, Distributed Computing, JavaScript, NodeJs, Open Source Projects — ajlopez @ 10:28 am

Next Post

Some years ago I discovered Fabriq project (thanks @asehmi!):

Remember Fabriq
FABRIQ has gone public!
Arvindra Shemi Fabriq Articles
Clemens Vasters Fabriq Articles

Key points:

FABRIQ is an infrastructure for constructing networks of nodes processing and relaying messages. These nodes are hosted in machines running into a serviced application.

You can have multiple machines running the same or different applications. The “network” is the application, “node” is a collection of “actions”, and each action process a message. More doc:

These nodes can be hosted in any distribution on several machines according to a defined configuration, so there may be machines running a single node or several nodes, this association are made by specifying the host-name or machine identification associated with each node in the network.

Each of these machines is running a serviced application responsible for starting and stopping its Host and Nodes which are the application main components. The host is responsible for handling the configuration, loading and unloading nodes and receives the messages and delivers them to the appropriate Node.

Past weekend, I started a Javascript project to run on NodeJs, based on Fabriq ideas:

A Distributed Application Framework for NodeJs https://github.com/ajlopez/AjFabriqJs

Simple one file implementation. Four Javascript “Classes”.

I want to run many NodeJs servers that hosts AjFabriq applications, sending messages across their network:

Original Fabriq had application, nodes, configuration. I simplified it and now I have a simple Processor that accepts messages. It can produce 0, 1 or more messages:

Messages are schema-less JSON objects that contains its own routing information:

A Processor could handle all the messages containing the key/value application: “webcrawler”. Some processors are composites: they have another processors. Then, the webcrawler processor could have a child processor specialized in handle message with key/value node:”downloader”. See the picture? But the key/values and the deep of processor trees ARE DECIDED by the developer. You decide to have “applications”, “actions”, “nodes”, or whatever you want.

A host can have many processor defined. When message is posted, a simple local method decides where to send it. It could be locally processed or it could be send to a remote host. The host network is dynamic: a new host can be added at any time, then it can collaborate with the current messages processing.

Pending topics for upcoming blog posts: implementation details, the simplest application, using net (plain) sockets, my failure with Socket.IO. Work in progress: make AjFabriq more NodeJs friendly using EventEmitter in key points, host info (hosted application) better dissemination, more robust implementation; rename Socket to Channel, a better description word.

My previous work on distributed application samples:

AjMessages
AjAgents

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

2 Comments »

  1. [...] AjFabriq on NodeJs (Part 1) Introduction « Angel “Java” Lopez on Blog Javascript project to run on NodeJs, based on Fabriq (tags: javascript fabriq nodejs) [...]

    Pingback by links for 2011-08-26fboiton's blog | fboiton's blog — August 26, 2011 @ 7:02 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Theme: Shocking Blue Green. Get a free blog at WordPress.com

Follow

Get every new post delivered to your Inbox.

Join 67 other followers

%d bloggers like this: