Redesigning Pinterest’s Ad Ser... Note

Redesigning Pinterest’s Ad Serving Systems with Zero Downtime

Pinterest's ad-serving platform, Mohawk, had accumulated significant complexity and tech debt over its eight-year lifespan. To address these issues and lay the foundation for future growth, the Ads Infra team initiated a complete rewrite of the system in late 2021.The rewrite aimed to improve extensibility, separation of concerns, and data integrity, while also enhancing development velocity and safety. After three months of research and evaluation, the team decided to rebuild the service using Java and the Apex graph execution framework.A key design decision was to use Apex to organize code into directed acyclic graphs (DAGs), where each node represented a cohesive business logic unit. This allowed for modularity and extensibility.The team also developed an innovative data model passed through the graph to guarantee safe execution and data integrity.The redesigned service, named AdMixer, went live in production in mid-2023 without any significant outages. It has enabled faster product innovation, improved developer satisfaction, and resulted in infrastructure cost savings.The rewrite involved significant collaboration and contributions from over 280 engineers. The team attributed their success to careful planning, adherence to engineering design principles, and a commitment to quality and safety.The new AdMixer service has provided a solid foundation for Pinterest's ad business and is well-positioned to support future growth and innovation.