Skip to main content

Infrastructure

Infrastructure as Code and platform best practices

3
Best Practices
3
Stacks
1
FAQs
23
Benchmarks

Best Practices

Terraform Module Design Patterns

Guidelines for writing reusable, versioned, and documented Terraform modules.

by HashiCorp

Immutable Infrastructure

An operations model where servers and components are never modified after deployment; changes ship as freshly built, versioned replacements rather than in-place edits.

by HashiCorp

Capacity Planning

Forecasting future demand and provisioning resources ahead of need, combining organic growth, launches, and headroom to avoid both outages and waste.

by Google SRE

Patterns

Sidecar Pattern

Deploy auxiliary components alongside primary services for cross-cutting concerns

Fail Safe

Designs a system so that when a component fails it falls into a safe, known default state rather than an unsafe or undefined one.

Heartbeat

Has a component emit periodic signals so observers can detect when it has failed or become unreachable within a bounded time.

Health Check

Exposes endpoints that report whether a service is alive and ready to serve, enabling orchestrators and load balancers to route traffic only to healthy instances.

Watchdog

An independent supervisor that monitors a system or process and takes corrective action — restart, alert, or failover — when it stops responding.

Tutorials

Setting Up a Local Kubernetes Cluster

Create a local Kubernetes development environment with kind or minikube

Infrastructure as Code with Terraform on AWS

Define and provision AWS infrastructure using Terraform

How to provision an AWS VPC with Terraform

Write Terraform configuration to create a VPC, subnets, and routing, then apply and destroy it safely.

How to write a reusable Terraform module

Package infrastructure into a Terraform module with variables and outputs so it can be reused across environments.

How to configure Terraform remote state with locking

Store Terraform state in a remote backend with state locking so a team can collaborate without corrupting state.

How to manage infrastructure with OpenTofu

Install OpenTofu and run the init, plan, and apply workflow as a drop-in, open-source alternative to Terraform.

How to provision cloud infrastructure with Pulumi

Define cloud resources in a general-purpose programming language using Pulumi and deploy them with up and destroy.

How to scan infrastructure-as-code for misconfigurations in CI

Add automated IaC security scanning to CI to catch insecure Terraform and Kubernetes configuration before it ships.

Checklists

Datacenter Exit Cutover Checklist

Plan and execute the final cutover and decommission steps when exiting an on-premises datacenter for the cloud.

Disaster Recovery Test Checklist

Plan and run a disaster-recovery test that proves backups, runbooks, and recovery objectives actually work end to end.

VM-to-Cloud Cutover Checklist

Execute a safe cutover when rehosting on-premises virtual machines to cloud compute with minimal downtime.

Terraform Module Review Checklist

Review a Terraform module for correctness, reusability, security, and maintainability before publishing it for shared use.

Infrastructure-as-Code Migration Readiness Checklist

Confirm you are ready to bring an existing manually managed cloud estate under infrastructure-as-code without disruption.

Infrastructure as Code Review Checklist

Review Terraform or equivalent IaC for security, modularity, state safety, and reproducibility before it provisions production.

Disaster Recovery Readiness Checklist

Confirm an organization can recover critical services and data within defined objectives after a major failure.

Technology Stacks

Cloud Native Stack

Kubernetes, Helm, Istio, Prometheus - CNCF ecosystem

HashiCorp Stack (Terraform + Vault + Consul + Nomad)

Cloud-agnostic infrastructure suite: Terraform provisions, Vault manages secrets, Consul handles service networking, and Nomad schedules workloads.

Vault + Consul

A HashiCorp infrastructure stack pairing Vault for secrets management and dynamic credentials with Consul for service discovery, configuration, and service mesh.

FAQs

What is infrastructure as code?

Infrastructure as code (IaC) is the practice of defining and provisioning infrastructure, such as servers, networks, and databases, through machine-readable configuration files rather than manual setup. Declarative tools like Terraform and AWS CloudFormation describe the desired end state, while imperative tools specify the steps to reach it. IaC makes infrastructure versionable, repeatable, reviewable, and testable, reducing configuration drift and manual error. It is a foundation of modern DevOps and reliable cloud operations.

Benchmarks

SPEC CPU 2017

Industry-standard CPU benchmark suite measuring integer and floating-point compute performance under realistic, compute-bound workloads.

CoreMark

Compact, portable CPU benchmark from EEMBC designed to measure embedded and microcontroller core performance with a single comparable number.

Dhrystone

Classic synthetic integer benchmark that produces DMIPS, a historical and still-cited measure of general-purpose integer CPU performance.

Whetstone

