Reference · Control API
Distribution
Spread a project across shards by root type, move buckets without downtime and pin roots to regions.
- In the schema
- —
Placeable roots and usage#
A placement root is any top-level owner object (such as Account, Project, Site, World or Organization) that descendant types link to through required single owner links. When you push a schema, Napalm analyzes the link graph and classifies each object type as a root, a rooted descendant or a replicated reference table. See Schema: Placement roots and sharding for the schema rules.
Inferred root trees
Required owner links keep each root and its descendants on one shard.
Single-root overrides
Root overrides isolate a busy root on a dedicated shard online.
Regional root pins
Regional pins move a root tree into a target region permanently.
Inspect inferred root classifications and per-root traffic volume before enabling multi-shard placement.
Root placement map#
Enabling root placement assigns each root instance (whether an Account, Project, Site, World or Organization) to a numbered bucket and maps bucket ranges to shards in your cluster. A root override places one root UUID on a dedicated shard apart from the rest of its bucket to isolate heavy load or satisfy regional residency. Queries that filter on a root ID or traverse from a rooted record route straight to the owning shard without changing your project URL or application code.
| Route | Description | Scope |
|---|---|---|
GET /# | Read the active bucket placement map, root overrides, participating shards and core copies | Scoperead |
POST /# | Enable or disable root placement on a branch, or add and drain participating shards | Scopemanage |
GET /# | Inspect per-shard storage and query load and compute the recommended bucket moves to balance the cluster | Scoperead |
Online bucket moves and shard splits#
Move individual buckets or hot roots between existing shards, or split a loaded shard into two shards online.
| Route | Description | Scope |
|---|---|---|
POST / | Move one bucket of roots or a single root to another shard while the branch keeps serving | Scopemanage |
POST / | Split a heavily loaded shard into two shards that divide the original shard’s buckets | Scopemanage |
POST/projects/{id}/bucket-moves#
POST /projects/{id}/bucket-moves
- shardstringrequired
- Target shard slug (such as
shard-k3m9x2p7qa). The shard must already hold the branch. - bucketinteger
- Bucket number from the placement map or rebalance advice. Send
bucketorroot, not both. - rootuuid
- Single root UUID to isolate on
shardas a root override. Sendbucketorroot, not both. - ?branchstring
- Branch name (
mainwhen omitted).
Rows copy online while the branch keeps serving reads without interruption. Writes to the moved bucket or root pause for seconds at the final switch (step advances through copying, catchingUp, draining and clearing). Sending a region-pinned root to a shard outside that region answers 400 outside_region.
curl https://api.napalmdata.com/projects/$PROJECT/bucket-moves \ -H "Authorization: Bearer $NAPALM_TOKEN" \ -H "Content-Type: application/json" \ -d { "root": "6f1c2d3e-0000-4000-8000-000000000001", "shard": "shard-k3m9x2p7qa" }{ "operation": { "id": "0192c410-3a4b-7c8d-9e01-2f3a4b5c6d7e", "operationType": "rootMove", "status": "pending", "clusterId": "7a1e9c2b-4d3f-4b8a-9e6c-2f1d0b8a7c35", "projectId": "8a4d2c10-5e3b-4f9a-8c12-6d7e8f9a0b1c", "branch": "main", "root": "6f1c2d3e-0000-4000-8000-000000000001", "region": null, "sourceShard": "shard-a1b2c3d4e5", "targetShard": "shard-k3m9x2p7qa", "isAutomatic": false, "step": null, "placementVersion": null, "insertTime": "2026-11-10T17:04:00Z" }}POST/projects/{id}/shard-splits#
POST /projects/{id}/shard-splits
- shardstringrequired
- Slug of the ready data shard to split. The shard must hold at least two buckets of the branch.
- regionstring
- Three-letter airport code (such as
iad) for the new data shard. Defaults to the source shard’s region. - ?branchstring
- Branch name (
mainwhen omitted).
Splitting provisions a new data shard and moves the later half of the source shard’s buckets onto the new shard (buckets lists the moving [first, last] ranges, and step advances through forking, promoting, attaching, catchingUp, draining and clearing). The new shard’s machines count toward the organization’s monthly spend ceilings (402 monthly_limit_reached or 402 monthly_cap_reached). See Scale and recovery for architectural details.
curl https://api.napalmdata.com/projects/$PROJECT/shard-splits \ -H "Authorization: Bearer $NAPALM_TOKEN" \ -H "Content-Type: application/json" \ -d { "shard": "shard-a1b2c3d4e5", "region": "iad" }{ "operation": { "id": "0192c415-9b1c-7d2e-8f30-5a6b7c8d9e0f", "operationType": "shardSplit", "status": "pending", "clusterId": "7a1e9c2b-4d3f-4b8a-9e6c-2f1d0b8a7c35", "projectId": "8a4d2c10-5e3b-4f9a-8c12-6d7e8f9a0b1c", "branch": "main", "sourceShard": "shard-a1b2c3d4e5", "targetShard": "shard-p8r4v1w6yz", "buckets": [[64, 127]], "step": null, "placementVersion": null, "splitError": null, "insertTime": "2026-11-10T17:15:00Z" }}Regional root pinning#
| Route | Description | Scope |
|---|---|---|
POST /# | Pin a specific root UUID to shards in a target geographic region, or clear an existing regional pin | Scopemanage |
Pass { "region": "iad" } (or { "region": null } to clear a pin). Pinning a root migrates that root and all descendant rows to a shard in the target region and prevents future rebalances from moving the root out of the region.
Single-root point-in-time restore#
| Route | Description | Scope |
|---|---|---|
POST /# | Restore a single root and every descendant record to a specific timestamp without affecting other roots | Scopemanage |
POST /projects/{id}/root-restores
- rootstringrequired
- The UUID of the root to rewind.
- targetTimestringrequired
- An RFC 3339 time with an offset, before now and inside the cluster’s backup window.
- branchstring
- Query parameter: the branch name (main by default).
Napalm rewinds that root and all descendant rows to targetTime from the shard’s backups in one step while every other root on the shard keeps serving.
Consolidated core copies#
A core copy keeps a continuously updated copy of every shard’s rows on a single read-only shard. Cross-root analytical queries and global aggregations run on the core copy without fanning out across data shards.