Architecture - datacratic/rtbkit GitHub Wiki

The following page describes the architecture of RTBKit. The following diagram shows the components that are involved in the implementation of a fully-functional bidder. The core components are supplied by RTBKit whereas the others are either off-the-shelf components or must be implemented by users of RTBKit

Architecture

Core Components

This section provides a brief description of each of the RTBKit-supplied core components

Router

This is the central component of the RTB stack. It performs the following functions:

  • Receives bid requests from the various exchanges
  • Filters them for the bidding agents
  • Augments them with extra information (by calling the augmentors)
  • Mediates between multiple bids
  • Ensures real-time guarantees are met
  • Guarantees we do not overspend

Post-Auction Service

  • Receives bids from the router that have been submitted to the exchange
  • Receives notifications of wins, impressions, clicks and visits

Master Banker

This is the component that manages budgets associated with campaigns

  • Authorizes spend given by bidding agents
  • Keeps track of budgets for each campaign
  • Tallies up the spend for each campaign

Agent Configuration Service

  • Responsible for broadcasting each bidding agent's configuration to everything that needs to know about it
  • The type of information that they broadcast
    • What bid requests to send
    • How to send them
    • What creatives are available
    • Who to charge for ads that are bought
    • How to identify conversion events
  • Avoids the agents having to separately manage their configuration with every service they talk to
  • AgentConfigurationListener class provides a way to automatically stay up to date

Service Monitor

  • Checks that all processes are working correctly and provides authorization to the router for bidding on auctions at regular intervals
  • Without an explicit authorization the router will drop nearly all bid requests
  • Will cut off bids under the following conditions
    • No wins coming in from a given exchange
    • No impressions for a given ad server
    • Spend is exceeding reasonable levels

User-supplied Plugins

This section describes the components that users of RTBKit must supply in order to have a fully functional bidder.

Exchange Connector

An exchange connector is an exchange-specific C++ component that lives inside the router. It implements the exchange-specific logic that is needed to parse bid requests. It performs the following functions:

  • Parses and normalizes bid requests
  • It is responsible for sending back a bid response to the exchange within the maximum response time set by the exchange

Augmenter

  • Receives a series of bid requests and will add information to them in the form of tags or data. This information can be either per account or global to all accounts.
  • Subscribes to the Agent Configuration Service to know the augmentation for each client(bidding agent)

Bidding Agent

  • Subscribes to a filtered stream of bid requests from the router
  • Calculates the bidding price and priority for each bid
  • Implements a bidding strategy

Logger

  • A separate process that each component uses to save logs
  • Will perform required compression and rotation
  • Will also transfer logfiles to the cloud(coming soon)
  • Currently the logger process is connected to both the router and the post auction service