-
Notifications
You must be signed in to change notification settings - Fork 84
Multi bidder model with communicator for Win notifications
One possibility is to have NGINX as a load-balancer for HTTP requests , in this case Host1 and Host2 are running our main stack and Host3 ( picked up as arbitrary) is listening for Win notifications by pairing HTTP-handler with Communicator. Communicator delivers UDP-broadcast to every host on the network and collects ack basically UDP becomes R-UDP. The matching of the Win is done by each host, or ignored if it does not match uuid. This can further be simplified and instead of R-UDP and 2 way guaranteed communication between master-banker/campaign-manager on one side and bidders on the other we can use unreliable UDP broadcast with communicator on Host3 and can simply notify bidders of changes to their budget/CPA/CPM/etc after Win was applied to campaign budget or when campaign manager receives updates from UI . In the latter all budgets are kept in the central place e.g. master-banker cache shared between master-banker and campaign-manager.
In case when multiple bidders are running on the the same or different host, communicator must be paired with exchange_handler to do MPI-like communication with the bidders. Communicator supports similar to MPI broadcast/gather operations. The gather operation represented by collect() function of communicator. Collect function returns when either all bidders have responded or when the timer goes off, which ever comes first.