Skip to content

Commit cd7ed50

Browse files
becholsclaudebrianmacdonald-temporal
authored
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>
1 parent 0311fee commit cd7ed50

6 files changed

Lines changed: 224 additions & 169 deletions

File tree

Lines changed: 110 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
id: managing-namespace
3-
title: Managing a Namespace
4-
sidebar_label: Managing a Namespace
5-
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.
66
toc_max_heading_level: 4
77
keywords:
88
- namespace management
@@ -14,121 +14,150 @@ tags:
1414
- Namespaces
1515
---
1616

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.
1820

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.
21+
For reference documentation, see:
22+
- [Namespace concepts](/namespaces)
23+
- [Managing Namespaces (open source)](/self-hosted-guide/namespaces)
24+
- [Namespaces (Temporal Cloud)](/cloud/namespaces)
25+
:::
2026

21-
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.
2229

23-
## How to Register a Namespace
30+
## Naming Conventions
2431

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
2633

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.
2835

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.
3038

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.
3240

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`
3442

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
3644

37-
### Best Practices:
45+
Use a pattern like `<use-case>-<domain>-<environment>` to name Namespaces:
3846

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` |
50+
| Domain | 10 chars | `checkout`, `notify`, `inventory` |
51+
| Environment | 3 chars | `dev`, `stg`, `prd` |
4052

41-
#### 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`)
49-
50-
Examples: `payments-checkout-dev`, `payments-checkout-prd`, `fulfill-notify-prd`
53+
**Examples**: `payments-checkout-dev`, `fulfill-notify-prd`, `orders-inventory-stg`
5154

5255
**Why this pattern?**
53-
- Simple and easy to understand.
54-
- Complies to [Temporal Cloud Namespace requirements](https://docs.temporal.io/cloud/namespaces#temporal-cloud-namespace-name)
55-
- Clearly separates environments (e.g., `dev`, `prod`)
56-
- Groups related services under domains that organization has defined
57-
- Allows for platform teams to implement chargeback to application teams, given most domains are owned by separate teams within organizations
58-
- Namespace level [system limits](https://docs.temporal.io/cloud/limits#namespace-level) are isolated between different services and environments.
59-
- Multiple workflows that are part of the same use case need to communicate with each other via Signals or by starting Child Workflows.
56+
- Simple and easy to understand
57+
- Clearly separates environments
58+
- Groups related services under domains
59+
- Allows platform teams to implement chargeback to application teams
60+
- Namespace-level limits are isolated between different services and environments
61+
62+
:::tip Temporal Cloud
63+
Cloud Namespace names are limited to [39 characters](/cloud/namespaces#temporal-cloud-namespace-name).
64+
If you need to include region, use short codes (e.g., `aps1`, `use1`).
65+
:::
66+
67+
## Organizational Patterns
68+
69+
### Pattern 1: Namespace per use case and environment
70+
71+
For simple configurations without multiple services or team boundaries.
72+
73+
**Naming convention**: `<use-case>_<environment>`
74+
75+
**Example**: `payments_prod`, `orders_dev`
76+
77+
### Pattern 2: Namespace per use case, service, and environment
78+
79+
When multiple services that are part of the same use case communicate externally to Temporal via API (HTTP/gRPC).
80+
81+
**Naming convention**: `<use-case>_<service>_<environment>`
82+
83+
**Example**: `payments_gateway_prod`, `payments_processor_prod`
84+
85+
### Pattern 3: Namespace per use case, domain, and environment
86+
87+
When multiple services need to communicate with each other, use [Temporal Nexus](/nexus) to connect Workflows across Namespace boundaries.
88+
This provides better security, fault isolation, and modularity than sharing a Namespace.
89+
90+
**Naming convention**: `<use-case>_<domain>_<environment>`
91+
92+
**Example**: `payments_checkout_prod`, `payments_refunds_prod`
6093

61-
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.
6295

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+
:::
64100

65-
Check out some more best practices for configuring Namespaces in [our documentation](https://docs.temporal.io/cloud/namespaces#general-guidance).
101+
## Production Safeguards
66102

67-
## Manage Namespaces
103+
### Use an Authorizer (open source only) {#authorizer}
68104

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.
70106

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.
72108

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.
74110

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.
111+
### Enable deletion protection (Temporal Cloud only) {#deletion-protection}
76112

77-
### Best practices:
113+
[Enable deletion protection](/cloud/namespaces#delete-protection) for production Namespaces to prevent accidental deletion.
78114

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}
80116

81-
#### 2. Enable multi-region replication for business critical 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).
82118

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}
84120

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.
86123

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
88128

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.
91131

92-
Use `prevent_destroy = true` to prevent Terraform from destroying the Namespace.
132+
**Reference**: [Example Terraform configuration](https://github.com/kawofong/temporal-terraform)
93133

94-
Reference: https://github.com/kawofong/temporal-terraform
134+
## Tagging (Temporal Cloud only) {#tagging}
95135

96-
## Tagging
136+
[Tags](/cloud/namespaces#tag-a-namespace) are key-value metadata pairs that help organize, track, and manage Namespaces.
97137

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.
99140

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
108142

109-
We also recommend tagging your Namespaces based on the following criteria:
110-
- Environment
111-
- Latency sensitivity
112-
- Business criticality: regulatory, user-facing
113-
- Data sensitivity
114-
- Team or Project
115-
- Division
143+
| Tag Key | Purpose | Examples |
144+
|---------|---------|----------|
145+
| `environment` | Deployment stage | `dev`, `staging`, `production` |
146+
| `team` | Owning team | `platform`, `payments`, `identity` |
147+
| `division` | Business unit | `engineering`, `finance`, `ops` |
148+
| `criticality` | Business importance | `high`, `medium`, `low` |
149+
| `data-sensitivity` | Data classification | `pii`, `pci`, `public` |
150+
| `latency-sensitivity` | Performance tier | `realtime`, `batch`, `async` |
116151

117-
## Setting
152+
For tag structure, limits, and management instructions, see [How to tag a Namespace](/cloud/namespaces#tag-a-namespace).
118153

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
120155

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.
122158

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.
124160

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 |
161+
For configuration details, see:
162+
- [Namespace concepts](/namespaces)
163+
- [Namespaces (Temporal Cloud)](/cloud/namespaces#access-namespaces)

0 commit comments

Comments
 (0)