Architecture - rtbkit/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
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
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.
Adserver Connector
rtbkit/plugins/adserver
How to write an adserver connector
Analytics
rtbkit/plugins/analytics
Analytics Plugin
Augmentor
rtbkit/plugins/augmentor
How to write an augmentor
- 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)
Bid Request Parser
rtbkit/plugins/bid_requests
Used to convert a given type of bid request into RTBkit internal bid request format (RTBKIT::BidRequest)
Bidder Interface
rtbkit/plugins/bidder_interface
Http bidder interface
Multi bidder interface
Define a specific interface to communicate with given bidders (ie: which messages will be sent, how they will be formatted)
Bidding Agent
rtbkit/plugins/bidding_agent
How to write a bidding agent
How to write a bidding agent using Python and HTTP API
- Subscribes to a filtered stream of bid requests from the router
- Calculates the bidding price and priority for each bid
- Implements a bidding strategy
Data Logger
rtbkit/plugins/data_logger
How to write a data 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
Exchange Connector
rtbkit/plugins/exchange
How to write an exchange connector
How to write a win cost model
Exchange connectors
Exchange specific configuration
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
Filter
rtbkit/plugins/filter
How to write a filter
Those are the filters to be applied to bid requests, on top of already built-in filters