Hi I need to design the nested comments architecture like comments on blog/jobs etc in linkedin.
Please below the high level sql schema for the same
Here is the high level algo
- Select all the top level comments with parent as
- Select second level comments whose parents were found in the step prior
- Select further level comments whose parents were found in the step prior
To get the details about likes/comments , will trigger another query to table comment_attributes ?
Does this design looks good in principle ?
Also I am planning to use the nosql db(MongoDB) here primarily because of sharding capabilities where I can partition it based on entity type like blogs/jobs etc and it can scale with more traffic, for that I am planning to use entity_type column in each table . Does it sound good ?
Aucun commentaire:
Enregistrer un commentaire