Riviera: Universal Content Processing at Pinterest

How Pinterest's Riviera platform evolved to handle massive content ingestion and prepare data for AI/ML applications.

MiHiR SEN
MiHiR SEN
·2 min read
This piece details the evolution of Riviera, Pinterest's universal content processing platform. It explores how the platform was redesigned to handle massive content ingestion and support advanced AI and machine learning models, focusing on the architectural changes that enabled greater flexibility and performance.

At the heart of Pinterest lies a vast repository of visual content. Pins, videos, and ideas are uploaded by users from around the world. To make this content searchable, discoverable, and safe, Pinterest relies on a universal content processing platform known as Riviera.

The Challenge

Every piece of content uploaded to Pinterest must undergo a series of transformations. It needs to be resized, optimized, analyzed for spam, and enriched with metadata. Riviera was designed to handle this pipeline at a massive scale, processing thousands of items per second.

The Evolution for AI

As Pinterest increased its investment in AI, Riviera had to evolve. The platform needed to support more sophisticated machine learning models. It was no longer enough to simply analyze an image for color; the system needed to extract visual embeddings, classify content, and understand context.

To meet these demands, the engineering team rebuilt Riviera to be more flexible. The new architecture uses a declarative pipeline definition. Engineers can now easily add new "stages" to the pipeline without rewriting the core infrastructure.

Architecture

Riviera is built on a microservices architecture. It uses a message queue to decouple the ingestion process from the processing. When a user uploads a Pin, the event is placed on a queue. Consumer services pick up the event and execute the pipeline stages.

The platform is designed to be fault-tolerant. If a service fails, the work is re-routed to another instance. This ensures high availability and throughput.

The Impact

The evolution of Riviera has had a direct impact on user experience. By enabling richer metadata extraction, Pinterest has improved its recommendation and search engines. The platform also provides the data necessary to train the next generation of AI models.

The work on Riviera highlights a common trend in tech: legacy platforms must be modernized to support new use cases. The shift from simple data transformation to complex AI inference requires a fundamental rethinking of system architecture.