I was reading/studying about HBase and trying to create a Schema. I'm from RDBMS background and this is the first time trying a nosql db. I've a simple question about schema design:
Assume there are three tables => album, photo, comment
album <= Created by the user
photo <= Contains all photos uploaded to an album
comments <= Contains commenrs on an album or photo
A photo should be fetched with all of comments under it. An album should be fetched with all the photos in it but not comments.
user is identified by the email. The schema that I came up with:
tbl_user
email || info: {password : ..., name : ...}
album
<email>:album:<timestamp> || info {title:..., cover: photo-row-key}
photo
<album-row-key>:<timestamp> || info {caption:..., exif: ...}
comment
<album-row-key or photo-row-key> || comments {
comment:<timestamp>: {user: <email>, text:...}
comment:<timestamp>: {user: <email>, text:...}
comment:<timestamp>: {user: <email>, text:...}
...
}
- Does this design look okay? I just want to know the modifications that should/must be done and why.
- Should the photo-row-key not prepended with the album-row-key (might be to save space)?
- Regarding comment's table, should a comment row-key be created like
<album-row-key or photo-row-key>:comment:<timestamp>
? As per above schema whenever a user creates a comment, I need to read comments column, update it with new comment and update the row with tha. Does it sound fine?
It'll be very helpful if you could share some link(s) which has/have examples of schemas that suit more for RDBMS :)