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, along with the averageutilizationof all ready replicas.When
utilizationexceeds 90%, consider increasing replica count.
Example:
{
"replicas": 2,
"status": {
"ready_replicas": 1,
"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 state of branching for the namespace. Only present for branched namespaces. Contains the following fields:
parent(string): The namespace this was branched from.
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.
Currently used to configure namespace pinning.
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
}
}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.