Validity
Every name the library produces is valid as a pubsub topic and as a
state key on every backend we use or might use. The union of all segment
alphabets is [a-zA-Z0-9._-], segments are joined with ., and names are
at most 249 characters.
| Backend | Constraint | Why our names satisfy it |
|---|---|---|
Redis Streams (Dapr pubsub.redis) |
the topic is the stream key; any binary-safe string; matching is exact | .-joined ASCII; we never rely on wildcards |
| Dapr state store | a key must not contain \|\|, Dapr's <appId>\|\|<key> delimiter |
\| is not in the alphabet; physical keys are api\|\|<key> |
| Same Redis for pubsub and state | stream keys and state keys must not collide | state keys carry the api\|\| prefix, stream keys never do |
| Dapr actor state | <appId>\|\|<type>\|\|<id>\|\|<key> |
the same prefix rule |
| Kafka | [a-zA-Z0-9._-], at most 249 characters |
identical alphabet; the library enforces 249 |
| NATS | .-tokenized subjects; * and > are wildcards |
no * or > in the alphabet |
| URLs (Dapr HTTP publish puts the topic in a path) | path-safe characters | every character in the alphabet is unreserved |
Keys and queries
The Dapr Redis state store indexes keys for QueryState through the
statestore-all RediSearch index, whose key field is TEXT. RediSearch
tokenizes TEXT on . and -, so do not rely on a key-prefix query such
as sc.<SCENARIO>. until the matching behaviour is verified. Use
SCAN api||sc.<SCENARIO>.* or a TAG field instead.
Reserved words
index is the last segment of an index key. It is lowercase, and every
identity class that can follow a stem is uppercase or a GUID, so an index
key can never collide with an instance key. Composition rejects an entity
whose identity could be index.