An ad exchange is the digital marketplace where the auction for each ad impression runs, between the sellers' software and the buyers' software, in a fraction of a second. An impression is one showing of one ad to one person. The sellers are publishers, the owners of websites and apps. The buyers are advertisers, who bid through demand-side platforms (DSPs).
An exchange works like a very fast auction house with fixed rules. It receives an offer from the seller's side, sends it to many buyers, collects their bids, picks the winner and tells everyone the result. The messages follow a common format called OpenRTB, so that any buyer's software can read any seller's offer. This way of selling is described on the page on real-time bidding (RTB).
For instance, a person in Guwahati opens a weather app at 7 a.m. The app has an ad slot at the bottom of the screen. The app's in-app advertising monetisation software passes the slot to an exchange as a bid request. The request says: weather app, a banner of 320 by 50 pixels, an Android phone, Assam, language English. The exchange sends the request to 30 DSPs and waits about 100 milliseconds. Twelve of them reply with bids. The highest is ₹48 CPM, meaning ₹48 per thousand impressions, from an umbrella brand that wants viewers in rainy places. Most exchanges now run a first-price auction, which means that the winner pays the price it bid. The exchange tells the winning DSP, and the umbrella ad appears in the app. The exchange keeps a small fee and passes the rest of the money towards the app maker.
The hard part is volume. A large exchange handles millions of bid requests every second, each with a deadline counted in milliseconds. To keep up, it stores the facts it must look up quickly, such as each buyer's settings, in a key-value store. This is a database that finds a record by one key almost instantly.
Offers reach an exchange in several ways. A website's header bidding code may ask the exchange for a bid directly. A supply-side platform (SSP) may send it a publisher's slots. A mobile ad network may sell its unsold app space there. Exchanges also screen out obvious bots, and buyers check the results afterwards with ad verification tools.
How does an exchange differ from an SSP? An SSP is the seller's own tool, which chooses among many exchanges and buyers for one publisher. An exchange is the meeting place itself, open to many publishers and many buyers. Today, many companies run both, so the two are often sold together.