PlanetScale

What is a Neki router?

Sep 1, 2026Andres Taylor, Harshit Gangal, Ahmed Darwich
What is a Neki router?
SummaryAI, from the source post

This post introduces the Neki router, a component that sits between applications and sharded Postgres instances. It explains how the router handles client connections using a fleet of stateless processes, overcoming Postgres's process-per-connection bottleneck. The post details the two-plan system: the Neki plan for shard selection and result coordination, and the Postgres plan for shard-local execution. It illustrates single-shard routing with `EXPLAIN (NEKI_PLAN)` and scatter-gather queries with `EXPLAIN (NEKI_PLAN, NEKI_PG_PLAN)`, highlighting operators like `Route [EqualUnique]`, `Route [Scatter]`, `Limit`, and `Collapse`. The interaction with Postgres sidecars via gRPC is also described.

More from the Neki Query Performance trail