Skip to main content

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!
Your agent code stays exactly the same!

How It Works

OmniDaemon uses Dependency Injection to automatically configure backends based on environment variables.

Your Code

Behind the Scenes

When you create an OmniDaemonSDK(), OmniDaemon:
  1. Reads environment variables
  2. Loads the appropriate backend classes
  3. Injects them into the SDK
  4. You just use the SDK! 🎉

Event Bus Backends

Currently Supported

Redis Streams ✅

Configuration:
Features:
  • ✅ Message persistence
  • ✅ Consumer groups
  • ✅ At-least-once delivery
  • ✅ Dead letter queue
  • ✅ Message reclaiming
  • ✅ Horizontal scaling
Use Case: Production-ready for most workloads Performance:
  • Throughput: ~100K msgs/sec per instance
  • Latency: <10ms
  • Storage: RAM + optional disk persistence

Coming Soon

Apache Kafka 🚧

Configuration:
Features:
  • 🚧 Extremely high throughput
  • 🚧 Log-based persistence
  • 🚧 Exactly-once semantics
  • 🚧 Topic partitioning
  • 🚧 Long-term message retention
Use Case: High-throughput, mission-critical workloads Performance:
  • Throughput: >1M msgs/sec per broker
  • Latency: <50ms
  • Storage: Disk-based, configurable retention

RabbitMQ 🚧

Configuration:
Features:
  • 🚧 Flexible routing
  • 🚧 AMQP protocol
  • 🚧 Multiple exchange types
  • 🚧 Priority queues
  • 🚧 Message TTL
Use Case: Complex routing requirements Performance:
  • Throughput: ~50K msgs/sec per node
  • Latency: <20ms
  • Storage: RAM or disk

NATS JetStream 🚧

Configuration:
Features:
  • 🚧 Cloud-native design
  • 🚧 Very lightweight
  • 🚧 Geographic distribution
  • 🚧 At-least-once and exactly-once
  • 🚧 Stream and KV storage
Use Case: Edge computing, IoT, cloud-native apps Performance:
  • Throughput: ~500K msgs/sec per server
  • Latency: <5ms
  • Storage: Memory or file-based

Storage Backends

Currently Supported

JSON ✅

Configuration:
Features:
  • ✅ File-based storage
  • ✅ Human-readable
  • ✅ No external dependencies
  • ✅ Easy to backup
Use Case: Development, testing, single-machine deployments Limitations:
  • ❌ Not distributed
  • ❌ No concurrent access from multiple machines
  • ❌ Limited scalability

Redis ✅

Configuration:
Features:
  • ✅ In-memory performance
  • ✅ Distributed access
  • ✅ TTL support (24h for results)
  • ✅ Atomic operations
  • ✅ Replication & clustering
Use Case: Production deployments, multi-machine setups Performance:
  • Read: <1ms
  • Write: <1ms
  • Storage: RAM (with optional persistence)

Coming Soon

PostgreSQL 🚧

Configuration:
Features:
  • 🚧 ACID transactions
  • 🚧 Complex queries
  • 🚧 JSON columns (for flexibility)
  • 🚧 Full-text search
  • 🚧 Mature tooling
Use Case: Enterprise deployments, compliance requirements Performance:
  • Read: <10ms
  • Write: <20ms
  • Storage: Disk-based

MongoDB 🚧

Configuration:
Features:
  • 🚧 Schema flexibility
  • 🚧 Document storage
  • 🚧 Horizontal scaling
  • 🚧 Aggregation pipelines
  • 🚧 TTL indexes
Use Case: Flexible schemas, document-oriented data Performance:
  • Read: <5ms
  • Write: <10ms
  • Storage: Disk-based with memory mapping

Amazon S3 🚧

Configuration:
Features:
  • 🚧 Unlimited storage
  • 🚧 High durability (99.999999999%)
  • 🚧 Cost-effective for large volumes
  • 🚧 Lifecycle policies
  • 🚧 Cross-region replication
Use Case: Long-term result storage, large-scale deployments Performance:
  • Read: <100ms
  • Write: <200ms
  • Storage: Object storage (pay per GB)

Switching Backends

Example: Development to Production

Development (Local Machine):
Staging (Test Environment):
Production (Multi-Region):
Your agent code? Exactly the same!

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

Storage Selection

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


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
Current Options:
  • Event Bus: Redis Streams
  • Storage: JSON, Redis
Coming Soon:
  • Event Bus: Kafka, RabbitMQ, NATS 🚧
  • Storage: PostgreSQL, MongoDB, S3 🚧
The Promise:
“You provide the URL, OmniDaemon handles EVERYTHING else!”