etcd is a distributed, strongly consistent key-value store that serves as a foundational building block for distributed systems, particularly Kubernetes. In production, it runs as a Raft-based cluster (typically 3-5 nodes) providing gRPC and HTTP APIs for reading, writing, watching, and leasing key-value data. The server persists state via an MVCC engine over bbolt, with a write-ahead log (WAL) and snapshotting for durability and recovery. Key client libraries exist in Go (client/v3), along with CLI tools (etcdctl, etcdutl) and embedded server support. The architecture separates consensus (Raft), storage (MVCC/WAL/backend), API (gRPC/HTTP), and client layers, with extensive observability (Prometheus metrics, OpenTelemetry tracing). External dependencies include bbolt, the etcd-io/raft library, gRPC, protobuf, and Prometheus. While primarily an application/infrastructure project, it also includes research-grade robustness testing with model checking and fault injection, but these are testing tools, not the core purpose.
TiDB is a production-grade, open-source distributed SQL database with MySQL compatibility, horizontal scalability, strong consistency (ACID), and HTAP capabilities via TiKV (row store) and TiFlash (columnar store). The architecture separates compute (TiDB Server) from storage (TiKV/TiFlash) with PD for cluster management. Key entry points: cmd/tidb-server (SQL layer), lightning/cmd/tidb-lightning (TB-scale import), br/cmd/br (backup/restore), dumpling/cmd/dumpling (export). The codebase demonstrates exceptional craftsmanship with a modular design: the parser (pkg/parser) is a standalone MySQL-compatible SQL parser used by external projects; pkg/objstore provides a unified storage abstraction (S3/GCS/Azure/local/HDFS) with compression/encryption; pkg/dxf/framework implements a distributed execution framework with scheduler/task-executor/planner; pkg/timer provides distributed cron/interval scheduling with persistence; pkg/extension enables plugin-based authentication/session-hooks/custom-functions; pkg/util/chunk/arena/zeropool/mvmap/intset/bitmap provide high-performance columnar processing and memory management; pkg/expression uses code generation for vectorized SIMD evaluation; pkg/planner implements a Cascades-based cost-based optimizer with plan caching; pkg/ddl executes online schema changes via job-based distributed backfill with schema versioning; pkg/statistics maintains histograms/CMS/FM-sketch with auto-analyze priority queues. The repo includes comprehensive testing (unit, integration, realtikv, chaos) and modern Go practices (generics, interfaces, DI).
Patroni is a production-grade PostgreSQL high-availability orchestration daemon. Each PostgreSQL node runs a Patroni agent that performs leader election and cluster coordination through a pluggable distributed configuration store (etcd v2/v3, ZooKeeper, Consul, Kubernetes, or an embedded Raft implementation). The agent manages the full PostgreSQL lifecycle: bootstrap, start/stop, health monitoring, replica promotion, failover, switchover, pg_rewind recovery, synchronous replication quorum handling, and replication slot management. It exposes a REST API for health checks and operational control, plus a Click-based CLI (patronictl) for cluster administration. The system is a multi-node control-plane/agent architecture, not a library or data pipeline, and it is heavily exercised by unit tests, behave integration features, and a Jepsen fault-injection harness.
OpenRaft (databendlabs/openraft) is a production-grade Raft consensus library written in Rust, not a standalone application. It provides the replicated-log, leader-election, membership-change, and snapshot-streaming machinery that database teams embed in their own systems; known consumers include Databend, CnosDB, Walrus, RocketMQ-rust, and Hiqlite. The repository is structured as a workspace: the core `openraft` crate, a `legacy` crate for the deprecated v1 network API, runtime adapter crates (`rt`, `rt-tokio`, `rt-monoio`, `rt-compio`), example KV-store applications (HTTP/gRPC/RocksDB/WAL/OpenDAL backends), a Jepsen fault-injection suite in Clojure, and a deterministic-simulation test harness (`tests-turmoil`) that checks formal Raft invariants (election safety, log matching, leader completeness, state machine safety, monotonicity) against seeded network-failure scenarios. The codebase is at version 0.10.0-alpha.34: the public API is still churning, but the architecture is mature and unusually well tested.
Dkron is a production-grade, distributed cron and job scheduling system written in Go. It runs as a cluster of nodes coordinated via HashiCorp Raft for consensus and Serf for membership, providing fault tolerance and automatic leader election. The system exposes a REST API, a gRPC API, and an embedded React admin UI. Jobs are executed through a plugin architecture supporting multiple executors (shell, HTTP, Kafka, NATS, RabbitMQ, Google Cloud Pub/Sub, gRPC) and processors (log, file, syslog, Fluentd). The scheduler extends standard cron syntax with custom descriptors like @at, @after, and @manually, and supports retries, concurrency control, job chaining, and notifications via email/webhook. State is persisted in embedded BuntDB for application data and BoltDB for the Raft log, with optional cloud auto-join via go-discover. The project also includes a commercial Pro tier (ACL, encryption, failover) referenced in the codebase, but the core open-source code is fully functional and well-tested with unit, integration, and end-to-end tests.
DotNext is a suite of high-performance .NET libraries providing low-level infrastructure for building distributed systems and high-load microservices. It includes advanced async synchronization primitives (e.g., AsyncLock, AsyncReaderWriterLock, ManualResetCompletionSource), zero-allocation buffer management (SparseBufferWriter, SpanOwner, MemoryOwner), metaprogramming via expression tree builders (async lambda, await, while, lock), and a full Raft consensus implementation with a persistent write-ahead log, leader election, log replication, snapshotting, and HyParView gossip-based peer discovery. The codebase demonstrates deep expertise in .NET runtime internals, lock-free algorithms, unsafe memory access, and IL weaving, with extensive unit tests and benchmarks. It is actively maintained and targets the latest .NET versions, though some components rely on preview language features and runtime internals that may require careful version alignment.
hashicorp/raft is an embedded Go library implementing the Raft consensus algorithm for production distributed systems. In operation it manages a replicated log across a cluster: it performs leader election with pre-vote and leadership transfer extensions, replicates log entries from leader to followers with a quorum-based commit rule, snapshots and restores the replicated state machine, and handles cluster membership changes (voters, nonvoters, staging servers) via log-based configuration entries. It is the consensus engine embedded in HashiCorp Consul, Nomad, and Vault. There is no main package; it is consumed as a library through api.go entry points such as NewRaft, BootstrapCluster, RecoverCluster, Apply, AddVoter, RemoveServer, and LeadershipTransfer. Architecturally it is an interface-driven library: consumers plug in an FSM, LogStore, StableStore, SnapshotStore, and Transport. The core state machine lives in raft.go (runFollower/runCandidate/runLeader, processRPC), replication is handled by replication.go, quorum commit tracking by commitment.go, and a Future-based async pattern wraps all public API calls. The network transport (net_transport.go) abstracts any StreamLayer with connection pooling, FSM pipelining, and a heartbeat fast-path; in-memory stores and transports are provided for testing and embedding. The data flow is: Apply enqueues a log future, the leader appends it, replication sends AppendEntries to peers, commitment.go advances the commit index once a quorum matches, and a dedicated runFSM loop applies committed entries to the FSM. Snapshots are periodically written and shipped to lagging followers via InstallSnapshot. External runtime dependencies are deliberately small: go-hclog for logging, go-msgpack/v2 for wire encoding, and go-metrics (the deprecated armon implementation by default, with hashicorp/go-metrics opt-in behind a build tag). The repository also contains a significant verification wing: a fuzzy/ fault-injection cluster framework that exercises partitions, slow voters, membership churn, and leadership transfer while verifying FSM/log consistency, plus a raft-compat/ package that runs rolling-upgrade and pre-vote migration tests against a pinned older version. This gives the repo a hybrid character of production library plus research-grade protocol verification harness, but the dominant identity is a reusable application library. The project is actively maintained: commits land frequently (last commit 2026-10-12), CI runs via GitHub Actions, dependabot is enabled with zero alerts, and issues are triaged (58 open). Technical drift is medium: legacy protocol versions 0/1 and deprecated AddPeer/RemovePeer/peers.json paths are retained for backward compatibility, the default metrics dependency (armon/go-metrics) is deprecated, and the README/Makefile lag reality (README claims Go 1.16 while go.mod requires Go 1.25, and the Makefile pins golangci-lint v1.19.0 which is very old). These are compatibility burdens and documentation lag rather than rot; the core protocol code is current and well-tested.
Sorock is a Multi-Raft implementation in Rust that enables multiple Raft consensus processes to coexist in a single OS process for efficient resource sharing. The system implements a complete Raft consensus algorithm with optimizations including batched writes, heartbeat multiplexing, and Phi Accrual Failure Detector for adaptive leader failure detection. It provides gRPC services for client interaction (read/write operations) and includes CLI tools for cluster management (monitoring, remapping, syncing). The architecture follows a modular design where each shard maintains independent Raft state while sharing underlying storage and network connections.