Pluggable Architecture
One of OmniDaemon’s most powerful features is its pluggable architecture. You can swap event bus and storage backends without changing a single line of your agent code.The Simple Truth
You provide the connection URL, OmniDaemon handles EVERYTHING else!How It Works
OmniDaemon uses Dependency Injection to automatically configure backends based on environment variables.Your Code
Behind the Scenes
When you create anOmniDaemonSDK(), OmniDaemon:
-
Reads environment variables
-
Loads the appropriate backend classes
-
Injects them into the SDK
- You just use the SDK! 🎉
Event Bus Backends
Currently Supported
Redis Streams ✅
Configuration:- ✅ Message persistence
- ✅ Consumer groups
- ✅ At-least-once delivery
- ✅ Dead letter queue
- ✅ Message reclaiming
- ✅ Horizontal scaling
- Throughput: ~100K msgs/sec per instance
- Latency: <10ms
- Storage: RAM + optional disk persistence
Coming Soon
Apache Kafka 🚧
Configuration:- 🚧 Extremely high throughput
- 🚧 Log-based persistence
- 🚧 Exactly-once semantics
- 🚧 Topic partitioning
- 🚧 Long-term message retention
- Throughput: >1M msgs/sec per broker
- Latency: <50ms
- Storage: Disk-based, configurable retention
RabbitMQ 🚧
Configuration:- 🚧 Flexible routing
- 🚧 AMQP protocol
- 🚧 Multiple exchange types
- 🚧 Priority queues
- 🚧 Message TTL
- Throughput: ~50K msgs/sec per node
- Latency: <20ms
- Storage: RAM or disk
NATS JetStream 🚧
Configuration:- 🚧 Cloud-native design
- 🚧 Very lightweight
- 🚧 Geographic distribution
- 🚧 At-least-once and exactly-once
- 🚧 Stream and KV storage
- Throughput: ~500K msgs/sec per server
- Latency: <5ms
- Storage: Memory or file-based
Storage Backends
Currently Supported
JSON ✅
Configuration:- ✅ File-based storage
- ✅ Human-readable
- ✅ No external dependencies
- ✅ Easy to backup
- ❌ Not distributed
- ❌ No concurrent access from multiple machines
- ❌ Limited scalability
Redis ✅
Configuration:- ✅ In-memory performance
- ✅ Distributed access
- ✅ TTL support (24h for results)
- ✅ Atomic operations
- ✅ Replication & clustering
- Read: <1ms
- Write: <1ms
- Storage: RAM (with optional persistence)
Coming Soon
PostgreSQL 🚧
Configuration:- 🚧 ACID transactions
- 🚧 Complex queries
- 🚧 JSON columns (for flexibility)
- 🚧 Full-text search
- 🚧 Mature tooling
- Read: <10ms
- Write: <20ms
- Storage: Disk-based
MongoDB 🚧
Configuration:- 🚧 Schema flexibility
- 🚧 Document storage
- 🚧 Horizontal scaling
- 🚧 Aggregation pipelines
- 🚧 TTL indexes
- Read: <5ms
- Write: <10ms
- Storage: Disk-based with memory mapping
Amazon S3 🚧
Configuration:- 🚧 Unlimited storage
- 🚧 High durability (99.999999999%)
- 🚧 Cost-effective for large volumes
- 🚧 Lifecycle policies
- 🚧 Cross-region replication
- Read: <100ms
- Write: <200ms
- Storage: Object storage (pay per GB)
Switching Backends
Example: Development to Production
Development (Local Machine):Architecture Overview
Benefits of Pluggability
1. No Vendor Lock-In
2. Optimize for Your Workload
3. Easy Migration
4. Cost Optimization
5. Compliance & Data Residency
How to Choose a Backend
Event Bus Selection
| If you need… | Choose… |
|---|---|
| Simple setup, good performance | Redis Streams |
| Extremely high throughput (>100K msgs/sec) | Kafka |
| Complex routing patterns | RabbitMQ |
| Cloud-native, edge deployment | NATS |
| Cost-effective, fast | Redis Streams |
Storage Selection
| If you need… | Choose… |
|---|---|
| Local development | JSON |
| Fast, distributed access | Redis |
| Complex queries, reporting | PostgreSQL |
| Flexible schemas | MongoDB |
| Long-term, cheap storage | S3 |
Hybrid Approach
You can use different backends for different purposes:Implementation Details
Backend Registry
OmniDaemon maintains registries of available backends:Factory Pattern
Backends are created using a factory:Module-Level Instances
Pre-configured instances are created at module load:Best Practices
1. Use Environment-Specific Configs
2. Test with Production-Like Setup
3. Monitor Backend Performance
4. Plan for Migration
5. Document Your Backend Choices
Troubleshooting
Backend Not Found
Connection Refused
Performance Issues
Further Reading
- Event Bus Architecture - Deep dive into event bus
- Storage Architecture - Deep dive into storage
- Production Deployment - Deploy for real
Summary
Key Points:- ✅ No Code Changes - Your agent code never changes
- ✅ Environment Variables - Just update config
- ✅ Dependency Injection - OmniDaemon handles wiring
- ✅ Multiple Backends - Redis, Kafka, PostgreSQL, and more
- ✅ Easy Migration - Start simple, scale when needed
- ✅ No Vendor Lock-In - Switch anytime
- Event Bus: Redis Streams ✅
- Storage: JSON, Redis ✅
- Event Bus: Kafka, RabbitMQ, NATS 🚧
- Storage: PostgreSQL, MongoDB, S3 🚧
“You provide the URL, OmniDaemon handles EVERYTHING else!”