CONCEPT Cited by 1 source
Selective pub-sub¶
Definition¶
Selective pub-sub is a publish-subscribe topology where subscribers declare fine-grained predicates over event attributes (event type + tenant + field-level filters), so the vast majority of published events match no subscriber. Unlike broadcast pub-sub (every subscriber gets every event) or topic-based pub-sub (coarse routing by topic), selective pub-sub inverts the optimization target: the no-match path is the hot path.
Why it matters¶
In selective pub-sub, evaluation runs on every event; delivery runs only for matches. The key operational implication:
Subscription evaluation, not network I/O, is the cost centre you optimize first โ and the no-match path has to be the cheapest path of all.
This is the opposite of broadcast systems where the delivery fan-out dominates cost.
Optimization: negative-lookup cache¶
For high-volume event types where most events have no subscriber, caching the "no subscriptions" answer (with short TTL) eliminates redundant registry lookups. The miss side is the win, not the hit side โ because the underlying lookup is paid on every event and most return nothing (Source: sources/2026-07-29-atlassian-inside-the-events-rail).
TTL is the tuning lever: shorter TTL = better subscription freshness but lower cache hit rate; longer TTL = reverse.
Where it diverges from textbook event buses¶
Textbook event bus designs optimize the delivery path (fan-out, ordering, deduplication). Selective pub-sub adds a pre-delivery decision layer that must evaluate complex predicates at line rate. This motivates:
- Separating matching (CPU-bound) from delivery (network-bound) into distinct stages
- Subscription registry caching with warm-cache fast paths
- Per-tenant + per-event-type selectivity metrics to monitor evaluation cost
Seen in¶
- sources/2026-07-29-atlassian-inside-the-events-rail โ Atlassian's Events Rail: apps subscribe to specific event types, in specific tenants, with filter expressions on event attributes; most inbound events have no matching subscriber