Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 75 lines (54 sloc) 2.44 kb
24d9deb @krestenkrab Updated the new module name some more places
authored
1 riak_btree_backend
2 ==================
59f4303 @krestenkrab Added readme
authored
3
4 This module is a storage backend for [Riak](http://wiki.basho.com),
5 which uses `couch_btree` to store data. `couch_btree` is an
a19a703 @krestenkrab Implement compaction and sync_strategy
authored
6 append-only format, and so just like CouchDB, it runs a compaction
7 periodically.
59f4303 @krestenkrab Added readme
authored
8
9 Compared to other backends, this has the following properties:
10
83edb02 @krestenkrab Update readme and license notices
authored
11 - Does not keep keys in memory (that is, it uses the file system
12 buffers to keep keys)
13 - Stores keys sorted so operations like list_buckets and
14 list_keys_in_bucket have reasonable performance
15 - Keys and values are stored together (there is no separate index or
16 hint files) which may slow down key scans.
762e752 @krestenkrab Update readme with some rough performance numbers
authored
17 - Is slower than `innostore`, for my bench setup with 3 nodes on 3 separate
18 MacMinis it yields ~400 PUTs/sec w/btree compared to ~1000 PUTs/sec for
19 `innostore` (and much slower than `bitcask`).
20 - But is pure Erlang (which makes me and Erjang happy)
59f4303 @krestenkrab Added readme
authored
21
a19a703 @krestenkrab Implement compaction and sync_strategy
authored
22 Compaction should really be triggered by some measure of fragmentation
83edb02 @krestenkrab Update readme and license notices
authored
23 in the data file, so there is something to implement some other time.
4680f58 @krestenkrab Update README
authored
24 Right now it runs once an hour, but can be configured using the
25 `compaction_interval` environment setting.
59f4303 @krestenkrab Added readme
authored
26
4680f58 @krestenkrab Update README
authored
27 To configure Riak to use `riak_btree_backend`, edit your `app.config`
a19a703 @krestenkrab Implement compaction and sync_strategy
authored
28 to use the btree backend.
59f4303 @krestenkrab Added readme
authored
29
30 {riak_kv, [
cc9c809 @krestenkrab Made it a proper OTP app, renamed main module to riak_btree_backend
authored
31 {storage_backend, riak_btree_backend},
59f4303 @krestenkrab Added readme
authored
32 ...
33
cc9c809 @krestenkrab Made it a proper OTP app, renamed main module to riak_btree_backend
authored
34 {riak_btree_backend, [
a19a703 @krestenkrab Implement compaction and sync_strategy
authored
35 {data_root, "data/btree"},
36
15e9fa3 @krestenkrab Update readme with sync_options
authored
37 %% sync strategy is one of: none (default), {seconds, N}, sync or o_sync
38 {sync_strategy, o_sync},
2f3a897 @krestenkrab Added compaction_interval to README
authored
39
40 %% how often to do copy compaction
41 {compaction_interval, {minutes, 10}}
cc9c809 @krestenkrab Made it a proper OTP app, renamed main module to riak_btree_backend
authored
42 ]},
43
44 The easiest way to pull in all the right things in your riak is to
45 build your own, adding this to the `deps` section of riak's
46 `riak/rebar.config`.
47
48 {riak_btree_backend, "0.1.*",
49 {git, "git://github.com/krestenkrab/riak_btree_backend",
50 {branch, "master"}}},
51
a2813f9 @krestenkrab Update readme
authored
52 And, then update `riak/rel/reltool.config` to include
53 `riak_btree_backend` in your release.
cc9c809 @krestenkrab Made it a proper OTP app, renamed main module to riak_btree_backend
authored
54
b156c88 @krestenkrab Added acknowledgements to README
authored
55
83edb02 @krestenkrab Update readme and license notices
authored
56 License
57 -------
58
59 The code is Copyright (C) 2011 by [Trifork](http://www.trifork.com),
60 and made available under Apache 2.0 License. Pleas credit Trifork
61 appropriately if you use this.
62
63
b156c88 @krestenkrab Added acknowledgements to README
authored
64 Thanks
65 ------
66
67 Acknowledgements go to the CouchDB team, the fine folks at Basho (the
83edb02 @krestenkrab Update readme and license notices
authored
68 module borrows heavily from `riak_kv_ets_backend` and
69 `riak_kv_bitcask_backend`), and to Ulf Wiger at Erlang Solutions for
70 writing the beautiful little `sext` module.
b156c88 @krestenkrab Added acknowledgements to README
authored
71
72
59f4303 @krestenkrab Added readme
authored
73 Happy hacking!
74
75 Kresten
Something went wrong with that request. Please try again.