Skip to main content

Posts

Showing posts from August, 2018

Table Schema

When using SQL database, a very important aspect is table schema. Presently for comment system the table schema has to support association of graph with comments, comments association with nodes and edges. Also later we came up with the idea of pinned comments where the user can pin some comments and revisit them later. So the table schema was designed as below: Comment table for storing comments. CommentToNode table for association between nodes and comments. CommentToEdge table for association between nodes and comments. PinComment table for association between users and their pinned comments.  Comment table schema is as follows: Column Name Data Type Description message string Comment message owner_email string Email Id of user who created the comment. graph_id Integer Id of the graph on which the comment is being created parent_comment_id Integer If the comment is the parent then it’s value is NULL otherwise comment is a repl...