Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I once achieved it by setting a parent_id string column - for root comments it’ll just be article id. For replies it’ll be “parent_comment.parent_id || parent_comment.id”. Then it’s just a single list no recursion needed to get the full hierarchy at whatever level. Can also be easily migrated to dynamodb and get infinite scaling and zero downtime costs.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: