TLDR Dev · ARTICLES & TUTORIALS

HOW FACEBOOK'S DISTRIBUTED PRIORITY QUEUE HANDLES TRILLIONS OF ITEMS

blog.bytebytego.com8 min read

Summary from the TLDR Dev newsletter

Facebook's Distributed Priority Queue (FOQS) is a horizontally scalable system built on sharded MySQL that handles trillions of queue operations daily for various background tasks like notifications, video encoding, and language translation. The system organizes work into namespaces (for multi-tenancy), topics (logical priority queues), and items (individual tasks with priority, payload, and timing metadata), allowing different services to process asynchronous workloads in isolation.