CalculatorMasters

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

Estimated storage (GB) = [(V × D × E × Sₑ + V × D × Sₐ) ÷ 1,048,576] × (1 + O ÷ 100) × R

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

VariableWhat It MeansUnit
V - dailyVisitorsAverage number of visitors entering the experiment each day.visitors
D - experimentDaysNumber of days the experiment collects data.days
E - eventsPerVisitorAverage number of stored events generated per visitor.events
Sₑ - averageEventSizeKbAverage stored size of one event record, including retained properties and identifiers.KB
Sₐ - assignmentSizeKbAverage stored size of one visitor-to-variant assignment record.KB
O - storageOverheadAllowance for indexes, metadata, fragmentation, and operational headroom.percent
R - replicationFactorNumber of complete database copies, including the primary copy.copies

Step-by-Step Calculation

1

Estimate total experiment visitors

For planning, each daily visitor is treated as a new visitor assignment.

totalVisitors = dailyVisitors * experimentDays

2

Estimate event records

This is the total number of event records expected during the experiment.

totalEventRecords = totalVisitors * eventsPerVisitor

3

Calculate raw event storage

Multiply event records by the average stored event size.

eventStorageKb = totalEventRecords * averageEventSizeKb

4

Calculate assignment storage

Each estimated visitor receives one stored assignment record.

assignmentStorageKb = totalVisitors * assignmentSizeKb

5

Convert combined raw data to GB

The calculator uses 1,048,576 KB per GB.

rawStorageGb = (eventStorageKb + assignmentStorageKb) / 1048576

6

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

Average daily visitors100,000 visitors
Experiment duration30 days
Tracked events per visitor5 events
Average event record size0.75 KB
Assignment record size0.20 KB
Database overhead25%
Replication factor2 copies
1

Total visitors

100,000 × 30

3,000,000 visitors

2

Event records

3,000,000 × 5

15,000,000 records

3

Raw event storage

15,000,000 × 0.75 KB

11,250,000 KB

4

Raw assignment storage

3,000,000 × 0.20 KB

600,000 KB

5

Raw storage

(11,250,000 + 600,000) ÷ 1,048,576

11.30 GB

6

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.

Try the Calculator →

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

1

Multiplying assignment records by the number of variants when each visitor receives only one variant assignment.

2

Using event payload size without including identifiers, timestamps, and stored properties.

3

Treating a replica count of two as one primary plus two additional copies rather than two total copies.

4

Leaving out indexes and operational headroom.

5

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.

Try A/B Testing Database Storage