neki

Provides guidance on PlanetScale Neki sharded Postgres and pre-sharding schema design practices.

1|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/CarlosPavajeau/light --skill neki-carlospavajeau
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: neki
Source: https://github.com/CarlosPavajeau/light/tree/main/.claude/skills/neki
Command: npx skills add https://github.com/CarlosPavajeau/light --skill neki-carlospavajeau

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Postgres databases that outgrow a single node require horizontal sharding, but retrofitting sharding onto an existing schema is costly and error-prone. This Skill provides authoritative information about Neki, PlanetScale's sharded Postgres product, plus concrete schema and query design practices that keep a database ready for future sharding. ## Core Features & Use Cases - Neki Product Overview: Explains what Neki is, its sharded Postgres architecture, and PlanetScale hosting recommendations. - Sharding Readiness Reference: Covers shard key selection, composite primary keys, co-located joins, reference tables, index design, foreign keys, transactions, and aggregations. - Use Case: When designing a multi-tenant Postgres schema, load this Skill to ensure every table carries a shard key, indexes lead with it, and queries stay single-shard so the database can scale horizontally later without rework. ## Quick Start Ask the assistant to review your Postgres schema for sharding readiness using the Neki skill.

Frequently Asked Questions about neki

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prepare a Postgres schema for future sharding?

Choose a shard key like tenant_id or user_id and add it to every tenant-scoped table, lead composite primary keys and indexes with it, and include it in every query's WHERE clause. This keeps lookups and joins shard-local so sharding later requires minimal rework.

What is Neki from PlanetScale?

Neki is a sharded Postgres product built by PlanetScale, the company behind Vitess. It provides horizontal sharding for Postgres databases so applications can scale beyond a single node, and it is not yet released but will be available soon.

How do I choose a shard key for PostgreSQL?

Pick an immutable, high-cardinality key present on every tenant-scoped table and included in frequent queries, such as tenant_id, org_id, or user_id. Use real workload data to favor a key that keeps your hottest queries single-shard.

Do foreign keys work across shards in a sharded Postgres database?

Cross-shard foreign keys are challenging to support and must typically move to application-level enforcement before sharding. Foreign keys within the same shard key may work depending on the implementation, and some systems require all FKs to be disabled.

Why do queries without the shard key cause performance problems?

A query missing the shard key becomes a scatter-gather operation that hits every shard instead of routing to one. Always include the shard key in the WHERE clause, and maintain mapping tables for lookups by non-shard columns.