问题描述
我对 NoSQL 比较陌生,但我已经对关系数据库进行了相当多的尝试.
I'm relatively new to NoSQL, but I've done a fair bit of toying with relational databases.
我们正在评估 Cassandra 是否在我们的数据模型可能需要相当积极地发展的环境中使用.我已经看到它写了很多地方,Cassandra 可以存储结构化、半结构化和非结构化"数据.
We are evaluating Cassandra for use in an environment where our data model might need to evolve fairly aggressively. I've seen it written multiple places that Cassandra can store "structured, semi-structured and unstructured" data.
我理解结构化声明.很明显:一个表定义了列.
I understand the structured claim. It's obvious: a table has defined columns.
我想我理解半结构化声明.一行不需要填充所有列.
I think I understand the semi-structured claim. A row does not need to populate all columns.
但我不清楚非结构化声明.当然,您可以将所有内容存储为键值 blob,但您无法按值(有效地)进行搜索.
But I'm not clear on the unstructured claim. Certainly you could store everything as a key-value blob but you'd have no means of searching by value (efficiently).
我未能在网络上找到任何资源来描述在 Cassandra 中使用非结构化数据的最佳实践.理想情况下,对于我们的应用程序,半结构化数据就足够了;但我想了解非结构化声明,因为它可以为我们增加价值.
I've failed to find any resource on the net that describes best practices using unstructured data with Cassandra. Ideally, for our application semi-structured data would be sufficient; but I want to understand the unstructured claim in the event that it can add value for us.
谢谢.
推荐答案
Cassandra 最多可以搜索半结构化数据.这也是通过使用集群键和二级索引.聚类键绝对是搜索半结构化数据的有效方法.
Cassandra can at best be searchable for semi-structured data. That too via use of clustering keys and secondary indexes. Clustering keys is definitely an efficient way for searching semi-structured data.
在不指定分区键的情况下搜索二级索引数据效率不高.有一些解决方案在这里有帮助,即 DSE Search(Solr with Cassandr) 和 Stargate.如果其中一列是非结构化文本,这两种解决方案也可能有所帮助.
Searching secondary indexed data without specifying the partition key is not efficient. There a few solutions which help help here namely DSE Search(Solr with Cassandr) and Stargate. Both of these solutions may also help in case one of the columns is unstructured text.
否则,使用 Cassandra 处理非结构化数据并不是一个好主意,因为如果没有密钥,它可能无法搜索.
Otherwise it isn't a great idea to do unstructured data with Cassandra as it may not be searchable without a key.
这篇关于Cassandra 和非结构化数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!