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
This proposal suggests replacing the current combination of:
Redis (cache / ephemeral coordination state)
RabbitMQ (messaging / pub-sub)
Prefect (task orchestration / workflow state)
with a unified event backbone based on NATS JetStream.
The goal is to simplify infrastructure, reduce operational complexity, and establish a consistent foundation for event-driven execution, task coordination, and system state management.
⸻
Current Architecture Problems
Today, responsibilities are split across multiple systems:
Redis
Used for caching and ephemeral coordination state
Also used for lightweight runtime flags and deduplication patterns
Introduces multiple inconsistent state semantics across the system
RabbitMQ
Handles pub/sub and async task dispatch
Separate routing and delivery model from other systems
Operational overhead of queue management and topology
Prefect
Provides task orchestration and workflow state management
Requires PostgreSQL for persistence
Introduces a central orchestration dependency outside the event system
⸻
Core Issue
These systems overlap significantly:
Concern Redis RabbitMQ Prefect
Messaging partial primary indirect
Task execution no partial yes
State tracking partial no yes
This results in:
duplicated coordination mechanisms
fragmented system semantics
multiple sources of truth for state and execution
increased operational overhead
⸻
Proposed Architecture: NATS JetStream as Unified Event Backbone
We propose consolidating messaging, task execution, and lightweight state coordination into NATS JetStream.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
This proposal suggests replacing the current combination of:
with a unified event backbone based on NATS JetStream.
The goal is to simplify infrastructure, reduce operational complexity, and establish a consistent foundation for event-driven execution, task coordination, and system state management.
⸻
Current Architecture Problems
Today, responsibilities are split across multiple systems:
Redis
RabbitMQ
Prefect
⸻
Core Issue
These systems overlap significantly:
Concern Redis RabbitMQ Prefect
Messaging partial primary indirect
Task execution no partial yes
State tracking partial no yes
This results in:
⸻
Proposed Architecture: NATS JetStream as Unified Event Backbone
We propose consolidating messaging, task execution, and lightweight state coordination into NATS JetStream.
⸻
NATS Responsibilities
⸻
Tasks are modeled explicitly as events:
Workers:
⸻
JetStream Key-Value store is used for:
This replaces Redis in coordination and state-tracking roles only, not general-purpose caching patterns.
⸻
Event Router (Control Plane Component)
A lightweight deterministic service is introduced:
Responsibilities:
Example:
device.updated →
task.requested.recalculate_fields
task.requested.sync_external_systems
This replaces implicit orchestration logic previously embedded in Prefect flows or worker chaining.
⸻
Optional Future Extension: Object Storage via JetStream
As a separate and optional evolution path, JetStream can also be extended to support artifact storage using its Object Store capabilities.
This is not part of the core Redis/RabbitMQ/Prefect replacement, but a potential future consolidation step.
Potential use cases:
Benefits (future consideration only):
This capability is treated as:
a future enhancement layer, not a requirement for initial migration
⸻
New Execution Model
domain event (device.updated)
↓
JetStream event stream
↓
event-router (policy layer)
↓
task.requested.*
↓
workers (stateless execution)
↓
task.completed.*
↓
(optional future) GraphDB dependency resolver
↓
(optional future) JetStream Object Store for artifacts
⸻
Key Design Shift
From orchestration → event expansion
Instead of:
Prefect defines and executes workflows
We move to:
Events define intent, the router expands intent into tasks, and workers execute atomic units of work
⸻
Why NATS JetStream
NATS replaces:
Using consistent primitives:
⸻
⸻
JetStream provides:
⸻
Future Extension: DAG Execution (GraphDB-backed)
Once task execution stabilizes, dependency management can be introduced via GraphDB.
Dependency model:
Task A → depends_on → Task B
Dependency resolver service:
This enables:
without introducing a traditional workflow engine.
⸻
Migration Plan
Phase 1 — Replace Redis + RabbitMQ
⸻
Phase 2 — Replace Prefect execution layer
⸻
Phase 3 — Introduce event-router
⸻
Phase 4 — Introduce GraphDB dependency model (optional)
⸻
Phase 5 (optional future) — Artifact storage integration
⸻
Expected Benefits
Infrastructure simplification
Operational reduction
Architectural consistency
Future extensibility
⸻
Risks / Considerations
Requires:
⸻
Mitigated via:
⸻
If adopted later:
⸻
Conclusion
Adopting NATS JetStream as the unified event backbone enables:
This results in a simplified, consistent system where:
events, tasks, and state coordination share one unified substrate, with optional extension into artifact storage and DAG semantics over time.
Beta Was this translation helpful? Give feedback.
All reactions