3 ms·
A comment could store a “head”/grandparent comment and a direct parent as well. For a top comment, every other comment could be fetched that has it as head, and
by kaba0 3y ago
A comment could store a “head”/grandparent comment and a direct parent as well. For a top comment, every other comment could be fetched that has it as head, and the actual relationships can be reconstructed on server/client side as needed.
Though most dbs can do efficient recursive queries like this nowadays.
- doix 3y agoYeah, I was thinking about the HTTP level. At the database level you can do recursive queries like you say. But on the client, with the current API, you're stuck fetching each level of comments sequentially. If you have 100-200ms per request (which is a pretty realistic scenario), loading discussions isn't going to be great.