An open API service indexing awesome lists of open source software.

https://github.com/hroptatyr/cotse

Column-Oriented Temporal Storage Engine
https://github.com/hroptatyr/cotse

Last synced: 3 months ago
JSON representation

Column-Oriented Temporal Storage Engine

Awesome Lists containing this project

README

          

cotse
=====

cotse is a column-oriented temporal storage engine with a strong focus
on financial applications.

Features
--------

* [X] compressed
* [X] support for IEEE 754-2008 decimals

Red tape
--------

+ licence: [BSD3c][1]
+ github:
+ issues:
+ releases:
+ contributions: welcome

This is Pareto software, i.e. only the 80% case works.

Example
-------

To write some data to a file-backed tick store:

#include

struct candle {
struct cots_tick_s proto;
cots_px_t o, h, l, c;
cots_qx_t v;
};
...
struct candle data;
cots_ts_t db = make_cots_ts("ppppq", 0U);
cots_put_fields(db, (const char*[]){"open","high","low","close","volume"});
cots_attach(db, "/tmp/tickdata", O_CREAT | O_TRUNC | O_RDWR);
while (get_candle(&data)) {
cots_write_tick(db, &data.proto);
}
...
cots_detach(db);
free_cots_ts(db);

And to read the contents:

#include

struct candle_soa {
struct cots_tsoa_s proto;
cots_px_t *o, *h, *l, *c;
cots_qx_t *v;
};
...
struct candle_soa dsoa;
cots_ts_t db = cots_open_ts("/tmp/tickdata", O_RDONLY);
ssize_t n;
while ((n = cots_read_ticks(&dsoa.proto, db))) {
put_candle(&dsoa);
};
cots_close_ts(db);

[1]: http://tldrlegal.com/license/bsd-3-clause-license-%28revised%29