Forum analytics: paying on writes for cheap summaries

The analytics experiments buy much cheaper live summaries by doing extra work when content changes. Four variants were measured against the same 16-call baseline; the dataset and all original forum behavior stayed exact. All four passed 22 native tests, canonical builds, full Small conformance, trap rollback and same-code KEEP. All 29 original scenario response digests match. These are exploratory runs of 16 samples; no analytics variant has a 64-sample final qualification.

All four variants maintain the same exact incremental topic, author and global content counters. Exact analytics additionally keeps exact reader/activity/length indexes. The two approximate backends use HLL, Count-Min plus SpaceSaving, and DDSketch. The dense follow-up changes only the exact metric-row index from Nyxus Maps to Nyxus Vec rows; its Nyxus sketch backend is unchanged.

Complete instructions in millions, including page fees. Individual method rows are per public call; discussion rows include all five or six calls. A dash means that the baseline does not expose the new capability.

Scenario Baseline Exact Nyxus / Map Minima / Map Nyxus / dense
Create topic + first post 3.711965 4.390009 4.460643 4.295593 3.918328
Reply 3.268271 4.155291 3.995911 4.156296 3.789569
Edit post / grow body 2.060526 2.956357 2.781980 2.967640 2.430559
Like add 1.939675 3.377532 2.787747 2.894636 2.416315
Like remove 1.929831 2.636542 2.616553 2.661577 2.265113
Advance read position 1.753258 1.753830 1.753509 1.913873 1.753509
Existing discussion, five calls 11.042651 13.389348 12.594360 12.886876 12.026474
New live topic metrics / 128 rows — 2.539725 2.624725 2.540285 1.590238
New live author metrics / 256 rows — 2.991081 3.011081 2.995232 2.240916
New lifetime analytics snapshot — 1.774257 1.443378 1.383082 1.433378
New mutation + metrics, six calls — 15.294138 14.078773 14.365739 12.864901
Original full-content audit / up to 4096 posts 155.018884 155.332147 155.352089 155.439311 155.292089
Original topic reconciliation / 128 topics 36.412881 36.470697 36.590689 36.529925 36.540734
Original author rollup / 256 authors 74.103900 74.329381 74.339337 74.315435 74.159329

The extra writes are visible. Versus the matched baseline, dense analytics costs +5.6% for topic creation, +16.0% for replies, +18.0% for edits, +24.6% for likes and +0.0143% for read advances. Its existing five-call discussion costs +8.9%. Summing the unchanged original29 schedule gives 5,232,355,341 instructions versus 5,163,783,002 (+1.33%); this includes the expensive original audits and excludes all new analytics calls.

The gains have two causes. Against exact analytics with Map metric rows, Nyxus sketches cut the lifetime snapshot by 18.6% and the new six-call interaction by 7.9%. Minima cuts that snapshot by 22.0% and the interaction by 6.1%. Separately, keeping the identical Nyxus sketch backend and making metric rows dense cuts topic metrics by 39.4%, author metrics by 25.6% and the six-call interaction by 8.6%. Those dense-index gains are exact representation gains, not probabilistic gains.

The new live topic/author queries cost about 22.9x / 33.1x less than the baseline topic/author scan-and-publish operations. These compare different useful contracts: the new queries omit ordered audit checksums, body verification, watch/unread joins and durable summary publication as applicable. The global snapshot summarizes current whole-board counters; the original audit verifies a selected post window. No original endpoint is automatically replaced, and all three original heavy methods still perform their original work.

HLL estimates unique users who ever advanced a read position; it is not a membership or permission check. The observed maximum reader error was 4.998751%, against a nominal relative standard error of 1.625%. Count-Min estimates lifetime accepted like-add events, with 32 exact-key SpaceSaving candidates for ranking. Duplicate likes add no event; unlike changes exact current likes without subtracting historical activity. Its worst measured additive overestimate was 156, including an estimate of 159 for a true count of 3: poor relative accuracy at low counts. It never underestimates this positive event stream, but fixed hashes do not give an adversarial error guarantee, and the candidate list is not exact top16 below its >N/32 heavy-hitter threshold. DDSketch summarizes accepted body-revision byte lengths, including edits, with exact lower-rank selection and a 2% relative value-error contract on 1–4096 bytes; observed error here was 0.105392%. This is a historical revision distribution, not the distribution of current post lengths.

All permissions, account/name uniqueness, ownership, bodies, actual posts/replies, exact current net likes and liked_by_me, moderation, pagination and business counters stay exact. Approximate responses identify their algorithms and error parameters. The original full-text audit and durable maintenance endpoints remain available.

Amortized complete seed instructions per item, in thousands; each cell is first / middle / last for a committed 500-item batch. These six position samples include allocation and page fees; they are not whole-population averages or isolated CPU counts. Baseline seed instructions were not sampled.

Seed items Exact Nyxus / Map Minima / Map Nyxus / dense
Posts 49.171 / 64.061 / 71.485 48.707 / 64.372 / 72.114 50.187 / 66.518 / 72.501 47.347 / 62.644 / 69.613
Likes 11.153 / 30.866 / 40.460 9.861 / 23.431 / 31.259 12.393 / 24.845 / 32.832 7.976 / 20.052 / 27.723

At the matched populated checkpoint, heap capacity was 114.6875 MiB baseline, 130.375 MiB exact analytics, 121.8125 MiB Nyxus/Map, 121.75 MiB Minima/Map and 121 MiB Nyxus/dense. Minima also used stable memory; it reached 256 KiB after the reader sketch was populated. These are grown capacities, not live allocation. Complete costs include stable fees, but this server does not export a separate unprofiled stable-fee ledger, so those fields remain unavailable.

The supported tradeoff is higher mutation cost for useful frequent live analytics. Incremental exact counters produce the large scan avoidance; sketches make the added lifetime analytics smaller and cheaper, with explicit accuracy costs. Dense metric indexing reduces the remaining write/read overhead independently.

Exact operation costs, normalized page fees and source identities are preserved in the portable method CSV, structured results and qualification catalog. The complete application report keeps these exploratory analytics screens separate from the final exact forum.