Skip to content

Best way to model data like comments? #170

Answered by kriszyp
vedantroy asked this question in Q&A
Discussion options

You must be logged in to vote

This is a great question, and worth considering some of the different ways you can structure this in lmdb-js., I think you are on the right track here, but a lot of this can depend on what you want to optimize for, so I will summarize some of the different approaches (which you may have already considered).

Embedded Arrays
As you have mentioned, comments can easily be embedded arrays, and this is great for smaller data structures that change less frequently. However, as you realized, if there are larger data structures with frequent additions/updates to the comments, the reading and writing of the post and all other comments can significantly increase the overhead for adding comments. How…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by vedantroy
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@vedantroy
Comment options

@kriszyp
Comment options

@BlackGlory
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants