---
title: "Why does Neon use Paxos instead of Raft, and what’s the difference?"
description: "Neon replaces Postgres's storage layer with distributed storage, so stateless compute nodes act as Paxos proposers and a fixed set of disk-backed safekeepers act as acceptors."
url: "https://swe.quest/articles/why-does-neon-use-paxos-instead-of-raft-and-what-s-the-difference-f6a04ce40b5e85a1"
canonical: "https://neon.com/blog/paxos"
source: "Neon"
published: "2022-08-02"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 14
tags: ["consensus","replication","postgres","distributed-databases","formal-methods"]
---

# Why does Neon use Paxos instead of Raft, and what’s the difference?

A post on [Neon](https://swe.quest/sources/neon.md), published 2022-08-02, 14 min read, Deep dive. Original: [https://neon.com/blog/paxos](https://neon.com/blog/paxos)

## Summary

Neon replaces Postgres's storage layer with distributed storage, so stateless compute nodes act as Paxos proposers and a fixed set of disk-backed safekeepers act as acceptors. Raft assumes uniform nodes that can each become leader, so it doesn't fit this split. Neon combines a Raft-like term-based election with Paxos-style role separation and recovery, and checks its modifications with TLA+. Competing compute nodes can stall each other, but safekeepers reject WAL from stale terms, so data stays safe while the control plane restores liveness. This avoids the slow 10-30s failovers of Patroni/etcd-style setups.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Consensus](https://swe.quest/tags/consensus.md) (Distributed systems)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Distributed databases](https://swe.quest/tags/distributed-databases.md) (Data & databases)
- [Formal methods](https://swe.quest/tags/formal-methods.md) (Architecture & design)

## Prerequisites

- Postgres WAL replication ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- Raft basics ([easy posts on Consensus](https://swe.quest/tags/consensus.md?difficulty=easy))
- distributed consensus concepts ([easy posts on Consensus](https://swe.quest/tags/consensus.md?difficulty=easy))

## Keywords

Neon, Paxos, Raft, TLA+, Patroni, safekeeper, PostgreSQL

## Related posts

- [Architecture decisions in Neon](https://swe.quest/articles/architecture-decisions-in-neon-01182afd96537274.md): Neon · 2022-07-08 · Medium · 9 min read · PostgreSQL, Storage engines, System design, Serverless, Replication
  Neon built serverless Postgres by separating storage from compute without forking Postgres.
- [Deep dive into Neon storage engine](https://swe.quest/articles/deep-dive-into-neon-storage-engine-efc0ffc53406f34d.md): Neon · 2023-03-30 · Hard · 7 min read · Storage engines, PostgreSQL, Distributed databases, Serverless, Replication
  Neon's storage engine separates Postgres compute from storage and serves pages through GetPage@LSN, reconstructing any page as of any log sequence number from immutable layer files.
- [What you get when you think of Postgres storage as a transaction journal](https://swe.quest/articles/what-you-get-when-you-think-of-postgres-storage-as-a-transaction-journal-a74912c90f281399.md): Neon · 2024-05-01 · Medium · 9 min read · PostgreSQL, Storage engines, Replication, Distributed databases
  Neon treats Postgres storage as a transaction journal: the write-ahead log becomes the source of truth instead of a recovery aid.
- [Our Approach to High Availability](https://swe.quest/articles/our-approach-to-high-availability-0ddd5899b8c18a1c.md): Neon · 2024-10-25 · Easy · 5 min read · PostgreSQL, Replication, Resilience, Cloud platforms, Databases
  Neon treats high availability as a consequence of separating stateless compute from distributed storage rather than as a paid add-on.
- [SELECT ’Hello, World’](https://swe.quest/articles/select-hello-world-151ac208b5f708c9.md): Neon · 2022-06-15 · Easy · 5 min read · PostgreSQL, Storage engines, Serverless, Cloud platforms, Multi-tenancy
  Neon is a serverless Postgres service built on separated storage and compute, launching behind a waitlist.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
