我需要你的意见,我的设计数据模型为我的项目。我的项目是实时推荐系统。有一些推荐算法集合。意思是这样的:
collection1 { algorithm1,algorithm5,algorithm6 }
collection2 { algorithm5,algorithm6,algorithm7,algorithm8 }
等。
我需要存储数据,比如-成功,选择的概率,得分等等,每2分钟收集一次算法。所以我选择了卡桑德拉,就像我的数据存储一样,因为它能很好地处理时间序列。我需要将我的数据存储在后面的一些图表中。你认为我的数据模型解决方案还行吗?我是这样做的:
CREATE TABLE algorithm_by_collection_and_date (
algorithm_id text,
collection_id text,
date text,
event_time timestamp,
score double,
probability double,
PRIMARY KEY ((algorithm_id,collection_id,date),event_time)
);因此,通过向行键中添加数据来限制集合中每个算法的列(按日期)i的数量,就像行分区一样。
你觉得这个怎么样?谢谢你,简
发布于 2014-03-31 20:44:08
我会有这个结构-它将允许你规范你的结构,使它成为一个更清洁的设计。我已经仓促了,请为列添加正确的数据类型和引用完整性约束。
CREATE TABLE algorithm
(
algorithmId uuid PRIMARY KEY,
algorithmName text
)
CREATE TABLE collection
(
collectionID uuid PRIMARY KEY,
collectionName text
)
CREATE TABLE algo_collection
(
algoCollectionID uuid PRIMARY KEY
collectionID
algorithmID
)
CREATE TABLE recommendation
(
algoCollectionID
date
event_time,
score,
probability
)https://stackoverflow.com/questions/22732951
复制相似问题