Asynchronous computing at Meta: Overview and learnings

We’ve made architecture changes to Meta’s event driven asynchronous computing platform that have  enabled easy integration with multiple event-sources.  We’re sharing our learnings from handling va…

Sayak Kundu
12 min readintermediate
--
View Original

Overview

The article provides an overview of Meta's event-driven asynchronous computing platform, detailing architectural changes that facilitate integration with various event sources and sharing insights from handling diverse workloads. It emphasizes the importance of design choices and the re-architecture process that enabled significant growth in workload execution.

What You'll Learn

1

How to implement an event-driven asynchronous computing platform

2

Why re-architecting systems can improve scalability and performance

3

When to choose between queues and streams for workload management

Key Questions Answered

What architectural changes were made to Meta's asynchronous computing platform?
Meta's asynchronous computing platform underwent significant architectural changes to enhance integration with multiple event sources, improve scalability, and support a five-fold growth in workloads. These changes included decoupling components and introducing a generic transport layer to manage execution efficiently.
How does the Facebook Ordered Queuing Service (FOQS) function?
FOQS is a distributed priority queuing service that allows items to be enqueued with timestamps for later consumption. It supports lease management for processing items, enabling consumers to ACK or NACK items based on processing success, ensuring reliable workload management.
What challenges did Meta face with its asynchronous computing platform?
Meta faced challenges such as increasing complexity in the dispatcher component, which consolidated too many responsibilities, and limitations in handling external data sources, leading to inefficiencies and duplicated efforts across teams.
What are the benefits of the new architecture for asynchronous computing?
The re-architected platform eliminates unnecessary data duplication, simplifies customer integration by providing first-class support for various data sources, and enhances end-to-end latency and cross-regional load distribution, ultimately improving operational efficiency.

Key Statistics & Figures

Workloads executed daily
multi-trillion
The platform currently supports a vast number of workloads executed each day, showcasing its scalability.
Growth in workload execution
five-fold
The re-architecture enabled a five-fold increase in workload execution over the past two years.

Technologies & Tools

Backend
Facebook Ordered Queuing Service (foqs)
Used as a distributed priority queuing service for managing workload ingestion and processing.

Key Actionable Insights

1
Decoupling system components can significantly enhance scalability and maintainability.
By breaking down the asynchronous computing platform into more granular components, Meta was able to streamline operations and allow teams to work on new features in parallel, reducing bottlenecks.
2
Choosing the right data source for workloads can lead to efficiency gains.
Meta's architecture supports both queues and streams, allowing customers to select the most efficient storage solution based on their specific use cases, which can reduce costs and improve performance.
3
Implementing a controlled-delay service can help manage retries without blocking workflows.
This service allows workloads to be retried after specified delays, preventing high-traffic streams from clogging while maintaining delivery guarantees.

Common Pitfalls

1
Consolidating too much logic in a single component can lead to operational challenges.
As the dispatcher in Meta's system grew to handle multiple responsibilities, it became difficult to scale operations and implement new features, highlighting the importance of modular design.

Related Concepts

Asynchronous Computing
Event-driven Architecture
Distributed Systems