Rebuilding the inventory service I originally wrote
We had client data in one system, people and teams in another, and projects, servers, clusters and namespaces spread across several more. Answering something like which team works with which client meant opening five tools and assembling the answer by hand, so most people guessed from memory instead. I proposed a single service that pulls from each of those systems and joins them, and I wrote it. It has been the platform's authoritative inventory for years since.
- The individual facts already existed in about a dozen upstream systems: cloud, DNS and CDN, uptime and on-call, HR, source control, package registries, CRM and mail. Nothing joined them up: which client runs in which namespace on which cluster, which certificate covers which domain, who has access to what.
- I wrote the first version single-handed in PHP. I am now rewriting it in Python and Django, because a service only one person can maintain is a risk however well it runs, and most of the department does not work in PHP. I picked Python because that is what the team works in.
- The rewrite drops write-back. The original wrote to a good number of the services it read from, including group membership, user provisioning, monitoring checks and DNS; the replacement only writes through a small set of explicit operational actions.
- Things I hand-rolled the first time round, a route-derived ACL, a custom revision and audit trait, and configuration held in the database, now come from framework libraries instead. I triaged all 77 models one at a time into ported, replaced, deliberately dropped, backlog, or flagged as an open decision the team still owns, so we can decide what to switch off with evidence.
- The second version adds GraphQL alongside REST, full-text search across the estate, and an MCP server, so the agent tooling further down this page can query inventory directly instead of scraping for it.