Skip to contentSkip to footer
Tech & Innovation

Rust-based Paxos consensus engine built with AI coding agents

2 min read

Developer builds Rust consensus engine with AI, hitting 300K ops/sec A developer used AI coding agents over several months to build a production-grade distributed consensus engine in Rust, modernising Microsoft Azure's Replicated State Library for contemporary hardware. The project produced over 130K lines of Rust code and achieved a performance increase from 23K operations per second to 300K operations per second.

Rust-based Paxos consensus engine built with AI coding agents - Technology news

Rust-based Paxos consensus engine built with AI coding agents

A developer has used AI coding agents to build a production-grade, Rust-based multi-Paxos consensus engine designed to modernise the architecture underpinning many major Azure services. The project demonstrates how AI-assisted development can dramatically accelerate complex systems work, with the developer sharing several techniques around correctness, specification-driven development, and performance optimisation.


A developer has spent several months stress-testing how far AI coding agents can take a solo engineer when building real, production-grade distributed systems. The result is a Rust-based multi-Paxos consensus engine that implements the full feature set of Azure's Replicated State Library (RSL), the consensus layer underpinning many major Azure services, while modernising it for contemporary hardware and workloads.

The project covers multi-Paxos, leader election, log replication, snapshotting, and configuration changes. The developer reports that the original RSL was written more than a decade ago and has not evolved to match modern hardware demands, leaving gaps in latency, throughput, and architectural flexibility that this new implementation aims to close.

How It Works

The developer used a range of AI coding agents throughout the project, including GitHub Copilot, Claude Code, Codex, Augment Code, Kiro, and Trae. Over time, the workflow settled on Claude Code and Codex CLI as the primary drivers, with a code editor handling diffs and minor edits. Working from the command line created what the developer describes as an asynchronous flow that maximised productivity.

A key insight was the use of AI-driven code contracts to ensure correctness. These contracts specify preconditions, postconditions, and invariants for critical functions, which are converted into runtime assertions during testing and can be disabled in production builds. The project also includes a substantial test suite spanning unit tests, minimal integration tests, and full multi-replica integration tests with injected failures.

Performance optimisation was another significant focus. Through iterative work with AI agents, throughput was increased substantially from an initial baseline to a significantly higher operations-per-second figure, though the developer notes this required several weeks of dedicated effort.

Getting Started

The developer has shared their learnings publicly, covering three main areas: ensuring correctness with code contracts, applying lightweight specification-driven development, and pursuing aggressive performance optimisation. The post also includes a wish list for the future of AI-assisted coding.

The project represents a practical account of what a single developer can achieve using currently available AI tooling on a genuinely complex engineering problem. Those interested in distributed systems, Rust development, or AI-accelerated workflows may find the documented techniques and lessons directly applicable to their own work.

Story based on discussion on Hacker News.

Enjoyed this tech story? Share it with others!