This document summarizes how SmartNews built a high performance ad server using Finagle to handle requests asynchronously. Key points include:
- The ad server was built in about 2 months using Finagle, an RPC framework from Twitter that uses asynchronous handling with Futures.
- Finagle allows building the server as a function that takes a request and returns a response asynchronously. It provides high performance backed by Netty and metrics via Tracer.
- The ad server implementation uses JSON parsing, data loading from a database, campaign filtering, and response generation in an asynchronous chained Future pattern for high throughput.
- Tips are provided for async handling, caching data, and focusing on IO-bound rather than CPU