foundationdb/recipes/
mod.rs

1//! # FoundationDB Recipes
2//!
3//! This module provides high-level distributed system recipes for FoundationDB,
4//! similar to Apache Curator for ZooKeeper. These recipes implement common
5//! distributed system patterns and primitives on top of FoundationDB's
6//! transactional key-value store.
7//!
8//! ## Available Recipes
9//!
10//! - **Leader Election**: Distributed leader election mechanism that allows
11//!   multiple processes to coordinate and elect a single leader. This is useful
12//!   for implementing primary/secondary architectures, distributed task coordination,
13//!   and ensuring single-writer patterns in distributed systems.
14//!
15//! ## Usage
16//!
17//! Each recipe is behind its own feature flag to keep the core library lightweight.
18//! Enable the recipes you need in your `Cargo.toml`:
19//!
20//! ```toml
21//! [dependencies]
22//! foundationdb = { version = "*", features = ["recipes-leader-election"] }
23//! ```
24//!
25//! Or enable all recipes at once:
26//!
27//! ```toml
28//! [dependencies]
29//! foundationdb = { version = "*", features = ["recipes"] }
30//! ```
31
32/// Leader election recipe for distributed consensus
33#[cfg(feature = "recipes-leader-election")]
34pub mod leader_election;