How do you arrange buckets in Riak?

Since Riak uses buckets as a way to split keys, is it possible to have buckets inside buckets? If not, how can you organize an Riak organization with multiple buckets for multiple applications.

The main problem is how one could present “databases” and “tables” inside Riak. Since the bucket is being translated into a table, what is being translated into the database?

Namespaces in programming languages ​​usually have hierarchies. For Riak lists, it makes sense to also allow hierarchies, because buckets are namespaces.

+3
source share
1 answer

Riak key -> value, . , , , .

"":

<<"table1">>
<<"table2">>

:

<<"db1.table1">>
<<"db1.table2">>
<<"db2.table1">>
<<"db2.table2">>

:

1> term_to_binary({"db1", "table1"}).
<<131,104,2,107,0,3,100,98,49,107,0,6,116,97,98,108,101,49>>
2> term_to_binary({"db1", "table2"}).
<<131,104,2,107,0,3,100,98,49,107,0,6,116,97,98,108,101,50>>
3> term_to_binary({"db2", "table1"}).
<<131,104,2,107,0,3,100,98,50,107,0,6,116,97,98,108,101,49>>
4> term_to_binary({"db2", "table2"}).
<<131,104,2,107,0,3,100,98,50,107,0,6,116,97,98,108,101,50>>
+10

All Articles