Search code examples
riak

What is Bucket in Riak? what its used for


What is bucket in Riak ? I tried to check documentation, but I was referred to buckets types, but could not grasp the concept of bucket in Riak.

Any explanation? what it is, and why its used?


Solution

  • I don't think there is much more to it than "bucket is a grouping mechanism for data with some configuration assigned to it.

    Quoting official docs (emphasis mine):

    Buckets are used to define a virtual keyspace for storing Riak objects. They enable you to define non-default configurations over that keyspace concerning replication properties and other parameters.

    In certain respects, buckets can be compared to tables in relational databases or folders in filesystems, respectively. From the standpoint of performance, buckets with default configurations are essentially “free,” while non-default configurations, defined using bucket types, will be gossiped around [the ring][glossary read rep] using Riak’s cluster metadata subsystem.

    And from Bucket Types:

    Buckets are essentially a flat namespace in Riak. They allow the same key name to exist in multiple buckets and enable you to apply configurations across keys.