在 Riak 中如何组织存储桶?
由于 Riak 使用桶作为分隔键的方式,那么桶内是否有可能存在桶呢?如果不是,如何为多个应用程序组织一个包含多个存储桶的 Riak 设置。
基本问题是如何在 Riak 中表示“数据库”和“表”。既然存储桶可以转换为表,那么什么可以转换为数据库呢?
编程语言中的命名空间通常具有层次结构。 Riak 存储桶也允许层次结构是有意义的,因为存储桶本质上是命名空间。
Since Riak uses buckets as a way of separating keys, is it possible to have buckets within buckets? If not how would one go about organizing a Riak setup with many buckets for several apps.
The basic problem is how one would go about representing "databases" and "tables" within Riak. Since a bucket translates to a table, what translates to a database?
Namespaces in programming languages usually have hierarchies. It makes sense for Riak buckets to also allow hierarchies, since buckets are essentially namespaces.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将 Riak 视为非常大的
密钥 -> value
“table”,其中 存储桶只是键的前缀。现在,您知道只要存储桶仍然是二进制对象,您就可以对它们执行任何操作。您可以创建线性“表”:
或者您可以创建层次结构:
或者您甚至可以使用元组作为存储桶:
You need to think about Riak as about very big
key -> value
"table" where buckets are only prefixes for keys. Now when you know that you can do anything with buckets as long as they are still binary objects.You can create linear "tables":
Or you can create hierarchies:
Or you even can use tuples as buckets: