I am trying to store a dependency tree in a PostgreSQL database. There are about 20,000 software items, each item can depend on several other items.
There are several types of dependencies (some are run-time dependencies, some are build-time dependencies and some are test-dependencies).
The dependency is recursive and each item only knows about the things it immediately depends on.
I'll need to list all the dependencies of an item and display them both as a tree and as a flattened list. I'll also need to answer "what depends on this item?"
What would be a recommended way to store this information to make fetching relatively easy?