Historic synthetic floating-point benchmark measuring scientific-style arithmetic performance, reported in MWIPS (millions of Whetstone instructions per second).

STREAM

Simple, portable benchmark measuring sustainable main-memory bandwidth for large vector operations, the standard metric for memory-bound performance.

Geekbench

Cross-platform benchmark measuring single-core and multi-core CPU performance plus GPU compute, widely used to compare phones, laptops, and servers.

LINPACK / HPL

Dense linear-algebra benchmark solving a large system of equations to measure peak floating-point throughput; HPL ranks the TOP500 supercomputers.

fio Storage I/O Benchmark

Flexible I/O tester for measuring storage device and filesystem performance across configurable read/write patterns, block sizes, and queue depths.

Phoronix Test Suite

Open-source, cross-platform benchmarking framework that automates hundreds of real-world tests and aggregates results for reproducible comparison.

Cold-Start Latency Benchmark

Measures the added latency when a serverless function or container must initialize from scratch before serving its first request after being idle.

SPECpower_ssj2008

Benchmark measuring server energy efficiency by reporting performance per watt across graduated load levels from idle to peak.

SPEC OMP 2012

Benchmark suite measuring shared-memory parallel performance of OpenMP applications across scientific and engineering workloads.

HPCG

High Performance Conjugate Gradients benchmark measuring HPC system performance on memory-bound, sparse computations that mirror real applications.

HPL-AI / HPL-MxP

Mixed-precision LINPACK variant measuring supercomputer performance using low-precision arithmetic refined to full accuracy, reflecting AI hardware.

Graph500

Benchmark ranking supercomputers on data-intensive graph processing, measuring traversed edges per second instead of floating-point throughput.

GAP Benchmark Suite

Reference graph-algorithm benchmark suite providing optimized kernels and standard graphs to fairly compare graph-processing performance.

SPECviewperf

Standard benchmark measuring professional graphics-workstation performance running real CAD, visualization, and content-creation application viewsets.

3DMark

Cross-platform graphics benchmark suite measuring GPU and gaming performance through standardized rendering tests and synthetic feature tests.

Unigine Superposition

GPU stress and benchmark tool using a detailed real-time scene to measure graphics performance, stability, and thermal behavior.

PassMark PerformanceTest

Whole-system PC benchmark suite measuring CPU, memory, disk, 2D, and 3D performance and aggregating them into comparable component scores.

UnixBench

Classic Unix and Linux system benchmark measuring overall performance through CPU, process, file I/O, and system-call tests aggregated into an index.

sysbench CPU Benchmark

CPU test mode of the sysbench tool measuring processor throughput via prime-number computation across single and multiple threads.

stress-ng

Configurable stress-test and micro-benchmark tool that loads CPU, memory, I/O, and kernel subsystems through hundreds of targeted stressors.

Vibgrate CLI

See a real scan run

A replay of the actual CLI running against our test repositories — live progress, real findings, a genuine DriftScore. Nothing executes in your browser.

Replay
demo@vibgrate — bash
npx @vibgrate/cli scan
 
╭──────────────────────────────────────────╮
Vibgrate Drift Report
╰──────────────────────────────────────────╯
 
── node-turborepo (node) .
Runtime: >=18.0.0 (6 majors behind)
Frameworks:
Turbo: 1.13.4 → 2.10.12 (1 behind)
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Dependencies:
1 current 1 1-behind 3 2+ behind 1 unknown
 
── @repo/admin (node) apps/admin
Frameworks:
TanStack Query: 5.102.5 → 5.102.5 (current)
React: 18.3.1 → 19.2.8 (1 behind)
React DOM: 18.3.1 → 19.2.8 (1 behind)
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Vite: 5.4.21 → 8.2.2 (3 behind)
Dependencies:
3 current 9 1-behind 3 2+ behind 4 unknown
 
── @repo/api (node) apps/api
Frameworks:
Express: 4.22.2 → 5.2.1 (1 behind)
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Vitest: 1.6.1 → 4.1.11 (3 behind)
Dependencies:
7 current 5 1-behind 3 2+ behind 4 unknown
 
── @repo/web (node) apps/web
Frameworks:
Next.js: 14.2.35 → 16.3.3 (2 behind)
React: 18.3.1 → 19.2.8 (1 behind)
React DOM: 18.3.1 → 19.2.8 (1 behind)
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Dependencies:
2 current 6 1-behind 3 2+ behind 5 unknown
 
── @repo/config (node) packages/config
Frameworks:
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Dependencies:
2 current 2 1-behind 5 2+ behind 0 unknown
 
── @repo/database (node) packages/database
Frameworks:
Prisma: 5.22.0 → 7.10.0 (2 behind)
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Dependencies:
1 current 0 1-behind 3 2+ behind 1 unknown
 
