Skip to main content

Schemas

A schema is a namespace for stores — think of it as a folder of stores. It groups and isolates them, similar to a schema in a relational database. Every store lives in exactly one schema.

📁 public🗂️ my_store🗂️ users📁 analytics🗂️ my_store🗂️ events
The same store name — my_store — lives in each schema, fully isolated.

The public schema

If you never mention a schema, everything happens in the built-in public schema. Most requests accept an optional schema field; omit it and the server uses public.

Python
# these target the public schema
client.create_store(db_query.CreateStore(store="my_store", dimension=4, ...))

# these target the "analytics" schema
client.create_store(db_query.CreateStore(store="my_store", schema="analytics", dimension=4, ...))

Why use custom schemas

  • Isolation — the same store name can exist in different schemas without clashing (analytics.my_store vs public.my_store).
  • Multi-tenancy / environments — give each tenant, team, or environment its own schema.
  • Bulk cleanup — dropping a schema removes every store inside it in one step.

Rules of thumb

  • The public schema always exists and cannot be dropped.
  • ListStores lists one schema at a time (defaults to public) — it does not span every schema.
  • Operations that target a store take the same optional schema field, so moving an example to another schema is a one-field change.