Hi,

I know that Riak2 delivered a new feature of bucket type, buckets with same
bucket type will have same bucket properties and different bucket type can
have different bucket properties.
however, since Riak2 is still on it's beta version, so think may be I
should wait for a while before stable version released, so i would stick
with 1.4.7 for now.

however, since more than one application is using same riak cluster right
now, and different application need different storage engine, for example
application1 need leveldb, while another one application2 need to use
bitcask. so think it's better to use multi-backend in riak cluster.

i can achieve that by change app.config:
{storage_backend, riak_kv_multi_backend},
%%{multi_backend_prefix_list, [{<<"service1_:">>, be_blocks}]},
{multi_backend_default, <<"be_default">>},
{multi_backend, [
  {<<"be_default">>, riak_kv_eleveldb_backend, [
    {max_open_files, 50},
      {data_root, "/var/lib/riak/leveldb"}
  ]},
    {<<"be_blocks">>, riak_kv_bitcask_backend, [
      {data_root, "/var/lib/riak/bitcask"}
  ]},
    {<<"for_service1">>, riak_kv_bitcask_backend, [
      {data_root, "/var/lib/riak/service1"}
  ]},
    {<<"for_service2">>, riak_kv_eleveldb_backend, [
      {data_root, "/var/lib/riak/service2"}
  ]}
]},
and then:
curl -XPUT http://riak:8098/riak/manually_created/ -d
'{"props":{"backend":"for_service1"}}'

the problem is I could like to have riak automatically apply backend
setting by the bucket name prefix, for example:
service1_bucket11 would use <<"for_service1">> as backend, while
service2_bucket21 would use <<"for_service2">> as backend.

I know riakcs is using the similar mechanism from:
http://docs.basho.com/riakcs/latest/cookbooks/configuration/Configuring-Riak/
{multi_backend_prefix_list, [{<<"0b:">>, be_blocks}]},

but seems this does not work for me:
{multi_backend_prefix_list, [{<<"service1">>, <<"for_service1">>}]},

the newly created bucket did not use bitcask backend as expected, but using
default leveldb.

i'm not familiar with Erlang, can't read through the riak source code,
don't why it does not work, or did i mis-understand how RiakCS achieve this?

Thanks.
Gavin
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to