Overview Documentation Source

Durable, Fault Tolerant Event Coordination

durable.js combines state of the art technologies in a simple yet powerful end to end library for coordinating events to store, transform, aggregate and visualize data.

  • Programs are hosted using Node.js.
  • The program data is stored in MongoDB.
  • Events are posted to the program through a simple REST interface.
  • A web client, based on d3.js for program and data visualization.
  • For example:

  • Install durable.js node package from the npm repository simply by running:
  • 
    npm install durable
    
  • Now write your first state machine:
  • 
    var d = require('durable');   
    d.run({  
      chart: d.stateChart({
        s1: {
          t1: {
            when: d.tryReceive({ content: 's2' }),
            run: function (s) { s.i = (s.i ? s.i + 1: 1); },
            to: 's2' } },
        s2: {
          t1: {
            when: d.tryReceive({ content: 's1' }),
            run: function (s) { s.i = s.i + 1; },
            to: 's1' },
          t2: {
            when: d.tryReceive({ content: 'end' }),
            to: 'end' } },
        end: { } 
      }) 
    });
    
  • Run the state machine program hosting it in node.js:
  • 
    node chart.js
    
  • Program data visualization and management is automatically available, just point your browser to:
  • 
    http://localhost:5000/chart/1/admin.html
    

    Numerous coordination patterns are available, such as: sequences, flowcharts, nested statecharts, concurrent streams, durable messaging, event algebra... With easy deployment to cloud and scale, the possibilities are endless. You take it from here...

    Other examples:

    Want more information?

    Step by step

    Concepts

    API Reference