Skip to content

Instantly share code, notes, and snippets.

{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 / limits.conf
Created April 22, 2014 18:58
riak limits
echo "session required pam_limits.so" >> /etc/pam.d/common-session'
@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 / setup.md
Last active September 21, 2024 19:19
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

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 / riakpbc.md
Last active September 21, 2024 19:19
A few snippets describing how to use the riakpbc node.js library

Put

var riakObj = {mykey1: "myvalue1"};

var data    = {
    key: 'my_key',
    bucket: 'my_bucket', 
    type: 'my_bucket_type',
    content = { 
@drewkerrigan
drewkerrigan / sg.preload.config
Created November 24, 2014 19:41
Sample config which creates a complex nested map Riak Datatype that can be indexed using Riak Search
{mode, max}.
% Setup:
% curl -i -XPUT http://localhost:8098/search/index/my_index
% riak-admin bucket-type create maps '{"props":{"search_index":"my_index","datatype":"map"}}'
% riak-admin bucket-type activate maps
{duration, 1}.
{concurrent, 1}.
@drewkerrigan
drewkerrigan / add_data.sh
Created April 2, 2015 03:56
Geospatial query example with Solr
curl -XPOST http://localhost:8098/types/location_type/buckets/people/datatypes/person1 \
-H "Content-Type: application/json" \
-d '
{
"update": { "username_register": "user1", "city_register": "Denver", "state_register": "NY", "position_register": "42.27,-74.53" }
}'
curl -XPOST http://localhost:8098/types/location_type/buckets/people/datatypes/person2 \
-H "Content-Type: application/json" \
-d '
@drewkerrigan
drewkerrigan / inserts.config
Last active August 29, 2015 14:18
Index Benchmarking
% curl -i -XPUT http://localhost:8098/search/index/my_index
% riak-admin bucket-type create maps '{"props":{"search_index":"my_index","datatype":"map"}}'
% riak-admin bucket-type activate maps
{mode, max}.
{duration, 1}.
{concurrent, 1}.
@drewkerrigan
drewkerrigan / http_search.config
Last active August 29, 2015 14:21
Basho Bench Riak Search Examples
{mode, max}.
{duration, 1}.
{concurrent, 1}.
{driver, basho_bench_driver_http}.
{key_generator, {int_to_str, {uniform_int, 50000}}}.
{value_generator, {fixed_bin, 10000}}.