Infrahub: Git for Infrastructure State, Built as a Graph

A deep look at how OpsMill turns branches, diffs, and schema changes into a single source of truth for automation, validation, and change control.

11 min read • View on GitHub • More from opsmill

A wide black-ink editorial illustration shows a central branch lever splitting a graph-like filing system into two parallel infrastructure timelines. Devices, VLAN cards, and relationship lines hang from the graph, while a blueprint seal sits above the split. It explains that Infrahub makes infrastructure state branchable at the data layer, not just in Git.
Infrahub treats infrastructure state like a versioned graph, so branching becomes part of the model instead of a wrapper around it.
Key Takeaways

Infrahub is not trying to be another inventory database. It is trying to make infrastructure state behave like code without flattening away the relationships that make infrastructure hard in the first place. That is a sharper idea than it first sounds, because the product is really about change control over a living graph.

The branch is the product

Most teams know the Git idea. Infrahub takes that instinct and applies it to infrastructure data itself. Branches are not an external wrapper around state. They are part of the model, which means the system can reason about data changes and schema changes in the same flow.

With built-in version control, flexible schema, and native CI integration, it solves the scaling and maintenance issues of existing solutions—so your automation can go further, faster.

Damien Garros, Co-founder and CEO at OpsMill · Introducing Infrahub: A Next-Gen Source of Truth With Version Control
A WSJ-style hedcut portrait of Damien Garros, based on his verified GitHub avatar. It identifies the founder behind Infrahub and anchors the product’s origin story in a real person rather than a faceless platform.

That quote lands because it matches the repo’s shape. Infrahub is built around a graph core, a FastAPI surface, and a diff engine that understands time. The branch is not a metaphor pasted on top. It is the product’s organizing principle.

Infrahub’s diff pipeline is not a snapshot comparison. It is a staged reconciliation process that can account for time, relationships, and schema compatibility.

Why inventory files stop scaling

Static YAML, spreadsheets, and ad hoc scripts work until they do not. They can describe state, but they do not make state easy to validate, compare, or evolve. Once the infrastructure model starts changing as quickly as the infrastructure itself, the truth gets split across files, pipelines, and tribal knowledge.

ApproachWhat it storesHow it changesWhere it breaks
Static inventory filesText snapshots of devices and configManual edits plus CI glueSchema drift, brittle automation, weak validation
Traditional SoT toolsCurrent structured stateDatabase updates without native branchingHarder to model temporal change and schema evolution
GitOps plus scriptsConfiguration text in GitPRs, pipelines, custom reconciliationState and relationships are scattered across tools
InfrahubVersioned relational infrastructure stateBranch, diff, merge, validate inside the modelRequires adopting a new data model, but keeps structure intact

The important distinction is not files versus databases. It is text versus structured, versioned relational state. Infrahub is built to preserve the structure that automation needs while still giving teams the familiar control surface of Git-like workflows.

A graph where every device, VLAN, and relationship is a node

Infrahub’s schema layer is the real unlock. The backend treats infrastructure as graph primitives: nodes, attributes, and relationships. That is a better fit for infra than a fixed table because the interesting part is rarely the object alone. It is how objects depend on each other.

A VLAN belongs to a device. A service depends on a subnet. A policy applies across environments. Those edges are not metadata. They are the system. Once the schema itself is flexible, Infrahub can model those links without forcing every change through a database migration first.

A close-up black-ink illustration shows a merge workbench with two schema stencils facing each other. Small labeled node shapes travel through alignment rails toward a validation gate and then into a bundled merge chamber. It explains how Infrahub reconciles data changes across schema versions instead of only comparing text diffs.
The merge step is structured reconciliation, not a blind text merge. Schema compatibility is part of the decision.

The diff engine does more than compare snapshots

This is where Infrahub stops looking like a database with Git polish and starts looking like a real change-management system. The coordinator does not just ask what changed between two states. It asks what changed over a time window, what those changes depend on, and whether the schema still agrees with the data.

# Conceptual flow, simplified from Infrahub's diff/merge pipeline
coordinator = DiffCoordinator()
diff = coordinator.build(
    base_branch="prod",
    target_branch="feature/new-vlan-model",
    from_time=start_ts,
    to_time=end_ts,
)

# Raw deltas become enriched with relationships, metadata, and schema context
enriched = DiffEnricher().enrich(diff)
locked = DiffLocker().lock(enriched)
merged = DiffMerger().merge(locked)

That sequence matters. The calculator finds raw deltas. The enricher adds context so the system knows what those deltas mean. The locker prevents inconsistent concurrent updates. The merger then applies changes in batches, including node kind migrations when the schema itself has evolved.

In other words, the diff is not just a comparison. It is a policy surface for deciding what kind of change is safe to apply.

Data extensibility is non-negotiable because the source of truth needs to store all the information about your infrastructure at multiple levels (technical, design) and it also needs to capture all the services that are exposed to the customers/users and it needs to adjust to the business specific needs and requirements.

Damien Garros, Co-founder and CEO at OpsMill · The OpsMill Story: Why We Built Infrahub

What Infrahub is really competing against

Infrahub is often compared to NetBox, Nautobot, and GitOps workflows, but the more useful lens is simpler: what kind of truth does each system store? NetBox and Nautobot are strong structured inventories. Git stores text. GitOps stitches those pieces together with automation. Infrahub is trying to sit in the middle as versioned relational state.

SystemPrimary modelVersioningBest atTrade-off
NetBox / NautobotStructured inventoryMostly current stateFast source-of-truth workflowsLess native branching across evolving models
GitOps + YAMLText in GitStrong file historyReviewable config changeWeak relational semantics and validation
Custom app + DBWhatever the team buildsOptional and expensiveTailored workflowsMaintenance cost rises fast
InfrahubVersioned graph stateNative branches, diffs, mergesChange control across data and schemaRequires adopting graph-native modeling

That distinction is the whole argument. Infrahub does not replace Git. It absorbs the data problems Git cannot solve on its own, especially when relationships, validation, and schema drift matter as much as the content itself.

Why the architecture matters for AI and automation

The repo’s AI angle is not decorative. A structured graph is easier to query, validate, and reason over than a pile of config files. That matters for automation because policy checks can traverse dependencies directly, and it matters for AI because the model has real relationships to work with instead of just text blobs.

The codebase also hints that OpsMill is dogfooding automation internally, including bug-agent style workflows in CI. That is a subtle but important signal. The product is not only for humans who manage infrastructure. It is also for systems that need reliable, machine-readable state to act on.

The larger bet is that infrastructure platforms should behave more like operational data systems than file sync tools. Infrahub makes that bet explicit. It turns change control into a first-class graph operation, and that is what makes it interesting.