Introducing Zelos: A ZooKeeper API leveraging Delos

Within large-scale services, durable storage, distributed leases, and coordination primitives such as distributed locks, semaphores, and events should be strongly consistent. At Meta, we have histo…

Ali Zaveri
16 min readadvanced
--
View Original

Overview

The article introduces Zelos, a new ZooKeeper API built on the Delos platform, aimed at improving the performance and modularity of distributed systems at Meta. It discusses the challenges faced with ZooKeeper and how Zelos addresses these issues through a more flexible architecture that allows for seamless migration and enhanced scalability.

What You'll Learn

1

How to leverage Delos for building strongly consistent distributed applications

2

Why Zelos provides a more modular and extensible alternative to ZooKeeper

3

How to implement session management in a distributed system using Zelos

4

When to use speculative execution for maintaining session ordering

Prerequisites & Requirements

  • Understanding of distributed systems and consensus protocols
  • Familiarity with ZooKeeper and its architecture(optional)

Key Questions Answered

What are the main challenges of using ZooKeeper at scale?
As Meta's workload has scaled, ZooKeeper's monolithic architecture has become a significant pain point, making modifications and tuning for performance difficult. The tightly integrated nature of ZooKeeper couples application state with its consensus protocol, limiting its scalability and flexibility.
How does Zelos improve upon ZooKeeper's architecture?
Zelos is built on the Delos platform, which abstracts many challenges in distributed consensus and state management. It separates application logic from consensus, allowing for a more modular and extensible system that can evolve without significant redesign.
What is the role of the SessionOrderingEngine in Zelos?
The SessionOrderingEngine ensures total ordering of commands within a session by speculatively sending commands to the shared log. It detects and handles any reordering of commands, maintaining the session's consistency while allowing for parallel processing.
How does Zelos manage session lifetimes without a leader?
Zelos employs a Local Session Manager (LSM) that tracks client sessions locally on each replica. It also uses a Global Session Manager (GSM) to replicate session management across the ensemble, ensuring efficient session handling without relying on a consensus-based leader election.

Technologies & Tools

Backend
Zookeeper
Used as a centralized service for coordination primitives before transitioning to Zelos.
Backend
Delos
The underlying platform on which Zelos is built, providing abstractions for distributed applications.

Key Actionable Insights

1
Implementing Zelos can significantly enhance the scalability of your distributed applications by leveraging Delos's strong consistency and modular architecture.
This is particularly relevant for organizations facing limitations with traditional ZooKeeper setups, as Zelos allows for easier adaptation to changing workloads.
2
Utilizing speculative execution in Zelos can improve throughput while maintaining session ordering, which is crucial for performance-sensitive applications.
This technique is beneficial in scenarios where maintaining strict ordering is essential, but performance cannot be compromised.
3
Transitioning to Zelos from ZooKeeper can be achieved without downtime by employing a barrier node strategy, ensuring a seamless migration.
This approach is vital for production environments where any downtime could lead to significant disruptions.

Common Pitfalls

1
Failing to account for the impedance mismatch between ZooKeeper and Delos can lead to complications during migration.
Understanding the differences in session management and ordering semantics is crucial to avoid issues when transitioning applications to Zelos.

Related Concepts

Distributed Systems
Consensus Protocols
Session Management
Scalability In Distributed Applications