── @repo/types (node) packages/types
Frameworks:
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Dependencies:
0 current 0 1-behind 1 2+ behind 1 unknown
 
── @repo/ui (node) packages/ui
Frameworks:
React: 18.3.1 → 19.2.8 (1 behind)
TypeScript: 5.9.3 → 7.0.2 (2 behind)
React: 18.3.1 → 19.2.8 (1 behind)
Dependencies:
1 current 4 1-behind 1 2+ behind 1 unknown
 
── @repo/utils (node) packages/utils
Frameworks:
TypeScript: 5.9.3 → 7.0.2 (2 behind)
Vitest: 1.6.1 → 4.1.11 (3 behind)
Dependencies:
0 current 1 1-behind 2 2+ behind 1 unknown
 
Tech Stack
Frontend: React, React DOM
Meta-frameworks: Next.js
Bundlers: tsx, Turbo, Vite
CSS / UI: Autoprefixer, PostCSS, Tailwind CSS
Backend: Express
ORM / Database: Prisma, Prisma Client
Testing: Vitest
Lint & Format: ESLint, ESLint Prettier, ESLint React, Prettier, typescript-eslint
 
Services & Integrations
Auth: JWT 9.0.3
Databases: Prisma 5.22.0
 
TypeScript
v5.3.3 · strict ✔ · MIXED · target: ES2022
 
Build & Deploy
Package Managers: pnpm
Monorepo: npm-workspaces, pnpm-workspaces, turbo
 
Product Purpose Signals
Frameworks: react, nextjs
Evidence: 177
Top Signals:
- [heading] Dashboard (apps/admin/src/pages/Dashboard.tsx)
- [title] Revenue Overview (apps/admin/src/pages/Dashboard.tsx)
- [copy] workspace:* (packages/ui/package.json)
- [copy] ./dist (packages/ui/tsconfig.json)
- [copy] ./src/index.ts (packages/ui/package.json)
- [copy] @repo/config/tsconfig-base.json (packages/ui/tsconfig.json)
- [copy] @repo/ui (packages/ui/package.json)
- [copy] #3b82f6 (apps/admin/src/pages/Dashboard.tsx)
Unknowns:
- No pricing or billing evidence found.
- No integrations/connectors evidence found.
- No route structure evidence found.
 
Security Posture
Lockfile ✖ · .env ✔ · node_modules ✔
 
Platform
Native modules: turbo
 
Code Quality
Files: 36 · Functions: 183 · Avg complexity: 2.62 · Avg length: 21.13 lines
Max nesting: 2 · Circular deps: 0 · Dead code: 0%
God files: apps/admin/src/pages/Products (448 lines)
 
Database Schema
postgresql · 8 models · 1 enum
Models: Address, CartItem, Category, Order, OrderItem (+3 more)
 
Findings (16 errors, 11 warnings)
Node.js runtime ">=18.0.0" reached end-of-life on 2025-04-30 (latest: 24.0.0).
vibgrate/runtime-eol in .
TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in .
60% of dependencies are 2+ major versions behind in node-turborepo.
vibgrate/dependency-rot in .
@types/node is 6 major versions behind (spec: ^20.11.0, latest: 26.3.0).
vibgrate/dependency-major-lag in .
TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in apps/admin
Vite is 3 major versions behind (current: 5.4.21, latest: 8.2.2).
vibgrate/framework-major-lag in apps/admin
vite is 3 major versions behind (spec: ^5.0.12, latest: 8.2.2).
vibgrate/dependency-major-lag in apps/admin
TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in apps/api
Vitest is 3 major versions behind (current: 1.6.1, latest: 4.1.11).
vibgrate/framework-major-lag in apps/api
@types/node is 6 major versions behind (spec: ^20.11.0, latest: 26.3.0).
vibgrate/dependency-major-lag in apps/api
vitest is 3 major versions behind (spec: ^1.2.1, latest: 4.1.11).
vibgrate/dependency-major-lag in apps/api
Next.js is 2 major versions behind (current: 14.2.35, latest: 16.3.3).
vibgrate/framework-major-lag in apps/web
TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in apps/web
@types/node is 6 major versions behind (spec: ^20.11.0, latest: 26.3.0).
vibgrate/dependency-major-lag in apps/web
TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in packages/config
56% of dependencies are 2+ major versions behind in @repo/config.
vibgrate/dependency-rot in packages/config
eslint-plugin-react-hooks is 3 major versions behind (spec: ^4.6.0, latest: 7.1.1).
vibgrate/dependency-major-lag in packages/config
Prisma is 2 major versions behind (current: 5.22.0, latest: 7.10.0).
vibgrate/framework-major-lag in packages/database
TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in packages/database
75% of dependencies are 2+ major versions behind in @repo/database.
vibgrate/dependency-rot in packages/database
TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in packages/types
100% of dependencies are 2+ major versions behind in @repo/types.
vibgrate/dependency-rot in packages/types
TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in packages/ui
TypeScript is 2 major versions behind (current: 5.9.3, latest: 7.0.2).
vibgrate/framework-major-lag in packages/utils
Vitest is 3 major versions behind (current: 1.6.1, latest: 4.1.11).
vibgrate/framework-major-lag in packages/utils
67% of dependencies are 2+ major versions behind in @repo/utils.
vibgrate/dependency-rot in packages/utils
vitest is 3 major versions behind (spec: ^1.2.1, latest: 4.1.11).
vibgrate/dependency-major-lag in packages/utils
 
