Skip to content

Instantly share code, notes, and snippets.

Riak Time-Series API

Goal

The goal of a time-series API on Riak is to provide a reusable solution to a common problem faced by customers. The problem at a high level is that there is currently no built-in way to fetch more than one Riak object given start and end parameters.

Minimum Features

The API should at minimum expose a way to easily store individual events as well as a way to query for multiple events given start and end times.

@drewkerrigan
drewkerrigan / setup.md
Last active July 12, 2018 14:31
simple Riak default schema search setup

Simple Search 2.0 Setup

Create an index
curl -i -XPUT http://localhost:8098/search/index/my_index
Link the index to a bucket
@drewkerrigan
drewkerrigan / app.config
Created May 1, 2014 20:26
An example of multiple bitcask backends, one with expiry set.
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
[
%% Riak Client APIs config
{riak_api, [
%% pb_backlog is the maximum length to which the queue of pending
%% connections may grow. If set, it must be an integer >= 0.
%% By default the value is 5. If you anticipate a huge number of
%% connections being initialised *simultaneously*, set this number
%% higher.
@drewkerrigan
drewkerrigan / limits.conf
Created April 22, 2014 18:58
riak limits
echo "session required pam_limits.so" >> /etc/pam.d/common-session'
{mode, max}.
{duration, 10}.
{report_interval,1}.
{concurrent, 10}.
{driver, basho_bench_driver_riakc_pb}.
{key_generator, {int_to_bin_bigendian, {sequential_int, 10000}}}.
@drewkerrigan
drewkerrigan / docker_install_notes.md
Last active December 10, 2020 06:17
Some notes on my experience installing Docker on OS X 10.9.2
@drewkerrigan
drewkerrigan / options.md
Last active August 29, 2015 13:56
RiakJson Installation Options

Build Riak from source

  1. Download a branch of Riak that contains RJ dependencies in rebar.config, and startup changes in reltool.config
  2. Run make relclean && make rel
  3. Start Riak
Pros
  • Least manual commands and configuration
;;;; .emacs Customizations, Functions, and Packages
;;; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;;; Packages and Initialization
;;; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@drewkerrigan
drewkerrigan / YOKOZUNA.md
Last active July 12, 2019 21:01
Yokozuna Setup

Create a schema based on the default one

https://github.com/basho/yokozuna/blob/develop/priv/default_schema.xml

Upload your schema

curl -XPUT -H 'Content-Type: application/xml'  http://localhost:8098/search/schema/drew_schema --data-binary @"my_schema.xml"
@drewkerrigan
drewkerrigan / workflow.txt
Last active December 31, 2015 00:09
Actor based counter example values
1) Actor 1 writes transaction
_key_____________|_value________________________________________________________
player1_balance | {actor1: {operations: [{txnid: 1, value: +10}]}}
2) Actor 2 writes transaction
_key_____________|_value________________________________________________________
player1_balance | sibling1 -> {actor1: {operations: [{txnid: 1, value: +10}]}}
sibling2 -> {actor2: {operations: [{txnid: 2, value: +20}]}}