Namespace

Create a namespace

/ Create, / Namespace

Create a namespace #

Creates a new namespace.

Examples #

If creating a website namespace, the following request creates a new namespace called website:

PUT /_namespace/website

Request #

PUT /_namespace/<name>

/_ns/<name> is accepted as a shorter alias.

Path parameters #

  • <name>
    (Required, string) The name of the namespace. Namespace names must meet the following criteria:
    • Lowercase only
    • Cannot include \ /, *, ?, ", <, >, |, , ,, #
    • Cannot start with -, _, +
    • Cannot be . or ..
    • Cannot be longer than 255 bytes (note it is bytes, so multi-byte characters will count towards the 255 limit faster)

Namespace

/ Namespace

Namespace #

Pizza supports a multi-tenant architecture, allowing different sets of data for various scenarios to be stored within a single engine. Each set is referred to as a namespace, and different namespaces can have distinct topologies and access permissions configured.

Usually, there’s no need to set up an additional namespace, and the default namespace is default.

Within a namespace, there are several types of data:

  • Collection, Docs: Collections of documents.
  • Data: Source data, stored in columns layout.
  • Index: Indexed data, built based on Data, optional.
  • View: View data, composite views of data across collections.

Namespace management #

Namespace APIs are used to manage individual Namespace and settings.

...

Delete a namespace

/ Delete, / Namespace

Delete a namespace #

Delete an existing namespace.

Examples #

The following request delete the namespace called website:

DELETE /_namespace/website

Request #

DELETE /_namespace/<name>

/_ns/<name> is accepted as a shorter alias.

Path parameters #

  • <name>
    (Required, string) The name of the namespace that you want to delete.

Response #

{ "acknowledged": true }

Trash semantics #

Deleting a namespace moves the WHOLE namespace into the trash: every collection’s data directory is retained under <data_path>/trash/ together with a namespace-level restore snapshot (one snapshot per collection — schemas, shard UUIDs, partition routing, placements). The sweeper physically deletes it after trash.retention_secs.

...