Velocity

Velocity is Stategraph's parallel execution engine for Terraform and OpenTofu. It uses the dependency graph to identify independent subgraphs and execute them concurrently.

Velocity includes a 30-day free trial. Set up Velocity to get started.

Features

Graph-Aware Parallel Execution

Velocity analyzes the Terraform dependency graph to find independent subgraphs — groups of resources with no dependencies between them. These subgraphs are planned and applied concurrently, reducing execution time without changing behavior.

# Drop-in replacement for terraform plan/apply
stategraph tf plan --tenant <tenant-id> --out plan.json
stategraph tf apply plan.json

Resource-Level Locking

Traditional backends lock the entire state file during operations. Velocity locks individual resources, so multiple engineers can work on different parts of the same state simultaneously. Conflicts are detected at the resource level and surfaced before apply.

Multi-State Transactions

Coordinate plan and apply across multiple Terraform states in a single atomic transaction. Changes to networking, compute, and application layers can be planned together and applied as one unit.

stategraph tf mtx --tenant <tenant-id> --out plan.json ./networking ./compute ./application

Drop-In Replacement

Velocity uses the same Terraform and OpenTofu binaries you already have installed. No provider changes, no HCL modifications — just replace terraform plan with stategraph tf plan.

How It Works

┌──────────────┐         ┌─────────────────┐         ┌────────────┐
│  Terraform   │ ◀─────▶ │   Stategraph    │ ──────▶ │ PostgreSQL │
│   / OpenTofu │         │    Velocity     │         │            │
└──────────────┘         └─────────────────┘         └────────────┘
       │                         │
       │ 1. Parse graph          │ 2. Identify subgraphs
       │ 3. Plan in parallel     │ 4. Lock resources
       ▼                         ▼ 5. Apply concurrently
  1. Parse dependency graph - Velocity reads the Terraform configuration and builds the resource dependency graph
  2. Identify subgraphs - Independent groups of resources are identified for parallel execution
  3. Plan in parallel - Each subgraph is planned concurrently using your Terraform/OpenTofu binary
  4. Lock resources - Individual resources are locked (not the entire state file)
  5. Apply concurrently - Independent changes are applied in parallel, respecting dependency order

Getting Started

  1. Deploy Stategraph if you haven't already
  2. Set up Velocity — import or create a state, then plan and apply

Key Concepts

Topic Description
Transactions Transaction lifecycle: create, preview, commit
Resource-Level Locking Conflict detection and concurrent transaction handling
Multi-State Operations Coordinating plan/apply across multiple Terraform states

Documentation

Topic Description
Setup Prerequisites, installation, and CLI reference
Transactions Transaction lifecycle: create, preview, commit
Resource-Level Locking Conflict detection and concurrent transaction handling
Multi-State Operations Coordinating plan/apply across multiple Terraform states