Reference
Import an Existing Postgres Database into Neki with the PlanetScale CLI
This guide moves a Postgres database into a new, unsharded PlanetScale Neki database with pg_dump and pg_restore, then checks the result with row counts and content checksums. The import is offline: source writes stay stopped from the start of the dump until cutover. →
Isolate a Large Tenant on Its Own Neki Shard with the PlanetScale CLI
This guide uses a range shard index on tenant_id to place one large tenant on a dedicated Neki shard while every other tenant shares a second shard, then moves the dedicated shard to a larger configuration profile while reads continue. The range key bounds are hexadecimal, which determines where the boundaries go. →
Keep Ledger Transactions on One Neki Shard with the PlanetScale CLI
This guide shards a payments ledger by account_id on Neki and uses the __neki.tx_mode and __neki.fanout session settings so that a transaction touching a second shard, or a query that scatters across every shard, fails instead of running. A cross-account transfer is then written as two single-shard transactions linked by a transfer_id. →
Reshard a Live Table onto New Neki Shards with the PlanetScale CLI
This guide splits an existing, populated orders table across two new Neki shards while a writer keeps inserting rows, using a Reshard workflow driven from SQL on the Neki router. The workflow copies the rows, streams new writes, and moves traffic to the new shards in a cutover whose switch call took about three seconds. →
Run an Online Schema Change Across Neki Shards with the PlanetScale CLI
This guide adds a NOT NULL DEFAULT column to a 400,000-row table that is sharded across two Neki shards, using __neki.online_ddl_create while a writer keeps inserting rows. The workflow builds a shadow table on each data-bearing shard, then a single workflow_complete call cuts over; the writer paused for about five to six seconds around cutover and lost no rows. →
Scale Neki Router Groups Under Live Traffic with the PlanetScale CLI
This guide adds a dedicated router group for checkout traffic to a Neki database, connects through it, and resizes it with pscale branch router update while one long-lived connection and a stream of new connections keep querying. It records what a router resize does to open connections and how long it takes. →
Shard Orders and Inventory by Different Keys on Neki with the PlanetScale CLI
This guide shards an ecommerce schema on Neki with two keys: orders and order items by user_id, products and inventory by product_id, in two shard groups that share the same two shards. It then tests an idempotent order insert, a checkout transaction under tx_mode = 'single', and a join that crosses the two groups. →