Version: 0.0.0 alpha
Messagestore is a database for storing time-series messages, grouped in to named Streams
Use Messagestore either as a library in your own app, or run it as a REST server. Methods are exposed to allow you to control the server programatically, and a script is provided to get it running it out of the box.
Messagestore uses Postgresql as it's backing database.
The schema looks something like this:
CREATE TABLE stream (
id uuid primary key default uuid_generate_v4(),
attrs json
);
CREATE TABLE msg (
id uuid primary key default uuid_generate_v4(),
stream_id uuid,
at timestamp,
data json
);
Messagestore is just a simple way of storing and retrieving messages against a known stream_id.
It is expected you will be storing references to streams elsewhere, so there is no real discovery mechanism.
All methods take a callback that is called with err and result. The
signatures below use next
to identify the callback.
stream is like this:
{
id: <your-id>,
attrs: <json>
}
You set choose your own id
, up to 36 characters long.
attrs
are optional and can be changed later.
Change a stream's attrs
How many streams
Get multiple streams
Streams are sorted by id
opts
is required. Default values are:
{
base: 0,
limit: 100
}
msg is like
{
at: <date>,
data: <json>
}
If no at
is provided, it will be set for you
How many messages in a stream
Get multiple messages
Get one message
- 07/09/2014 0.0.0 Pre-alpha
Copyright (c) 2014 Simon Swain
Licensed under the MIT license.