
A/B Testing Database Storage Formula
Learn how to estimate database storage for A/B test assignments and event records, including overhead and replication.
This calculation estimates the total database capacity needed during an A/B test. It combines visitor assignment data and tracked event data, then adds database overhead and the storage used by replica copies.
- 100% Free
- No Sign-Up Required
- Private & Secure
- Mobile Friendly
Estimated Provisioned Database Storage
Where:
Estimate visitors over the test period, calculate the event and assignment data they create, convert KB to GB, add overhead, and multiply by the number of complete database copies.
Variables Explained
| Variable | What It Means | Unit |
|---|---|---|
| V - dailyVisitors | Average number of visitors entering the experiment each day. | visitors |
| D - experimentDays | Number of days the experiment collects data. | days |
| E - eventsPerVisitor | Average number of stored events generated per visitor. | events |
| Sₑ - averageEventSizeKb | Average stored size of one event record, including retained properties and identifiers. | KB |
| Sₐ - assignmentSizeKb | Average stored size of one visitor-to-variant assignment record. | KB |
| O - storageOverhead | Allowance for indexes, metadata, fragmentation, and operational headroom. | percent |
| R - replicationFactor | Number of complete database copies, including the primary copy. | copies |
Step-by-Step Calculation
Estimate total experiment visitors
For planning, each daily visitor is treated as a new visitor assignment.
totalVisitors = dailyVisitors * experimentDays
Estimate event records
This is the total number of event records expected during the experiment.
totalEventRecords = totalVisitors * eventsPerVisitor
Calculate raw event storage
Multiply event records by the average stored event size.
eventStorageKb = totalEventRecords * averageEventSizeKb
Calculate assignment storage
Each estimated visitor receives one stored assignment record.
assignmentStorageKb = totalVisitors * assignmentSizeKb
Convert combined raw data to GB
The calculator uses 1,048,576 KB per GB.
rawStorageGb = (eventStorageKb + assignmentStorageKb) / 1048576
Add overhead and replication
Overhead increases the raw requirement, and replication multiplies it across complete copies.
estimatedStorageGb = rawStorageGb * (1 + storageOverhead / 100) * replicationFactor
Example: 30-day website experiment with two replicas
Total visitors
100,000 × 30
3,000,000 visitors
Event records
3,000,000 × 5
15,000,000 records
Raw event storage
15,000,000 × 0.75 KB
11,250,000 KB
Raw assignment storage
3,000,000 × 0.20 KB
600,000 KB
Raw storage
(11,250,000 + 600,000) ÷ 1,048,576
11.30 GB
Provisioned storage
11.30 × 1.25 × 2
28.25 GB
Final Result
Estimated provisioned database storage: 28.25 GB across replicas, averaging about 0.94 GB per experiment day.
Assumptions
- ✓Each daily visitor is counted as a new visitor assignment rather than a returning visitor.
- ✓Each visitor generates the selected average number of stored events.
- ✓Record-size inputs include the fields retained in the database.
- ✓The overhead percentage reasonably represents indexes, metadata, fragmentation, and headroom.
- ✓The replication factor counts complete copies of the same experiment data.
Limitations
- !Compression, storage-engine behavior, and data types can materially change actual disk use.
- !Backups, point-in-time recovery, logs, exports, and warehouse copies are not included.
- !Concurrent experiments can add assignment and event data beyond a single-experiment estimate.
- !Traffic and event rates may vary substantially from daily averages.
Common Mistakes to Avoid
Multiplying assignment records by the number of variants when each visitor receives only one variant assignment.
Using event payload size without including identifiers, timestamps, and stored properties.
Treating a replica count of two as one primary plus two additional copies rather than two total copies.
Leaving out indexes and operational headroom.
Using total page views as unique daily visitors without adjusting for repeat visits.
Related Formulas
Frequently Asked Questions
How is A/B testing database storage calculated?
The estimate adds event-record storage and visitor-assignment storage, converts the total from KB to GB, applies database overhead, and multiplies by the replication factor.
Why does the number of variants not multiply the storage estimate?
In a typical single experiment, a visitor is assigned to one variant. Variant count is useful context but does not create one assignment record for every variant.
What is a reasonable event record size for this formula?
Use a measured sample where possible. Include retained event properties, identifiers, timestamps, experiment data, and database-specific record overhead if it is part of the stored record.
Does the formula include database indexes?
Not directly. Indexes and related structures are represented through the storage overhead percentage.
Ready to calculate your result?
Use the calculator to get instant results with your own inputs.