Database Design – Advantages of Hierarchical Schema for Private Chat

database-designhierarchyschema

This post claims that

All modern chatting interfaces, without exception, implement a
hierarchical and a not-chronological schema for chat.

It also links another post which gives an example schema for such an interface. Basically, each message contains a reference to the message it replies to (the parent). In order to display a conversation, those references are traversed recursively, starting from messages without a parent.

But I don't see how this is any better than simply sorting the messages by the time they were sent. Since one person may send multiple messages in a row, this doesn't save me from identifying the author (even if it's just a boolean). Can somebody explain the advantages?

Best Answer

One advantage is that the system can distinguish each thread of conversation. That makes it easier for the computers and for the people. For example, machine analytics will benefit by knowing who replies to whom, and hence who the cliques, influencers and outliers are. People will benefit from being able to segregate each topic of conversation. Responses to direct questions do not get lost in the general traffic. Long-ago posts can be brought back into play without having to explicitly pull context. You can get notification on responses to your messages, rather than just general traffic in the chat room, which is more helpful.

Say I log onto a chat. There are some messages to which I want to reply. One says "Fancy a movie on Tuesday?" the other "Fancy skating on Tuesday?" I reply "yes" and "no." What will happen on Tuesday? I could write "I want to go skating but not see a movie." From my point of view clicking the "reply to" button and typing two single words is much easier and conveys the same information.

As an aside, I'd take statements of an absolute nature about how third-party systems are written with a pinch of salt until they are substantiated by knowledgeable sources.