node package manager


AllData HTTP client module


Stability: 1 - Experimental

Client HTTP module for AllData, a distributed master-less write-once immutable event store database implementing "All Data" part of Lambda Architecture.

var AllDataClient = require('alldata-client-http');
var allDataClient = new AllDataClient({
    hostname: "localhost",
    method: "POST",
    path: "/put",
    port: 80 
var event1 = {customer: 1, action: "site visit"};
var event2 = {customer: 1, action: "login"};
allDataClient.put(event2, function (error) {
    if (error) {
        console.log("Saving event2 failed: " + error.message);
    } else {
        console.log("Saving event2 succeeded.");
npm test

AllDataClient is an HTTP client for AllData. Once configured, it sends HTTP requests for every event.

Public API

  • options: Object
    • hostname: String (Default: localhost) HTTP hostname of the AllData server.
    • method: String (Default: POST) HTTP method.
    • path: String (Default: /) HTTP request path.
    • port: Number (Default: 80) HTTP port of remote server.

Creates a new instance of AllDataClient.

  • event: Object JavaScript object representing the event to store.
  • callback: Function (Default: undefined) function (error) {} An optional callback to call in case of success or failure.

Attempts to store the event in AllData service via HTTP. If a callback is provided it will be called with an Error instance if an error occurs or with no parameters otherwise.

allDataClient.put({foo: 'bar'}, function (error) {
    if (error) console.log('put failed: ' + error.message);