---
title: "How we scale an open source, multi-tenant storage engine for Postgres written in Rust"
description: "Neon shards its Rust-based Pageserver storage layer by dividing each Postgres relation's 8KiB block numbers into stripes (default 256MiB) and hashing each stripe to a Pageserver."
url: "https://swe.quest/articles/how-we-scale-an-open-source-multi-tenant-storage-engine-for-postgres-written-in-e5615307ced50afc"
canonical: "https://neon.com/blog/how-we-scale-an-open-source-multi-tenant-storage-engine-for-postgres-written-rust"
source: "Neon"
published: "2024-04-15"
difficulty: "medium"
kind: "Case study"
reading_minutes: 5
tags: ["storage-engines","postgres","distributed-databases","multi-tenancy","scalability"]
---

# How we scale an open source, multi-tenant storage engine for Postgres written in Rust

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-04-15, 5 min read, Case study. Original: [https://neon.com/blog/how-we-scale-an-open-source-multi-tenant-storage-engine-for-postgres-written-rust](https://neon.com/blog/how-we-scale-an-open-source-multi-tenant-storage-engine-for-postgres-written-rust)

## Summary

Neon shards its Rust-based Pageserver storage layer by dividing each Postgres relation's 8KiB block numbers into stripes (default 256MiB) and hashing each stripe to a Pageserver. Large tenants then get I/O that scales with dataset size, and they stop competing with small tenants for resources. All shards subscribe to the Paxos-based Safekeepers and filter WAL down to their own pages, while Postgres routes GetPage@LSN reads directly to the right shard by hashing, with no proxy in between. Tables need to exceed stripe size × shard count (e.g. 2GiB with 8 shards) to use full throughput. Planned work includes shard-aware Safekeepers to cut WAL fan-out cost and shard splitting, since shard count is currently fixed at tenant creation.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Distributed databases](https://swe.quest/tags/distributed-databases.md) (Data & databases)
- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)

## Prerequisites

- Postgres WAL and pages ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- sharding basics ([easy posts on Distributed databases](https://swe.quest/tags/distributed-databases.md?difficulty=easy))
- separation of storage and compute

## Keywords

Neon, Pageserver, Safekeepers, GetPage@LSN, Paxos, Rust

## Related posts

- [Recent Storage Performance Improvements at Neon](https://swe.quest/articles/recent-storage-performance-improvements-at-neon-e29e2d9302293c1f.md): Neon · 2025-07-15 · Hard · 8 min read · PostgreSQL, Storage engines, Performance engineering, Distributed databases, Storage systems
  Neon shipped a set of storage-layer optimizations across Safekeepers and Pageservers.
- [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.
- [The Noisy Neighbor Problem in Multitenant Architectures](https://swe.quest/articles/the-noisy-neighbor-problem-in-multitenant-architectures-3c851a6c15e7f85b.md): Neon · 2025-04-03 · Easy · 8 min read · Multi-tenancy, PostgreSQL, Serverless, Cloud platforms
  Noisy neighbors in a shared Postgres instance such as AWS RDS degrade performance for every tenant through CPU saturation, work\_mem and shared\_buffers pressure, disk I/O contention on EBS, exhaustion of max\_connections, and lock contention from long transactions.
- [Everyone gets faster writes: We turned off FPW's in Neon](https://swe.quest/articles/everyone-gets-faster-writes-we-turned-off-fpw-s-in-neon-60d0cd25f29077e7.md): Neon · 2026-05-07 · Hard · 7 min read · PostgreSQL, Storage engines, Performance engineering, Distributed databases
  Neon disabled Postgres full-page writes fleet-wide because its stateless compute streams WAL to a Paxos safekeeper quorum and has no local disk pages that can tear.

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)
