Keyed lookups
Primary-key reads and POSTINGS indexes on the bid path.
Budget and frequency state maintained from the impression stream itself, so the counts that decide spend are current in the engine.
The problem
Ad serving runs on one of the tightest budgets in software: the bid path has very little time to look up audience and budget state, and it runs constantly. Frequency capping and budget pacing depend on counts that are right, and a drifting impression count is money spent wrong.
The standard stack caches audience and budget state in one system and counts impressions in another, reconciled after the fact. The bid path reads a snapshot that predates the current request.
You want per-campaign and per-user counters maintained from the impression stream itself, keyed lookups for the bid path, and attribution joins in the same engine.
Where NYXDB fits
Architecture
Impressions land in one table; grouped transformations keep spend and frequency per campaign and user in keyed tables; an ASOF LEFT JOIN or LOOKUP JOIN attaches campaign data to each event for attribution.
Audience and budget state is one keyed read away, by primary key or POSTINGS index, in UPSERT tables.
Spend per campaign stays current, maintained by a grouped fold over the impression table.
The count the cap reads is maintained by a fold keyed by (campaign, user).
Each event is stamped with the campaign data current at processing time, by a LOOKUP JOIN transformation.
In practice
The examples use the same two tables on every page. See the SQL reference for full syntax.
CREATE TRANSFORMATION balance_activity INTO balances ATTRIBUTE GROUP activity ASSELECT chain_id, recipient AS address, token, COUNT(*) AS transfer_count, MAX(transferred_at) AS last_transfer_at, MAX(_index) AS activity_indexFROM transfersGROUP BY chain_id, recipient, token;Capabilities
Primary-key reads and POSTINGS indexes on the bid path.
COUNT / SUM maintained by transformations.
Each impression write is persisted before acknowledgement.
Attach campaign data to each event in a transformation, with LOOKUP JOIN or ASOF LEFT JOIN.
Learn more
Explore HTAP & operational analytics or run a node.