You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restructure namespace documentation for clarity and separation of concerns (#4098)
- Create new OSS operations page (self-hosted-guide/namespaces.mdx) with lean how-to guidance
- Simplify encyclopedia page to focus on core concepts only, with callouts explaining portability
- Update best practices page to be platform-agnostic with clear labeling for Cloud vs OSS features
- Add cloud callout to Cloud namespace operations page directing to OSS equivalent
- Restructure with Nexus as preferred approach for cross-namespace communication
- Add organization patterns, naming conventions, and production safeguards
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: Brian MacDonald <brian.macdonald@temporal.io>
description: Best practices for managing Temporal Namespaces including configuration, retention, and optimization strategies.
3
+
title: Namespace Best Practices
4
+
sidebar_label: Namespace Best Practices
5
+
description: Best practices for organizing and managing Temporal Namespaces, including naming conventions, organizational patterns, and production safeguards.
6
6
toc_max_heading_level: 4
7
7
keywords:
8
8
- namespace management
@@ -14,121 +14,150 @@ tags:
14
14
- Namespaces
15
15
---
16
16
17
-
A [Namespace](https://docs.temporal.io/namespaces) is a unit of isolation within the Temporal platform. It ensures that workflow executions, task queues, and resources are logically separated, preventing any conflicts and enabling safe multi-tenant usage.
17
+
:::info Applies to both open source and Temporal Cloud
18
+
This page covers namespace best practices that apply to **both** open source Temporal and Temporal Cloud.
19
+
Platform-specific guidance is clearly labeled throughout.
18
20
19
-
Namespaces are created on the Temporal Service, and one Namespace will not impact another on the same Temporal Service. However, a single Namespace can be multi-tenant, and they act solely as a logical separation.
If you are running Temporal on your own, you might be familiar with services within a cluster, such as the front-end, backend, matching service, and more. In Temporal Cloud all of these services are managed by us, so you don’t have to worry about managing them at all!
27
+
A [Namespace](/namespaces) is a unit of isolation within the Temporal Platform.
28
+
It ensures that Workflow Executions, Task Queues, and resources are logically separated, preventing conflicts and enabling safe multi-tenant usage.
22
29
23
-
## How to Register a Namespace
30
+
## Naming Conventions
24
31
25
-
[Registering a Namespace](https://docs.temporal.io/namespaces#registration) creates the Namespace on the Temporal Service. You’re also required to set the retention period when creating the Namespace.
32
+
### Use lowercase and hyphens
26
33
27
-
On Temporal Cloud, use the Temporal Cloud UI or `tcld` commands to create and manage Namespaces. If no other Namespace is specified, the Temporal Service uses the Namespace `default` for all Temporal SDKs and the Temporal CLI.
34
+
Use lowercase letters and hyphens (`-`) as separators in Namespace names.
28
35
29
-
Temporal Cloud enforces limits on Namespace count and workflow execution size. You are allowed up to **10 Namespaces by default**. Exceeding this limit requires a support ticket.
36
+
-**Temporal Cloud**: Namespace names are case-insensitive, so `MyNamespace` and `mynamespace` refer to the same Namespace.
37
+
-**Open source**: Namespace names are case-sensitive, so `MyNamespace` and `mynamespace` are different Namespaces.
30
38
31
-
When it comes to naming Namespaces for your team, we recommend grouping them by factors such as teams, products or lines of business. You’ll also likely want to distinguish between dev and prod environments in the naming convention.
39
+
To avoid confusion across environments, always use lowercase.
32
40
33
-
Each Namespace in Temporal Cloud runs in a specific region, which determines where your workflows and data are hosted. Temporal Cloud currently runs on AWS and GCP, with support for other clouds planned for the future.
41
+
**Example**: `payment-checkout-prd`
34
42
35
-
While your cloud infrastructure might be limited to a single region, Temporal Cloud supports multiple regions, and you’ll have access to a full list of available regions during Namespace creation. To view the current list of supported regions and their operational status, visit: https://status.temporal.io
43
+
### Follow a consistent naming pattern
36
44
37
-
### Best Practices:
45
+
Use a pattern like `<use-case>-<domain>-<environment>` to name Namespaces:
38
46
39
-
#### 1. Use lowercase and hyphens for Namespace names: Temporal Cloud treats Namespace names as case-insensitive. To maintain consistency and avoid potential issues, use lowercase letters and hyphen (-) as separators. Example: `payment-checkout-prd`
47
+
| Component | Max Length | Examples |
48
+
|-----------|------------|----------|
49
+
| Use case | 10 chars |`payments`, `fulfill`, `orders`|
#### 2. Use domain, service, and environment to name Namespaces
42
-
Use the following pattern to name Temporal Namespaces: `<use-case>-<domain>-<region>-<environment>`
43
-
44
-
The following rules ensure that the Namespace name doesn’t exceed [39 characters](https://docs.temporal.io/cloud/namespaces#temporal-cloud-namespace-name):
45
-
- Use at most 10 characters for `use case` (e.g. `payments`, `fulfill`)
46
-
- Use at most 10 character for `domain` (e.g. `checkout`, `notify`)
47
-
- Use at most 5 characters for `region` (e.g. `aps1`, `apse1`)
48
-
- Use at most 3 characters for `environment` (e.g. `dev`, `prd`)
Note: [A Temporal Cloud account can have up to 100 Namespaces](https://docs.temporal.io/cloud/limits#namespaces) (soft limit).
94
+
For systems without Nexus, services can communicate via [Signals](/sending-messages#sending-signals) or [Child Workflows](/child-workflows) within the same Namespace.
62
95
63
-
#### 3. When selecting a region for your Namespace, choose one that aligns with your application's latency, compliance, and data residency requirements (use https://status.temporal.io/ to identify the right region for you).
96
+
:::note Workflow ID uniqueness
97
+
When multiple teams share a Namespace, prefix each Workflow ID with a service-specific string to ensure uniqueness.
98
+
Task Queue names must also be unique within the Namespace.
99
+
:::
64
100
65
-
Check out some more best practices for configuring Namespaces in [our documentation](https://docs.temporal.io/cloud/namespaces#general-guidance).
101
+
## Production Safeguards
66
102
67
-
##Manage Namespaces
103
+
### Use an Authorizer (open source only) {#authorizer}
68
104
69
-
With Temporal, it’s important to be able to configure your Namespaces as well as see details for them. Whether you’re self-hosting or using Temporal Cloud, you’re able to get details for your Namespaces, update Namespace configuration, and deprecate or delete your Namespaces.
105
+
Use a custom [Authorizer](/self-hosted-guide/security#authorizer-plugin) on your Frontend Service to set restrictions on who can create, update, or deprecate Namespaces.
70
106
71
-
On Temporal Cloud, use the Temporal Cloud UI or `tcld` commands to manage Namespaces. We provide [guidance for both methods](https://docs.temporal.io/cloud/namespaces#manage-namespaces) in our docs that you can reference.
107
+
If an Authorizer is not set, Temporal uses the `nopAuthority` authorizer that unconditionally allows all API calls.
72
108
73
-
Regardless of how you run Temporal, you must register a Namespace with the Temporal Service before setting it in the Temporal Client.
109
+
On Temporal Cloud, [role-based access controls](/cloud/users#namespace-level-permissions) provide namespace-level authorization without custom configuration.
74
110
75
-
We recommend you use a custom [Authorizer](https://docs.temporal.io/self-hosted-guide/security#authorizer-plugin) on your Frontend Service in the Temporal Service to set restrictions on who can create, update, or deprecate Namespaces. If an Authorizer is not set in the server options, Temporal uses the nopAuthority authorizer that unconditionally allows all API calls to pass through.
[Enable deletion protection](/cloud/namespaces#delete-protection) for production Namespaces to prevent accidental deletion.
78
114
79
-
#### 1. Enable deletion protection for `prd` Namespaces: [Prevent accidental deletion](https://docs.temporal.io/cloud/namespaces#delete-protection) of production Namespaces.
115
+
###Enable High Availability (Temporal Cloud only) {#high-availability}
80
116
81
-
#### 2. Enable multi-region replication for businesscritical use cases: For many organizations, ensuring high availability (HA) is required because of strict uptime requirements, compliance, and regulatory needs.
117
+
For business-critical use cases with strict uptime requirements, enable [High Availability features](/cloud/high-availability) for a [99.99% contractual SLA](/cloud/high-availability#high-availability-features).
82
118
83
-
For these critical use cases, enable High Availability features for specific Namespaces for a [99.99% contractual SLA](https://docs.temporal.io/cloud/high-availability#high-availability-features). When choosing between [same-region and multi-region replication](https://docs.temporal.io/cloud/high-availability/how-it-works#deployment-options), favor multi-region replication to optimize reliability over proximity.
119
+
### Use Infrastructure as Code (Temporal Cloud only) {#terraform}
84
120
85
-
By default, Temporal Cloud provides a [99.9% contractual SLA](https://docs.temporal.io/cloud/high-availability) guarantee against service errors for all Namespaces.
121
+
Use the [Temporal Cloud Terraform provider](/production-deployment/cloud/terraform-provider) to manage Namespaces.
122
+
If Terraform isn't suitable, scripting against the [Cloud Ops API](/ops) or [tcld](/cloud/tcld) is a good alternative.
86
123
87
-
Note: [enabling HA features for Namespaces will 2x the consumption cost](https://docs.temporal.io/cloud/pricing#high-availability-features).
124
+
This provides:
125
+
- Documentation of each Namespace's purpose and owners
126
+
- Prevention of infrastructure drift
127
+
- Version-controlled configuration changes
88
128
89
-
#### 3. Use Terraform to manage Namespaces:
90
-
Use [Temporal Cloud Terraform provider](https://docs.temporal.io/production-deployment/cloud/terraform-provider) to manage Temporal Cloud Namespaces. This allows us to maintain documentation that outlines the purpose of each Namespace and their owners. In addition, Terraform enables us to prevent infrastructure drift (e.g. someone accidentally deletes a Namespace).
129
+
Use `prevent_destroy = true` in your Terraform configuration to prevent accidental Namespace deletion via Terraform.
130
+
This is separate from [Temporal Cloud deletion protection](/cloud/namespaces#delete-protection), which prevents deletion through any interface.
91
131
92
-
Use `prevent_destroy = true` to prevent Terraform from destroying the Namespace.
[Tags](/cloud/namespaces#tag-a-namespace) are key-value metadata pairs that help organize, track, and manage Namespaces.
97
137
98
-
[Tags](https://docs.temporal.io/cloud/namespaces#tag-a-namespace) are key-value metadata pairs that can be attached to Namespaces in Temporal Cloud to help operators organize, track, and manage Namespaces more easily.
138
+
Tags complement your naming convention by adding metadata that doesn't fit in the Namespace name.
139
+
While the name captures use case, domain, and environment, tags can capture additional dimensions like team ownership, data sensitivity, or business criticality.
99
140
100
-
### Tag Structure and Limits
101
-
- Each Namespace can have a maximum of 10 tags
102
-
- Each key must be unique for a given Namespace (e.g., a Namespace cannot have both `team:foo` and `team:bar` tags)
103
-
- Keys and values must be 1-63 characters in length
104
-
- Allowed characters: lowercase letters (a-z), numbers (0-9), periods (.), underscores (_), and hyphens (-)
105
-
- Tags are not a secure storage mechanism and should not store PII or PHI
106
-
- Tags will not change the behavior of the tagged resource
107
-
- There is a soft limit of 1000 unique tag keys per account
141
+
### Recommended tag categories
108
142
109
-
We also recommend tagging your Namespaces based on the following criteria:
For tag structure, limits, and management instructions, see [How to tag a Namespace](/cloud/namespaces#tag-a-namespace).
118
153
119
-
Temporal Cloud provides a few configurable parameters associated with a Namespace, client, or service that determines how Temporal behaves for that scope. You can configure many of these settings when creating or editing a Namespace via the UI or CLI (`tcld`).
154
+
## SDK Client Configuration
120
155
121
-
You must also set Namespaces in your SDK Client to isolate your Workflow Executions to the Namespace. If you do not set a Namespace, all Workflow Executions started using the Client will be associated with the `default` Namespace. This means, you must have a default Namespace called `default` registered with your Temporal Service.
156
+
Set Namespaces in your SDK Client to isolate your Workflow Executions.
157
+
If you do not set a Namespace, all Workflow Executions started using the Client will be associated with the `default` Namespace.
122
158
123
-
Here are some of the typical Namespace settings you’re able to configure:
159
+
You must register a Namespace before setting it in your Client.
124
160
125
-
| Setting | Description |
126
-
|---------|-------------|
127
-
|`namespace` (SDK/client) | The name of the Namespace your client is scoped to |
128
-
|`retention`| How long workflow execution history is kept |
129
-
|`certificate`| The client certificate used for mTLS authentication |
130
-
|`codec_server_endpoint`| URL to a Codec Server for decrypting encrypted payloads in the UI |
131
-
|`default_task_queue`| The task queue used if none is specified in the workflow code |
132
-
|`search_attributes`| Custom fields that allow filtering and querying workflow executions |
133
-
|`data_converter`| Used to serialize/deserialize and encrypt/decrypt workflow payloads |
134
-
|`visibility settings`| Controls how workflow status data is indexed and queried |
0 commit comments