Real-time bidding (RTB) systems must process ad requests within 100 milliseconds, covering network latency, request parsing, ad selection, and bid calculation. Demand Side Platforms (DSPs) require flexible architectures to handle fluctuating traffic without maintaining excessive idle capacity.
A typical DSP configuration includes 8 vCPU and 32 GB of RAM per node, with approximately 24 GB available for data. The system must manage a catalog of 500,000 ad objects across 20,000 campaigns, each with complex targeting lists, such as domain exclusions.
Storage methods significantly impact resource consumption. Storing targeting lists within each ad object requires over 1 TB of memory, while using references to shared lists reduces this to 42 GB. Inverted indexing with dictionaries further optimizes storage to 1.4 GB.
SQL-based storage often creates bottlenecks due to centralized database contention and network latency. Moving to embedded storage like SQLite eliminates network overhead but complicates data synchronization across nodes. In-memory processing offers predictable performance but remains linearly dependent on catalog size.
Bitmasking provides an efficient alternative by indexing targeting criteria at the campaign level rather than the ad level. This approach allows for rapid lookups by mapping specific targeting values directly to the relevant campaigns, significantly reducing the computational overhead during the selection process.






