Skip to content

Support Multi-Raft #1485

@ariesdevil

Description

@ariesdevil

Is your feature request related to a problem? Please describe.
We would like to embed OpenRaft into a service that needs to host many independent Raft groups side-by-side (a “multi-raft” deployment). Today each node instance can participate in only one Raft group, so we have to spin up one OpenRaft stack per group, which multiplies the amount of boilerplate (transport layers, storage wiring, metrics) and complicates lifecycle management.

Describe the solution you'd like
Introduce first-class support for managing multiple, isolated Raft groups within the same codebase. Ideally this could live in a separate crate within the repository (e.g. openraft-multi) that reuses the core openraft crate but coordinates shared resources such as networking, async runtimes, and storage pools while keeping state machines and membership fully isolated per group.

Describe alternatives you've considered

  • Running one process (or runtime) per Raft group, each embedding its own OpenRaft node. This works but wastes resources and makes orchestration harder.

  • Hand-rolling a thin abstraction layer that multiplexes RPC/storage calls across groups. This becomes fragile quickly, especially when dealing with leader election, snapshotting, and metrics in a shared environment.

Additional context
A lightweight multi-raft harness would help build systems like distributed key/value stores or message queues where thousands of shards map to independent Raft groups. The jraft multi-raft design is a good reference I think: it keeps per-group metadata separate while sharing threads and transports. Even a minimal prototype demonstrating how to register multiple Raft instances against a shared runtime would be a big step forward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions