
Escaping "Recursive Hell": Building ERP Hierarchies with ArangoDB Edges
This is the story of a mistake I kept making until I stopped fighting my database. When I started designing our ERP’s parts categorization and warehouse tracking, I reached for the "safe" choice: standard document references. It nearly broke the system. I’m sharing this pattern not because it’s the only way, but because it’s the shift in thinking that finally made our complex relationships manageable. The Problem: When parent_id Hits a Wall Initially, I modeled our hierarchy using a simple parent_id field on each document. It worked for a week. Then the requirements got real: Deep Category Inheritance: If "Electronics" is marked as hazardous , every sub-category three levels down needs to know that—unless an intermediate sub-category overrides it. Dynamic Warehouse Layouts: We needed to map zones, racks, shelves, and bins. A user might ask, "What storage facility is this specific bin in?" requiring a climb up an unpredictable number of levels. My first mistake: We tried to handle the r
Continue reading on Dev.to Webdev
Opens in a new tab




