[Django]-Django – proper way to implement threaded comments

3👍

MPTT trees are great for getting a list of subnodes or node counts. They are costly for adding/inserting nodes and the cost increases linearly with the size of the three. They are designed to fit tree data into relational databases. Also, don’t get fooled by “I’ll have much more reads than writes”. Ideally, most of the reads should hit a cache, not the database under it.

Why not skip the relational database and go with a NoSQL database that can natively store trees? There are easy integrations for Django and pretty much every NoSQL database you can thing about.

Leave a comment