Database Capacity Planner
Project table, index and WAL growth from row width, writes per day and retention — with every formula visible.
Schema & indexes
3 columns · 1 indexesEstimated data width 93 B + 8 B overhead.
Storage projection
41.47 GB retained · 2.16 GB WAL/month- Retained rows
- 144,000,000
- Fillfactor ratio
- 1.00
- Table (rows × rowWidth ÷ fillfactor(ratio))
- 25.92 GB
- Indexes (rows × (keyBytes + 8 B TID) × 1.5 B-tree slack)
- 15.55 GB
- WAL/month
- 2.16 GB
- Total retained
- 41.47 GB
| Month | Table | Indexes | WAL |
|---|---|---|---|
| 1 | 1.08 GB | 648.00 MB | 2.16 GB |
| 2 | 2.16 GB | 1.30 GB | 2.16 GB |
| 3 | 3.24 GB | 1.94 GB | 2.16 GB |
| 4 | 4.32 GB | 2.59 GB | 2.16 GB |
| 5 | 5.40 GB | 3.24 GB | 2.16 GB |
| 6 | 6.48 GB | 3.89 GB | 2.16 GB |
| 7 | 7.56 GB | 4.54 GB | 2.16 GB |
| 8 | 8.64 GB | 5.18 GB | 2.16 GB |
| 9 | 9.72 GB | 5.83 GB | 2.16 GB |
| 10 | 10.80 GB | 6.48 GB | 2.16 GB |
| 11 | 11.88 GB | 7.13 GB | 2.16 GB |
| 12 | 12.96 GB | 7.78 GB | 2.16 GB |
| 13 | 14.04 GB | 8.42 GB | 2.16 GB |
| 14 | 15.12 GB | 9.07 GB | 2.16 GB |
| 15 | 16.20 GB | 9.72 GB | 2.16 GB |
| 16 | 17.28 GB | 10.37 GB | 2.16 GB |
| 17 | 18.36 GB | 11.02 GB | 2.16 GB |
| 18 | 19.44 GB | 11.66 GB | 2.16 GB |
| 19 | 20.52 GB | 12.31 GB | 2.16 GB |
| 20 | 21.60 GB | 12.96 GB | 2.16 GB |
| 21 | 22.68 GB | 13.61 GB | 2.16 GB |
| 22 | 23.76 GB | 14.26 GB | 2.16 GB |
| 23 | 24.84 GB | 14.90 GB | 2.16 GB |
| 24 | 25.92 GB | 15.55 GB | 2.16 GB |
The planner turns a row width (typed directly or parsed from a column list), a daily write rate and a retention window into a month-by-month storage projection. Table bytes, per-index bytes and WAL churn are computed by separate, documented formulas so the estimate is auditable rather than opaque. A disk budget adds a crossing-month warning.
Examples
180-byte rows, 2 indexes
200,000 writes/day · 24 months · idx_email 64 B + idx_created 8 B≈ 25.9 GB table + ≈ 15.6 GB indexes; WAL ≈ 2.2 GB/monthA flagship sizing scenario: table and index bytes are computed separately and WAL is never folded into the retained total.
Column-list parsing
id bigint, location geometry, payload jsonb8 + 8 + 64 data bytes; geometry flagged as unknown-type assumptionKnown types map to fixed widths; heuristics and unknown-type assumptions are surfaced as chips.
Budget warning
disk budget = 100 GBCrossing month highlighted in the results panelThe crossing is based on retained table+index bytes only, matching the chart's cumulative series.
About this tool
The Database Capacity Planner turns a row width, a daily write rate and a retention window into a month-by-month storage projection. You can type the row width directly or paste a column list (id bigint, email varchar(255), …) and let the parser estimate it, then add index key widths, a fillfactor and a WAL multiplier.
Every number carries its formula. Table bytes are rows × row width ÷ fillfactor ratio; each index is rows × (key bytes + 8-byte tuple ID) × 1.5 B-tree slack; WAL is shown as its own monthly churn line rather than silently accumulated as retained data. The formula sheet next to the results uses the same constants as the code, so the estimate is auditable.
A disk budget adds a crossing-month warning, and the SVG growth chart has a matching data table for screen readers. The estimate is a planning aid: real engines vary with page layout, TOAST and compression, so treat the figures as an order-of-magnitude budget rather than a guarantee.
What this tool does not do
- Estimates are order-of-magnitude planning aids; real sizes vary with page layout, TOAST, compression and update-driven bloat.
- Index sizing assumes a generic B-tree with 8-byte tuple IDs; clustered InnoDB secondary indexes carry the primary key instead.
- WAL is reported as monthly churn only — retained WAL archives and replication slots are not modelled.
How to use this tool
Describe a row
Type an average row width in bytes, or paste a column list and let the parser map SQL types to widths (with a stated 30% text fill heuristic).
Set the workload
Enter writes per day, retention in months, fillfactor (50–100) and the WAL multiplier, then add one row per index with its key width.
Read the projection
The formula sheet shows table, index, WAL and total bytes; the chart and its data table show cumulative growth month by month.
Add a budget
Enter a disk budget in GB to see the month when retained table and index bytes cross it, then copy or download the summary as Markdown.
Use cases
Pre-launch instance sizing
Estimate a year-one disk footprint before provisioning a database, including index overhead and fillfactor.
Budget planning
Overlay a monthly storage budget and see the month when growth is expected to cross it.
Migration estimates
Parse a target column list and compare retention policies side by side before a migration.
Formula sheet
| Metric | Formula |
|---|---|
| Retained rows | writes/day × 30 × retention months |
| Table bytes | rows × row width ÷ fillfactor ratio (50–100 → 0.5–1.0) |
| Index bytes | rows × (key bytes + 8 B TID) × 1.5 B-tree slack, summed per index |
| WAL per month | writes/day × 30 × row width × WAL multiplier (churn, not retained) |
| Total retained | table bytes + Σ index bytes |
| Crossing month | first month where cumulative retained bytes exceed the disk budget |
Generic rows add 8 bytes of overhead; Postgres tuple mode adds a 24-byte header.
Common mistakes
Mistake:Using a raw fillfactor percentage in the formula.
Fix:Fillfactor is a 50–100 percentage; the code normalises by ÷100 before dividing, so 100 means no expansion and 50 doubles the table bytes.
Mistake:Adding WAL churn to the retained total.
Fix:WAL is recycled churn, not accumulating disk. The planner shows it as a separate monthly line; size archives or replication slots separately if you retain them.
Mistake:Treating varchar(255) as 255 bytes per row.
Fix:The parser uses a stated average-fill heuristic (30% by default) and flags it, so swap in a measured average from your data.
Frequently asked questions
How do I estimate row width?
Either type a measured average in bytes or paste a column list. The parser maps fixed-width types (bigint 8 B, int 4 B, uuid 16 B, timestamp 8 B) and uses a stated 30% average-fill heuristic for text and varchar(n) — change it from measured data for better accuracy. Unknown types are flagged and assumed to be 8 bytes. Add generic 8-byte overhead, or 24 bytes for the Postgres tuple-header mode.
How much overhead do B-tree indexes add?
Each index row stores the key bytes plus an 8-byte tuple ID (or row pointer), multiplied by 1.5 for typical B-tree page slack at roughly 67% occupancy. Composite keys sum their column widths. The planner shows this formula beside each index's byte total, and unique indexes are noted separately because they do not need duplicate-key slack.
Does WAL count toward disk usage?
WAL files are recycled, so churn does not accumulate as retained disk the way table rows do. The planner reports WAL as a separate monthly figure — writes/day × 30 × row width × multiplier — and never adds it to the retained total. If you retain WAL archives for point-in-time recovery or replication slots, size those separately using your retention policy.
What is fillfactor and how does it change totals?
Fillfactor reserves free space on each page for future updates. The input is a 50–100 percentage, normalised by dividing by 100: table bytes are rows × row width ÷ that ratio. At 100 there is no expansion; at 90 the table is about 11% larger; at 50 it doubles. Values outside 50–100 are clamped and warned about.
Is the estimate engine-specific?
The core formulas are engine-neutral: table bytes, index bytes and WAL churn from row width and write rate. The parser offers a generic 8-byte row overhead and a Postgres-style 24-byte tuple header. InnoDB stores rows in the clustered primary-key index and secondary indexes carry the primary key rather than a tuple ID, so MySQL totals need that adjustment — the tool states this rather than pretending the models are identical.
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.