Initiator : Anhar Solehudin [anhsbolic]
This approach uses a separate "closure" table to store paths between nodes, allowing flexible and efficient querying. Each row in the closure table represents a path between an ancestor and a descendant node.
Best for highly dynamic trees with frequent updates, as it provides more scalable insertions, deletions, and moves.
- Dynamic Connections: The closure table can store paths between any nodes, not just ancestors and descendants.
- Efficient Queries for Hierarchies and Paths: Finding all descendants of a node is a simple query.
- Ease of Reorganization: Moving a node to a different parent is a simple update to the closure table.
This model requires maintaining the closure table, which adds complexity, though it can be more efficient for updates.
docker-compose up -d --build
migrate -database ${POSTGRESQL_URL} -path db/migrations up
air