Namespace Configuration
The namespace is the identity of a cluster and of the data format it works with. Every key in Redis/Valkey and every object or file in the file storage belongs to exactly one namespace, and webPDF Server reads, changes and deletes only data of its own namespace. This lets several clusters, and several versions of webPDF, share one Redis/Valkey and one bucket, container or share, even if other applications keep their own data there as well.
Overview
A namespace has the form
<prefix>:v<main>.<minor>-r<revision>
for example webpdf-prod:v10.0-r1.
| Part | Set by | Description | Example |
|---|---|---|---|
prefix | You | Identifies the installation. One cluster, one prefix. Default: webpdf | webpdf-prod |
v<main>.<minor> | The server | Main and minor version of the product. Not configurable | v10.0 |
r<revision> | The server | Revision of the stored data format. Not configurable | r1 |
The namespace is used as follows:
| Where | Form |
|---|---|
| Redis/Valkey keys | <namespace>:<domain>:<type>:<identifier> |
| Objects in MinIO/S3 and Azure Blob | <prefix>/v<main>.<minor>-r<revision>/<session>/<document>-<revision> |
| Files on an SMB share or a shared folder | <url>/<prefix>/v<main>.<minor>-r<revision>/<session>/<document>-<revision> |
| Name of a bucket or container, if none is configured | <prefix> |
The prefix is the only part of the namespace that you set. Other entries in the namespace block of cluster.json are ignored.
The Prefix
The prefix identifies your installation. Give every installation that uses the same Redis/Valkey or the same bucket, container or share a prefix of its own, for example webpdf-prod and webpdf-test.
Rules
webPDF checks the prefix and never changes it:
- 3 to 32 characters.
- Lowercase letters
a-zand digits0-9, with single hyphens between them. A prefix does not start or end with a hyphen and has no two hyphens in a row. - No spaces, uppercase letters, dots, underscores, colons or slashes.
- No name that Windows reserves for devices, because the prefix becomes the name of a folder on an SMB share or a shared folder:
con,prn,aux,nul,com1tocom9,lpt1tolpt9. - No name that AWS reserves for buckets: a prefix must not begin with
sthree-oramzn-s3-demo-and must not end with-s3aliasor-an. - An empty value counts as not set and results in the default
webpdf.
| Prefix | Result |
|---|---|
webpdf, webpdf-prod, acme-test-2 | accepted |
cons, com10, lpt0, an-abc | accepted (only the complete name or the stated beginning and end are reserved) |
Prod, eu_1, a.b, a--b, -ab, ab-, webpdf | rejected |
ab, or 33 and more characters | rejected |
con, nul, com1, lpt9 | rejected (device names) |
sthree-x, amzn-s3-demo-x, abc-s3alias, abc-an | rejected (AWS) |
One Installation, One Prefix
Assign a prefix to each installation once and keep a list of them. Two clusters with the same prefix and the same version would work on the same data; a cluster that uses Redis/Valkey detects this, and the second cluster does not start (see One Namespace, One Cluster).
Several clusters of the same version that share one Redis/Valkey and one bucket are kept apart by their prefixes:
Configuration
Set the prefix in the cluster configuration file cluster.json or with an environment setting. An environment setting overrides the value in cluster.json (Environment Settings > XML configuration > defaults).
cluster.json | Environment variable | System property | Default |
|---|---|---|---|
namespace.prefix | WEBPDF_CLUSTER_SETTINGS_NAMESPACE_PREFIX | -Dwebpdf.cluster.settings.namespace.prefix | webpdf |
{
"mode": "CLUSTER",
"role": "COORDINATOR",
"name": "webpdf-cluster",
"namespace": {
"prefix": "webpdf-prod"
}
}
WEBPDF_CLUSTER_SETTINGS_NAMESPACE_PREFIX=webpdf-prod
To go back to the default, remove the setting; the prefix is then webpdf.
The prefix must be identical on all nodes of the cluster. A node whose namespace differs from that of the coordinator cannot join the cluster.
Set the Prefix When You Create the Cluster
Set the prefix when you create the cluster. The administration rejects a different prefix for an existing cluster: the data of the cluster stays under the old prefix, and the cluster would otherwise continue with an empty area. If you want a cluster to use a different prefix, set up a new cluster (see Version and Revision for what happens to the data of the old namespace).
Messages
If the prefix is not valid, the cluster node does not start and the server log names the reason. The administration rejects an invalid prefix before anything is written.
| Situation | Message in the server log |
|---|---|
| The prefix is not valid | The namespace prefix '<value>' is not allowed: it must have 3 to 32 characters, lower-case letters a-z and digits 0-9, with single hyphens between them (for example 'webpdf-prod'), and must not be a reserved name (con, prn, aux, nul, com1-com9, lpt1-lpt9) or begin with 'sthree-' or 'amzn-s3-demo-' or end with '-s3alias' or '-an'. The prefix is checked, never changed. Set it through 'namespace.prefix' in cluster.json or WEBPDF_CLUSTER_SETTINGS_NAMESPACE_PREFIX / webpdf.cluster.settings.namespace.prefix. |
| The node does not start | Unable to start the cluster node: <reason> |
| A node with another namespace tries to join | Namespace settings do not match: '<namespace of the coordinator>' (coordinator) != '<namespace of the member>' (member) |
| The namespace belongs to another cluster | Unable to start the cluster node: the namespace '<namespace>' belongs to the cluster '<name>' (key fingerprint <fingerprint>, created <time> by node '<node>'). Give this cluster a namespace prefix of its own, or remove the key '<namespace>:owner' if the namespace is to be taken over. |
| The owner entry of the namespace cannot be read | Unable to start the cluster node: the namespace '<namespace>' has an owner entry that cannot be read, so it does not prove that the namespace belongs to this cluster. Give this cluster a namespace prefix of its own, or remove the key '<namespace>:owner' if the namespace is to be taken over. |
Version and Revision
The server sets the version and the revision of the namespace; they cannot be configured.
- Version. The main and minor version of the product. Updates within a minor version (for example from 10.0.7 to 10.0.8) keep the namespace: the nodes continue with the existing data. A new minor or main version works in a new namespace.
- Revision. The number of the stored data format. It changes only when webPDF changes the stored format in a way that an older version cannot read.
A new namespace is a new, empty area. Redis/Valkey then starts without the data of the previous namespace: users sign in again, and the temporary documents of running sessions are gone. The old area stays where it is until you empty it (see Empty an Area).
A node whose revision differs from that of the coordinator has another namespace and does not join the cluster. Within one revision, the stored format changes only in ways that older nodes can ignore, so nodes of different patch versions of one minor version can work together during a rolling update. For Blue/Green deployments, see Rolling Update.
Several versions side by side, for example webPDF 10 and webPDF 11 on one Redis/Valkey and one bucket, work in separate areas, even with the same prefix and the same session ID:
| Redis/Valkey keys | Objects | |
|---|---|---|
| webPDF 11 | webpdf-prod:v11.0-r1:session:data:<sessionId> | webpdf-prod/v11.0-r1/<sessionId>/<documentId>-1 |
| webPDF 10 | webpdf-prod:v10.0-r1:session:data:<sessionId> | webpdf-prod/v10.0-r1/<sessionId>/<documentId>-1 |
One Namespace, One Cluster
A namespace belongs to exactly one cluster. The first node of a cluster writes an owner entry into Redis/Valkey, the key <namespace>:owner. It names the cluster (name in cluster.json), a fingerprint of the cluster secret key, the time it was written and the node that wrote it:
{"cluster":"webpdf-cluster","keyFingerprint":"19cc4e9b2c0073f7","created":"2026-10-28T09:15:00.123Z","node":"node-1"}
The fingerprint consists of the first 16 characters of the SHA-256 hash of the secret key; upper and lower case of the key and spaces around it do not change it, as for the cluster communication itself. The secret key itself is never stored in Redis/Valkey and never written to the log. Two clusters count as the same cluster if their names and their secret keys are the same. The owner entry has no expiry.
At start. Every node of a cluster, the coordinator and every member, reads the owner entry after it has connected to Redis/Valkey:
- If there is no owner entry, the node writes it and starts.
- If the owner entry names this cluster, the node starts.
- If the owner entry names another cluster or cannot be read, the node does not start (see Messages).
An existing owner entry is never overwritten, not even one that cannot be read. If Redis/Valkey cannot be reached at start, the node starts, but reports itself as not ready until it has confirmed the owner entry. While the coordinator is not ready, members that join the cluster wait for it.
While running. Every node confirms the owner entry every 30 seconds:
- If the owner entry is missing, for example after
FLUSHDB, after a restart of Redis/Valkey without persistence, after a failover to a replica without the key or after an eviction, the node writes it again and logs a warning. A node that has seen the owner entry of another cluster since its start never writes it: it stays not ready, logs a warning and does not take the namespace over until it is restarted. - If the owner entry names another cluster, the node logs an
ERRORline with both clusters, again at most every 10 minutes while the conflict lasts, and reports the health checknamespaceasDOWN. With it,/health/clusterand/health/readyareDOWN, so a load balancer stops sending requests to the node;/health/livestaysUP, and the node keeps running. When the conflict ends, the node logs anINFOline and is ready again (see Health API).
| Environment variable | System property | Default | Description |
|---|---|---|---|
WEBPDF_REDIS_NAMESPACE_OWNER_CHECK_INTERVAL | -Dwebpdf.redis.namespace.owner.check.interval | 30000 | Time between two confirmations in milliseconds. A value below 5000, also 0 or a negative value, is raised to 5000 with a warning; the confirmation cannot be switched off. |
Take Over a Namespace
A namespace is taken over only on purpose, for example by the same installation with a new cluster name or a new secret key:
- Stop all nodes of the old cluster.
- Delete the owner entry, for example with
redis-cli DEL webpdf-prod:v10.0-r1:owner. - Start the new cluster. Its first node writes a new owner entry.
Deleting the owner entry deletes no data: the new cluster continues with the sessions and documents of the area. Another installation does not take over a namespace; give it a prefix of its own. If the owner entry is deleted while the old cluster is still running, its nodes report the conflict as soon as the new cluster has written its entry.
Limits
- Only with Redis/Valkey. The owner entry is kept in Redis/Valkey. A cluster without Redis/Valkey has no owner entry and no check; its health check
namespacereportsUPwithNamespace owner not checked: no Redis/Valkey. - A copied configuration. Two clusters with the same name and the same secret key count as one cluster, for example after a configuration was copied for a second installation. Give every installation a prefix of its own.
- A lost owner entry and a restarting node. If the owner entry is lost while a node of another cluster restarts after a refused start, for example in a restart loop of a container platform, that node sees a missing entry like a first start. The node that writes the entry first owns the namespace; the nodes of the other cluster report the conflict.
- Blue/Green on the same version. A second cluster on the same version and revision and with the same prefix works on the same namespace and does not start. A second cluster with a new version or revision works in a new namespace (see Rolling Update).
Usage in Providers
Redis and Valkey
Keys follow a hierarchical pattern:
<namespace>:<domain>:<type>:<identifier>
Where:
- namespace:
<prefix>:v<main>.<minor>-r<revision> - domain: Key domain (session, document, event, history)
- type: Key type (data, index, lock)
- identifier: Unique ID (session ID, document ID, etc.)
Key Domains
| Domain | Purpose | Example Keys |
|---|---|---|
session | Session management | <ns>:session:data:<sessionId> |
document | Document storage | <ns>:document:data:<sessionId>:<documentId> |
event | Event notifications | <ns>:event |
history | Document history | <ns>:history:data:<sessionId>:<documentId> |
Example keys with the prefix webpdf-prod:
webpdf-prod:v10.0-r1:session:data:abc123webpdf-prod:v10.0-r1:document:data:abc123:doc456webpdf-prod:v10.0-r1:event
Index Keys
<namespace>:session:index
<namespace>:document:index:<sessionId>
<namespace>:document:index:<sessionId> lists the documents of one session and is removed together with the session. There is no index of all documents of the namespace.
The key <namespace>:owner holds the owner entry of the namespace as plain text (see One Namespace, One Cluster).
Both indexes hold plain text: <namespace>:session:index the session IDs, <namespace>:document:index:<sessionId> the document IDs, with :<revision> for a revision (for example <documentId> and <documentId>:2). An entry that is not such an ID is skipped and never deleted.
Lock Keys
<namespace>:session:lock:<sessionId>
<namespace>:session:lock:principal:<hash>
<namespace>:session:lock:expiration
<namespace>:session:lock:reconciliation
<namespace>:document:lock:<sessionId>:<documentId>
For every lock, Redisson derives two more names that contain the name of the lock in braces: the channel redisson_lock__channel:{<namespace>:…} and the key redisson_unlock_latch:{<namespace>:…}:<id>. They belong to the namespace as well; take them into account if you restrict the rights of the Redis/Valkey user (see Restricted Access Rights).
File Storage Providers (MinIO, Azure Blob, SMB, Shared Folder)
The file storage keeps every document revision as an object or file below the path of the namespace:
| Provider | Form |
|---|---|
| MinIO/S3 | object <prefix>/v<main>.<minor>-r<revision>/<sessionId>/<documentId>-<revision> in the bucket |
| Azure Blob | blob <prefix>/v<main>.<minor>-r<revision>/<sessionId>/<documentId>-<revision> in the container |
| SMB | file <url>/<prefix>/v<main>.<minor>-r<revision>/<sessionId>/<documentId>-<revision> |
Shared folder (LOCAL with sharedUsage) | file <url>/<prefix>/v<main>.<minor>-r<revision>/<sessionId>/<documentId>-<revision> |
webPDF lists, reads and deletes only below this path and below the folder of a session in it. Objects and files outside the path are never touched, even if they carry the name of a session of webPDF. The one read outside the path is the status check of the Azure Blob storage client, which reads the first entry of the blob listing of the container to confirm that it exists. With SMB and the shared folder, <url> must exist and be writable; webPDF creates the folders <prefix>/v<main>.<minor>-r<revision> below it. The probes of the file storage and the optional archive of the dead letter store (switched off by default) work only below this path as well; the archive uses a session folder named dlq-archive.
The name of the session folder of the dead letter archive can be changed with WEBPDF_CLUSTER_EVENTS_DLQ_ARCHIVE_OBJECT_STORAGE_SESSION_ID (system property webpdf.cluster.events.dlq.archive.object.storage.session.id). If the archive is switched on and the name is not valid, the server does not start and the log says: The DLQ archive session '<value>' (webpdf.cluster.events.dlq.archive.object.storage.session.id) is not allowed: it must be a single name of the characters A-Z, a-z, 0-9, '.', '_' and '-', and neither '.' nor '..'.
Name of the Bucket or Container
If you do not configure the name of a bucket or container, webPDF uses the prefix as its name. A configured name always takes precedence; the namespace path below it is the same.
cluster.json / provider configuration | Bucket or container | |
|---|---|---|
| Name not configured, or empty in the file | prefix webpdf-prod | webpdf-prod |
| Name configured | prefix webpdf-prod, name files | files |
The derived name does not contain a version: an update to a new minor version works in the same bucket or container, in a new path. The derived name is used by the server only; it is not written into the configuration of the provider.
Storage provider naming rules apply. S3 bucket names are unique worldwide (AWS S3) and a derived name such as webpdf may already belong to someone else. See Existing Buckets and Containers for the recommendation for production.
When a provider configuration of MinIO or Azure Blob is validated in the administration, webPDF checks only the bucket or container the node would use: the configured name or, if none is configured, the prefix. The buckets or containers of the account are not listed. If the bucket or container exists, the validation succeeds without a probe. If it does not exist, webPDF checks the permission to create it with a temporary one whose name is the name to be used followed by -probe- and eight random characters, and removes it again; if the probe cannot be created or removed, the validation reports an error. The bucket or container itself is neither created nor removed by the validation.
Existing Buckets and Containers
At startup, webPDF uses an existing bucket or container as it is, whatever it holds, and works only below its own path. A bucket or container that does not exist is created at startup if the access rights permit it, also when its name is configured explicitly. webPDF never deletes a bucket or container.
In production, especially on AWS S3, create the bucket in advance, with the lifecycle rules and rights you need, and configure its name (bucketName for MinIO/S3, containerName for Azure Blob). Then the start does not depend on the right to create buckets, and the name does not depend on the prefix.
Local Folder in a Cluster
A folder that you configure with url in provider-local.json must be visible to all nodes of the cluster. A cluster therefore starts with such a folder only if "sharedUsage": true is set; otherwise the start is refused (see NFS). The path of the namespace is then created below url as described above. A cluster never deletes the folder or its content at shutdown.
Operating Rules
This section sums up what the namespace provides, what it does not provide, and what you have to ensure.
What the Namespace Provides
- Unique namespaces, and separate areas for different versions, for example webPDF 10 and webPDF 11.
- In Redis/Valkey and in the file storage, webPDF works only in its own area, also with the same session ID in two areas.
- The stored structures stay unchanged within a revision. A change that older nodes cannot read results in a new revision and with it in a new area.
- A cluster deletes nothing recursively in a shared storage.
- Several clusters of the same version share Redis/Valkey and a bucket, separated by their prefixes.
- One namespace, one cluster: a second cluster on the same namespace does not start, and a running node reports a conflict (see One Namespace, One Cluster).
What the Namespace Does Not Provide
- No check of a copied configuration. A second cluster on the same namespace is detected only if it uses Redis/Valkey and its name or secret key differs (see Limits).
- No transfer of data. The data of an old namespace is not carried over to a new one: not at a new minor version, not at a new revision, and not at a new prefix. The old area stays until you empty it.
- No enforcement of access rights. webPDF does not check the rights of the Redis/Valkey user, the bucket policy or the SAS of its storage.
- No immediate clean-up after a crash. The documents of the sessions of a node that ended without regular shutdown stay until these sessions expire; then they are removed like those of every other ended session.
- No protection against actions of an operator, such as
FLUSHALLin Redis/Valkey, a lifecycle rule without a prefix filter in a bucket, or an eviction policy of Redis/Valkey.
What You Have to Ensure
- A prefix of its own for every installation. One prefix, one installation (see One Installation, One Prefix).
noevictionand enough memory for a shared Redis/Valkey. The settingmaxmemory-policy noevictionand a sufficientmaxmemoryapply to the whole instance, so size it for all installations that share it (see Redis Server Configuration).- Lifecycle rules with a prefix filter. A lifecycle rule of a bucket or container (expiry, transition) must name the prefix of the installation; a rule for the whole bucket also deletes the data of others.
- No
nameMapperin the Redisson YAML. AnameMapperrenames the keys so that they are no longer found under the namespace. Acodecin the Redisson YAML does not affect the stored data: webPDF Server sets the codec of every structure itself. - No shared paths for
temp,logsandconf. These directories belong to one node. Do not place them on a path that several nodes or installations share. - A shared folder for a local file storage folder in a cluster. Set
"sharedUsage": trueor choose another file storage. - Pre-create the bucket in production, especially on AWS S3, and configure its name.
- Empty your own area before you reuse a prefix (see below).
Empty an Area
Empty an area when you reuse a prefix, and when the area of an old namespace is no longer needed (for example after a new minor version or revision). Stop all nodes that use the area first.
- Redis/Valkey: delete all keys that begin with
<namespace>:, and the keys and channelsredisson_lock__channel:{<namespace>:andredisson_unlock_latch:{<namespace>:that begin with it. Select only keys of this namespace: other applications may use the same instance. - File storage: delete the objects or files below
<prefix>/v<main>.<minor>-r<revision>/. Delete a bucket or container as a whole only if nothing else uses it.
Restricted Access Rights
A Redis/Valkey user can be limited to the namespace. Keys <namespace>:* and the lock names that Redisson derives from them (see Lock Keys) are needed. When it connects, Redisson reads the keys test1 and test2 once to detect the topology of the Redis. With an ACL that allows only <namespace>:* and the channels of the locks, two clusters started and ran without errors in a measurement; the ACL LOG of Redis then shows NOPERM entries for test1, which can be ignored.
A MinIO or S3 user that is limited to a bucket needs a configured region (region in provider-minio.yaml), otherwise the query of the location of the bucket fails (see MinIO).
A MinIO or S3 user can also be limited to the path of its installation in a bucket that several installations share. In a measurement with two installations on one bucket, this policy was enough:
s3:GetObject,s3:PutObjectands3:DeleteObjectonarn:aws:s3:::<bucket>/<prefix>/*;s3:ListBucketonarn:aws:s3:::<bucket>, for the whole bucket and without ans3:prefixcondition.
webPDF Server checks the bucket with a HEAD request, and S3 authorizes that request through s3:ListBucket without a prefix. If s3:ListBucket is limited to the own path with s3:prefix, the nodes do not start (Health state is DOWN: Access denied). With s3:ListBucket for the whole bucket, the user can list the names of the objects of the other installations, but cannot read, change or delete them. To keep the names apart as well, give every installation a bucket of its own; without a configured bucket name, that is the default.
Grant the object rights on <prefix>/*, not on the path with the version (for example <prefix>/v10.0-r1/*). That path changes with every new main or minor version and with a new format revision, and a policy for the old path answers every object request of the new version with AccessDenied.
Examples
Production and Test Cluster on One Redis and One Bucket
Production, cluster.json:
{
"namespace": {
"prefix": "webpdf-prod"
}
}
Test, cluster.json:
{
"namespace": {
"prefix": "webpdf-test"
}
}
Result:
- Production keys:
webpdf-prod:v10.0-r1:*, objectswebpdf-prod/v10.0-r1/… - Test keys:
webpdf-test:v10.0-r1:*, objectswebpdf-test/v10.0-r1/…
Minimal Configuration
Without a namespace block, the prefix is webpdf: keys webpdf:v10.0-r1:session:data:*.
Environment Setting in a Container
WEBPDF_CLUSTER_SETTINGS_NAMESPACE_PREFIX=webpdf-prod
Related Configuration
- Cluster Configuration - Overall cluster setup
- Redis Provider - Redis session storage
- Valkey Provider - Valkey session storage
- MinIO Provider - MinIO file storage
- Azure Blob Provider - Azure Blob storage
- SMB Provider - SMB file storage
- NFS Provider - Shared folder
- Rolling Update - Update the nodes of a cluster