Bearing

Bearing

Recently I was helping an ex-team mate with a personal project that required a hierarchical representation of entities. His example is basically a building, contains flats that contain rooms that contain fixtures. You can extend this to any real estate representation. The problem with this approach without a graph repository is that the engineer usually goes with the naive recursive CTE approach to navigate the model, so why not pre-compute? That’s exactly what the closure table pattern tries to solve, and to be honest I’ve used this one so many times in the past and I did not know that it was a well-known pattern. Another one on the toolbelt :)

Shared source balevdev.medium.com