View Metadata
GET/v1/namespaces/:namespace/metadata
Returns metadata about a namespace.
Response
See the schema documentation.
The approximate number of logical bytes in the namespace.
This is a coarse approximation and may change over time as turbopuffer's data representation evolves.
When using disable_backpressure, this metric will not be updated until all data has been indexed.
The approximate number of rows in the namespace.
When using disable_backpressure, this metric will not be updated until all data has been indexed.
The timestamp when the namespace was created, in ISO 8601 format.
Example: "2024-03-15T10:30:45Z"
The timestamp when the namespace's data was last modified, in ISO 8601 format.
Example: "2024-03-19T09:12:14Z"
The timestamp when the namespace when the namespace's data or schema was last modified, in ISO 8601 format.
Example: "2024-04-16T09:27:32Z"
Describes how the namespace is encrypted.
Possible values include default server-side encryption and CMEK.
{
"mode": "default"
}The state of the index for the namespace. Contains the following fields:
-
status(string):updatingorup-to-date -
unindexed_bytes(integer):The number of bytes in the namespace that are in the write-ahead log but have not yet been indexed. Note that unindexed data is still searched by queries (see consistency for details).
Only present when
statusisupdating.
Namespace pinning provisions reserved compute for a namespace to provide predictable cost and performance for large namespaces with sustained query volume, with always-warm cache.
Only present when the namespace is pinned.
Contains the following fields:
-
replicas(integer): The number of read replicas configured for the namespace. Each replica increases read throughput. -
status(object): Operational status for the pinned namespace. When available, includes the number ofready_replicasthat are warm and able to serve traffic, the number of runningreplicas(replicas are billed once running, even before they finish warming their caches and become ready to serve traffic), along with the averageutilizationof all ready replicas. Thereplicascount is updated independently and may briefly disagree with the other status fields.When
utilizationexceeds 90%, consider increasing replica count.
Example:
{
"replicas": 2,
"status": {
"ready_replicas": 1,
"replicas": 2,
"utilization": 0.73
}
}
The state of branching for the namespace. Only present for branched namespaces. Contains the following fields:
parent(string): The namespace this was branched from.
The sharding configuration for the namespace. Only present for sharded namespaces. Contains the following fields:
num_shards(integer): The number of shards the namespace is partitioned across. Fixed at namespace creation.
Example:
{
"num_shards": 8
}
Whether document and schema writes are rejected for the namespace. Omitted when
false.
Example
import turbopuffer
tpuf = turbopuffer.Turbopuffer(
region="gcp-us-central1", # choose best region: https://turbopuffer.com/docs/regions
)
ns = tpuf.namespace(f"metadata-inspect-example-py")
metadata = ns.metadata()
print(metadata) # returns a turbopuffer.NamespaceMetadata objectBilling
This request is billed as a query that returns zero rows.
Change Metadata
PATCH/v1/namespaces/:namespace/metadata
Updates metadata configuration for a namespace.
Updates the configuration for a namespace.
Used to configure namespace pinning and read-only state.
Request
Configuration for namespace pinning, which provisions reserved compute for a namespace to provide predictable cost and performance for large namespaces with sustained query volume, with always-warm cache.
Set to null to remove pinning from a namespace.
Contains the following fields:
replicas(integer, optional): The number of read replicas to provision. Defaults to1. Each replica runs on its own reserved node, increases read throughput, and multiplies pinning cost.
{
"pinning": {
"replicas": 2
}
}Set to true to reject document and schema writes, or false to allow them.
Metadata updates remain available.
Writes already in progress may still commit after this setting is enabled. It should not be used as a transactional write barrier.
Branches and copies inherit the source namespace's setting when they are created. Their setting can be changed independently afterward.
{
"read_only": true
}Response
Returns the updated namespace metadata. See View Metadata response fields for details.
Billing
This request is billed as a query that returns zero rows.