考慮以下情況:卡桑德拉數據庫設計
我有一個網頁,它會具有以下字段:
pageid, title, content, like, follow, field1, field2..., field100, pagecomments, images
像和遵循的是計數器字段,將每次點擊增加。
現在我在Cassandra
在以下幾個方面思考這個設計的:
**TYPE A** page_table {
page_id,
title,
content,
like,
follow,
posted_by,
datetime,
image1,
image2,
field1,
field2...,
field100
}
page_comments {
commentid,
page_id,text,
comment_like,
posted_by,
datetime
}
**TYPE B** page_table {
page_id,
title,
content,
posted_by,
datetime,
image1,
image2,
field1,
field2...,
field100
}
page_like {
page_id,
like
}
page_follow {
page_id,
follow
}
page_comments {
commentid,
page_id,
text,
comment_like,
posted_by,
datetime
}
哪一個是最好的辦法嗎?還是提出了一些很好的Cassandra
數據庫設計的過程,使用CQL
您將如何查詢數據? –
那麼,一個查詢是顯而易見的,因爲他會有一個網頁,如他所說的那樣呈現下列字段。 –
我的查詢應獲取** page_id,標題,內容,posted_by,datetime,image1,image2,field1,field2 ..............,field100,like,follow,commentid,page_id,text ,comment_like,posted_by,datetime **該特定頁面 – user1802597