2
votes

I have no prior experience with Riak and I am just starting to work on it.

I have data that I would like to load into Riak buckets. For that, I first need to create buckets on the Riak cluster. Are there any example scripts (preferably, in Python) out there that I can refer to do all this - creating buckets + loading data? I did a quick Google search but could not find anything specific.

Any hints/info that can guide me would be really helpful. Thanks in advance.

1
This isn't the right place to post this: stackoverflow.com/help/on-topic If you have a specific problem and sample code we would be able to help, but try looking at the documentation docs.basho.com/riak/latest/dev/taste-of-riak/python - Alexander Huszagh
docs.basho.com/riak/latest/dev/using/basics/#Writing-Objects click on 'Python'. More detailed info basho.github.io/riak-python-client/index.html. Strictly speaking you do not create buckets in Riak because they are just namespaces. You can assume that a bucket already exists when you write to it or change its properties (if other than default). - vempo
Also, as Riak is masterless, writing to a single node means writing to the entire cluster. - vempo

1 Answers

1
votes

I'd recommend walking through the Zombie Riak app. The application stack is forked from this inverted index code written in Ruby, which isn't a big leap to Python. Some notes:

  • riak_hosts.rb shows how it connects to the Riak KV cluster
  • load_data.rb is a simple loading process with regular updates
  • models/zombie.rb shows you the schema