Skip to content

Latest commit

 

History

History
66 lines (51 loc) · 3.13 KB

File metadata and controls

66 lines (51 loc) · 3.13 KB

OpenRaft Examples

This directory contains example applications demonstrating different implementation approaches for OpenRaft components.

Complete Applications

Component Overview

  • Log: LogStore implementation for storing raft logs
  • State Machine: StateMachine implementation for application state
  • RaftNetwork Impl: Transport protocol and client library used
  • RaftNetwork: Interface version (RaftNetwork vs RaftNetworkV2)
  • Client: HTTP/gRPC client library for application requests
  • Server: Web framework for handling incoming requests
  • Special Features: Unique characteristics of each example
Example Log State Machine RaftNetwork Impl RaftNetwork Client Server Special Features
raft-kv-memstore log-mem sm-mem HTTP/reqwest RaftNetwork reqwest actix-web Basic example
raft-kv-fjall [fjall] [fjall] HTTP/reqwest(network-v1) RaftNetwork reqwest actix-web Persistent storage
raft-kv-rocksdb rocksstore rocksstore HTTP/reqwest(network-v1) RaftNetwork reqwest actix-web Persistent storage
raft-kv-memstore-network-v2 log-mem sm-mem HTTP/reqwest RaftNetworkV2 reqwest actix-web Network V2 interface
multi-raft-kv log-mem sm-mem HTTP/channel GroupRouter channel in-memory Multi-Raft groups
raft-kv-memstore-grpc log-mem in-memory gRPC/tonic RaftNetwork tonic tonic gRPC transport
raft-kv-memstore-single-threaded log-mem in-memory HTTP/reqwest RaftNetwork reqwest actix-web Single-threaded runtime
raft-kv-memstore-opendal-snapshot-data log-mem in-memory+OpenDAL HTTP/reqwest RaftNetwork reqwest actix-web OpenDAL snapshot storage

Component Implementations

Storage Implementations

  • log-mem - In-memory Raft Log Store using std::collections::BTreeMap
  • sm-mem - In-memory KV State Machine implementation
  • rocksstore - RocksDB-based persistent storage using rocksdb crate

Backward Compatibility (since 0.10)

The following symbolic links are provided for backward compatibility:

  • mem-loglog-mem (renamed in 0.10)
  • memstore → mem-log → log-mem (renamed in 0.9)

Network Implementations

  • network-v1 - HTTP-based RaftNetwork interface V1 using reqwest crate

Utilities

  • types-kv - Shared KV request/response types for example crates
  • utils - Shared type declarations and utilities