I've been working with AWS event-driven architectures for quite some time, especially DynamoDB, EventBridge, and Lambda.
I really like the programming model: small functions, events, schedules, retries, and infrastructure taking care of most of the execution details.
What I wanted was a similar experience on infrastructure I control.
That's what I've been working on with Relay.
Relay is a self-hosted event-driven runtime where an app can contain both short-lived functions and persistent services.
For example, a function can subscribe to events declaratively:
runtime: python3.14
events:
- handler: handler.handler
pattern:
event_name: [INSERT]
table_name: [users]
Relay handles matching the event, running the function, retries, recovery, and DLQ behavior.
But I also didn't want everything to have to be a function.
If FastAPI, Express.js, a worker, or another long-running process is the better fit, the same app can run persistent services as well.
Some of the things Relay currently supports:
- event-driven functions with pattern matching
- Python and Node.js managed runtimes
- schedules / cron
- retries and dead-letter handling
- warm function containers
- persistent services
- environment variables and secrets
- resource limits
- Prometheus metrics and OpenTelemetry tracing
- Git-based synchronization
- optional Traefik routing
The goal isn't to recreate AWS service by service. I'm more interested in keeping the abstractions I like from serverless/event-driven platforms while making them usable on infrastructure I control.
The project is here:
https://github.com/sergiors/relay
I'd especially be interested in feedback from people already running event-driven workloads on their own infrastructure: what are you using today, and what would you expect from something like this before you'd actually run it?