Riak behind a Load Balancer

2012-06-24 Thread Matt Black
Dear list, Does anyone have an opinion on the concept of putting a Riak cluster behind a load balancer? We wish to be able to automatically add/remove nodes from the cluster, so adding an extra layer at the front is desirable. We should also benefit for incoming requests behind shared across all

undefined method content_type

2012-06-24 Thread Anand Hegde
require 'riak' class RiakClient < Riak::Client #attr_accessor :bucket def initialize(hosts="") return Riak::Client.new(:nodes => [{:http_port => 8091},{:http_port =>8092},{:http_port=>8093},{:http_port =>8094}]) end def get_me(bucket, key) obj = self.bucket(bucket).get(key) puts obj.data end

Re: JSON-Encoding from riakc

2012-06-24 Thread Sean Cribbs
Florian, Also if your value is a proplist and you use the content-type of "application/x-erlang-binary", then Search will automatically extract the values as it does for JSON and XML. See https://github.com/basho/riak_search/blob/master/src/riak_search_kv_erlang_extractor.erl On Sun, Jun 24, 201

RE: JSON-Encoding from riakc

2012-06-24 Thread Erik Søe Sørensen
One answer is: dict:to_list/1 and dict:from_list may be your friends. Another is: Are you sure that dict is appropriate for your data? If the number of entries is bounded and does not exceed around a dozen, then a property list might be faster. (Although I'd advice you to use lists:keyfind(Key, 1