proomt

Search

Search posts, papers, and topics

All posts

PlanetScaleHarshit Gangal8 min readintermediate

The architecture of Neki

Summary

Neki is PlanetScale’s sharding layer for vanilla PostgreSQL that presents a single Postgres endpoint while routing queries across a fleet of Postgres instances. It does this with a set of tightly‑coupled components—Router, Sidecar, PostgresManager, Admin, Operator, and etcd‑backed Data Topology—each handling a specific piece of the scaling, failover, and query‑planning puzzle.

  • Neki runs unmodified PostgreSQL instances; all scaling and sharding logic lives in external components.
  • PostgresManager starts/stops the postgres process and configures replication for each instance.
  • Sidecar pools connections to PostgreSQL backends, offering three connection‑lifetime tiers (autocommit, transaction, advisory‑lock) based on Router hints.
  • A shard = a primary + ≥2 replicas; one shard is designated the authoritative shard to keep custom type OIDs consistent across the cluster.

Understanding Neki’s architecture shows how to build a production‑grade, sharded Postgres service without forking the database engine. The design demonstrates practical patterns—sidecar connection pooling, OID authority, Kubernetes operators, and distributed query planning—that can be reused in oth…

8/10

Related reading

  1. Introducing TIN: full-text search for Postgres

    PlanetScale’s TIN is a new PostgreSQL extension that implements a full‑text search index supporting Boolean, phrase, span, fuzzy, wildcard, regex, case/accent folding, COUNT(*) and BM25 top‑k queries. In a suite of benchmarks on an i7i.8xlarge EC2 instance (8 vCPU, 32 GB RAM), TIN built in 8 min 10 s (50.7 GB index) and outperformed ParadeDB, pg_textsearch and the built‑in GIN index by large marg…

    PlanetScaleplanetscale.com15 minHN20175
  2. Running OpenBao on Kubernetes with a CloudNativePG PostgreSQL backend

    Step‑by‑step recipe to run OpenBao (Vault fork) on Kubernetes using CloudNativePG as a password‑less, TLS‑authenticated PostgreSQL storage backend. Shows how to spin up a Kind cluster with the cnpg‑playground, deploy a 3‑node CNPG cluster with synchronous quorum replication, configure DatabaseRole‑based client certificates, set up pg_hba rules, and initialize OpenBao’s schema via a one‑off Job.

    CNCFcncf.io16 minHN2
  3. Article: Your Next DSL Author Is a Language Model

    Typed Domain Grounding (TDG) embeds a DSL inside a mainstream language the LLM already knows (e.g., Kotlin) and uses the host compiler as an oracle. The author describes five building blocks—embedding, choosing a host language with high training‑data frequency, compiler‑driven type safety, a generate‑compile‑repair loop, and an on‑demand teaching tool—and shows measured results from kUML, a Kotli…

    InfoQinfoq.com18 min
  4. Squalk: an old-school forum engine built on Nostr (NIP-29 groups, NIP-7D threads)

    Squalk is a SvelteKit‑based forum built on the Nostr protocol, implementing NIP‑29 groups and NIP‑7D threads. It can run in a single‑forum “simple” mode or a multi‑forum “full” mode, with chat sidebars, markdown resources, and optional server‑side rendering for SEO. Configuration is done entirely via `PUBLIC_` environment variables, and deployment scripts support both static hosting and Node SSR,…

    Lobstersgithub.com5 minlobste.rs12
  5. One Java Model from the App to PostgreSQL

    Codename One introduces a backend runtime allowing a single Java model to define entities and validation rules for both client applications and the server. This approach aims to reduce duplication and ensure consistent data rules from the app to PostgreSQL.

    CodeName Onecodenameone.com7 min