Open-Source Wikis

/

Neon

/

By the numbers

neondatabase/neon

By the numbers

A quantitative snapshot of the Neon repository.

Data collected on 2026-04-30 against commit 6a35a3e9f on main.

Size

Lines of code by language (excluding vendor/, target/, and lock files):

xychart-beta horizontal
    title "Lines of code by language"
    x-axis [Rust, Python, C, SQL, Shell, "Markdown (docs)"]
    y-axis "Lines of code (thousands)"
    bar [302, 77, 25, 4, 1, 21]
Language Files Lines Notes
Rust 698 302,334 All services, libraries, and tools
Python 268 77,475 Integration tests in test_runner/
C 30 24,600 Inside pgxn/neon/ (extension + walproposer)
C headers 24 2,275 Postgres extension headers and walproposer
SQL 241 3,861 Migrations and Postgres regression fixtures
Markdown 131 20,725 docs/, READMEs, RFCs
Shell 1,118 scripts/, run_clippy.sh, pre-commit.py shim

The vendor/postgres-v{14,15,16,17} trees are vendored upstream Postgres and are excluded from the counts above.

Workspace structure

The Cargo workspace declares 51 member crates in Cargo.toml. They split into:

Group Count Examples
Top-level services 8 pageserver, safekeeper, proxy, storage_broker, storage_controller, storage_scrubber, compute_tools, endpoint_storage
Pageserver helpers 5 pageserver/compaction, pageserver/ctl, pageserver/client, pageserver/client_grpc, pageserver/page_api, pageserver/pagebench
Service clients / CLIs 3 safekeeper/client, storage_controller/client, control_plane/storcon_cli
Shared libraries (libs/) 25 utils, metrics, postgres_ffi, pq_proto, pageserver_api, safekeeper_api, walproposer, wal_decoder, remote_storage, vm_monitor, …
Build/dependency hack 1 workspace_hack
Postgres extension support 1 pgxn/neon/communicator

Largest source files

The biggest files are also the most central. They are good candidates for refactoring.

File Lines
pageserver/src/tenant.rs 12,926
storage_controller/src/service.rs 10,544
pageserver/src/tenant/timeline.rs 8,326
pageserver/src/metrics.rs 4,671
pageserver/src/page_service.rs 4,662
pageserver/src/tenant/timeline/compaction.rs 4,584
pageserver/src/http/routes.rs 4,276
pageserver/src/pgdatadir_mapping.rs 3,489
pageserver/src/tenant/remote_timeline_client.rs 3,304
storage_controller/src/tenant_shard.rs 3,220

TODO / FIXME / HACK

The Rust codebase contains 785 comments matching TODO|FIXME|XXX|HACK, broken down as:

Marker Count
TODO 654
FIXME 83
Other (XXX, HACK) 48

Activity

Commits per calendar year on main:

Year Commits
2021 1,146
2022 1,429
2023 1,709
2024 2,539
2025 1,647
2026 (partial, through Mar) 3

Total commits across history: 18,944.

In the trailing 365 days the repo has roughly 648 commits authored by 55 distinct people or service accounts. Cumulative distinct authors over the full history: 175.

Bot-attributed commits

Bot accounts (e.g. dependabot[bot], github-actions[bot], renovate[bot]) appear in roughly 8 of the last 647 commits (about 1.2%). Neon does not currently use Factory Droid or Copilot in a way that leaves git-history traces, so AI-assisted contribution rates cannot be reliably extracted from history alone.

Postgres versions supported

Makefile declares POSTGRES_VERSIONS = v17 v16 v15 v14. Each version has its own vendored tree under vendor/postgres-v* and a per-version build of the neon extension.

Cargo dependency footprint

Cargo.lock is 213 KB and tracks ~600 transitive dependencies. The workspace_hack crate (managed by cargo-hakari) pins versions across the workspace to keep build times reasonable.

Test surface

Area Files LOC
Rust unit tests (in-tree #[cfg(test)] and tests/) many counted in Rust LOC above
Python integration tests (test_runner/) 268 .py 77,475
Postgres regression test fixtures (test_runner/sql_regress/) 241 .sql 3,861

The CI runs both debug and release builds across all four supported Postgres versions; see .github/workflows/build_and_test.yml (the largest workflow, ~73 KB).

Where this stops being a snapshot

This page captures a single moment. For an evolving narrative — what was added, what was rewritten, what was removed — see lore. For ownership maps see maintainers.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

By the numbers – Neon wiki | Factory