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...
Sockets A socket is one endpoint of a two-way communication link between two programs running on the network. It allows real time, bidirectional communication between the web client and server. This allows for logged in users to see comments in real time without refreshing the page in a similar way as in Google docs . Architecture The GraphSpace notification system ( pull request ) sends users notifications when certain operations (such as graph deletion or graph creation) have been completed. In practice, many users (such as those in a large group) may receive these notifications, which involves creating database entries for each user. If we attempt to do all of these operations from the perspective of the user performing them. Thus, we elected to use Kafka (a messaging queue) to enable an asynchronous notification system. In the notification system architecture the notification has to be created only after a successful database operation of creating/deleting graph, ...