我是新來卡桑德拉和嘗試我的應用程序遷移從MongoDB的卡桑德拉如何爲Cassandra數據庫(遷移)建模mongodb集合?
我有以下集合MongoDB中
PhotoAlbums
[
{id: oid1, title:t1, auth: author1, tags: ['bob', 'fun'], photos: [pid1, pid2], views:200 }
{id: oid2, title:t2, auth: author2, tags: ['job', 'fun'], photos: [pid3, pid4], views: 300 }
{id: oid3, title:t3, auth: author3, tags: ['rob', 'fun'], photos: [pid2, pid4], views: 400 }
....
]
Photos
[
{id: pid1, cap:t1, auth: author1, path:p1, tags: ['bob','fun'], comments:40, views:2000, likes:0 }
{id: pid2, cap:t2, auth: author2, path:p2, tags: ['job','fun'], comments:50, views:50, likes:1, liker:[bob] }
{id: pid3, cap:t3, auth: author3, path:p3, tags: ['rob','fun'], comments:60, views: 6000, likes: 0 }
...
]
Comments
[
{id: oid1, photo_id: pid1, commenter: bob, text: photo is cool, likes: 1, likers: [john], replies: [{rep1}, {rep2}]}
{id: oid2, photo_id: pid1, commenter: bob, text: photo is nice, likes: 1, likers: [john], replies: [{rep1}, {rep2}]}
{id: oid3, photo_id: pid2, commenter: bob, text: photo is ok, likes: 2, likers: [john, bob], replies: [{rep1}]}
]
查詢:
查詢1:顯示一個熱門專輯列表(根據喜歡的數量)
問題2:顯示討論最多的專輯列表(基於 評論數)
查詢3:顯示:上 用戶的頁面
查詢4顯示給定作者的所有專輯列表所有的照片和所有評論專輯 (拉專輯的細節,在 相冊中所有照片的顯示照片縮略圖,顯示所選照片的所有評論
問題5:展示基於標籤的 相關專輯列表的當前專輯
鑑於上述模式和要求,我應該如何在Cassandra中對此進行建模?