15/39
Part 3 of 6 · EstimationLearn and do
Storage: rows a day times bytes a row
Each search logs the 20 listings it showed, with position and outcome, in a 100-byte row.
| Step | Result |
|---|---|
| 500 million searches × 20 rows | 10 billion rows a day |
| 10^10 rows × 100 bytes | 10^12 bytes = 1 TB a day |
| 90 days kept for training | 90 TB, before replication |
| every feature value, 2 KB a row | 20 TB a day |
The last line is the one that decides whether you log full features or a sample.
A billion float32 vectors take a terabyte
One billion vectors of 256 dimensions, in float32:
| Computation | Size | |
|---|---|---|
| one vector | 256 numbers × 4 bytes | 1,024 bytes |
| a billion | 10^9 × 1,024 bytes | ≈ 1.02 TB |
| in bf16 | 256 numbers × 2 bytes | 512 bytes, so 512 GB |
That doesn't fit in one machine's memory. bf16 halves it to 512 GB, still too big.
In the editor, write log_bytes(searches, rows, row_bytes, days) for the training logs, and vector_bytes(n, dims, bytes_per) for the vectors. The print line checks both against the two tables: 90 TB of logs and about 1 TB of vectors.