╭──────────────────────────────────────────╮
Top Priority Actions
╰──────────────────────────────────────────╯
 
1. Upgrade EOL runtime in node-turborepo
End-of-life runtimes no longer receive security patches and block ecosystem upgrades.
./.
>=18.0.0 → 24.0.0 (6 majors behind)
Impact: −10 drift points (runtime & EOL)
 
2. Fix security posture: no lockfile found
Without a lockfile, installs are non-deterministic. Run the install command to generate one and commit it.
./
Missing: package-lock.json, pnpm-lock.yaml, or yarn.lock
 
3. Upgrade Vite 5.4.21 → 8.2.2 in @repo/admin (+2 more)
3 major versions behind. Major framework drift increases breaking change risk and blocks access to security fixes and performance improvements.
./apps/admin
Vite: 5.4.21 → 8.2.2 (3 majors behind)
./apps/api
Vitest: 1.6.1 → 4.1.11 (3 majors behind)
./packages/utils
Vitest: 1.6.1 → 4.1.11 (3 majors behind)
Impact: −5–15 drift points
 
4. Reduce dependency rot in @repo/types (100% severely outdated)
1 of 1 dependencies are 2+ majors behind. Run `npm outdated` and prioritise packages with known CVEs or breaking API changes.
./packages/types
typescript: 5.9.3 → 7.0.2 (2 majors behind)
Impact: −5–10 drift points
 
5. Reduce dependency rot in @repo/database (75% severely outdated)
3 of 4 dependencies are 2+ majors behind. Run `npm outdated` and prioritise packages with known CVEs or breaking API changes.
./packages/database
@prisma/client: 5.22.0 → 7.10.0 (2 majors behind)
prisma: 5.22.0 → 7.10.0 (2 majors behind)
typescript: 5.9.3 → 7.0.2 (2 majors behind)
Impact: −5–10 drift points
 
╭──────────────────────────────────────────╮
Architecture Layers
╰──────────────────────────────────────────╯
 
Archetype: nextjs (80% confidence)
Files classified: 24 (11 unclassified)
Folders classified: 8
apps/admin/src presentation 100% 4 files
apps/admin/src/pages presentation 100% 2 files
apps/api/src/middleware middleware 100% 2 files
apps/api/src/routes routing 100% 2 files
apps/web/src/app presentation 100% 4 files
apps/web/src/app/products presentation 100% 2 files
apps/web/src/app/products/[id] presentation 100% 1 file
packages/ui/src presentation 100% 6 files
Unclassified source (sample): 11
 
presentation 15 files drift ████████████████████ 100 risk high
routing 4 files drift ████████████████████ 100 risk high
middleware 2 files drift ███████▍░░░░░░░░░░░░ 37 risk moderate
config 2 files drift ░░░░░░░░░░░░░░░░░░░░ 0 risk none
shared 1 file drift ████████████████████ 100 risk high
 
╭──────────────────────────────────────────╮
DriftScore Summary
╰──────────────────────────────────────────╯
 
DriftScore: 66/100
Risk Level: HIGH
Projects: 9
Classified: 8 nano · 1 micro · 0 small · 0 standard
Billable: 0.42 · 9 detected → 0.42 billable projects (micro-project pricing)
0.1 micro · 0.32 nano
These fractions add up across repositories, then round down to whole billable projects.
 
Score Breakdown
Runtime: ████████████████████ 100
Frameworks: █████████▏░░░░░░░░░░ 46
Dependencies: ██████▏░░░░░░░░░░░░░ 31
EOL Risk: ████████████████████ 100
 
Scanned at 2026-08-26T09:08:28.481Z · 7.1s · 286 files scanned · 56 workspace files · 27 dirs
Press Run to start.