CosmoStreams
Cosmo Streams moves subscription infrastructure into the Router, so your services only publish events and respond to HTTP requests. No connection management required.
The Problem
Without Cosmo Streams, each service that supports subscriptions manages its own connection state, WebSocket servers, and subscriber tracking. Scaling and infrastructure choices become constrained by persistent connections.
See capabilitiesEach service manages WebSocket servers, subscriber tracking, and persistent state. The Router does not own connections.
Subscriber count influences how services scale. As connections grow, every participating service must account for the persistent load.
Persistent connections limit infrastructure choices. Many compute platforms aren't designed to maintain long-lived connections.
How It Works
A service publishes an event when data changes. No WebSocket server required.
The Router receives the event from Kafka, NATS, or Redis.
The Router resolves additional fields; events may carry base data.
The Router delivers the result to matching subscribers.
Capabilities
Move connection state to the Router. Keep services HTTP-based and stateless.
No WebSocket servers in subgraphs
Subgraphs handle HTTP requests and publish events. They do not manage persistent client connections. Cosmo Streams moves connection management to the Router.
Compatible with serverless
Services remain request-based, so they run seamlessly on Lambda, Cloud Run, and other short-lived compute platforms. The Router maintains client connections; services scale with request volume.
Works with your existing broker
The Router connects to Kafka, NATS (including JetStream), or Redis. No additional messaging layer required. Your services already publish events; Cosmo Streams exposes them as GraphQL subscriptions.
Subscription logic centralized
Authorization, filtering, and validation live in Router custom modules or schema directives. The Router manages subscription connections. Implement once, apply consistently.
When to Use Cosmo Streams
Serverless, event-driven backends, or per-user subscription filtering — Cosmo Streams centralizes connection management in the Router.
Serverless
Your services run on Lambda, Cloud Run, or similar. Cosmo Streams lets services remain request-based while the Router maintains connections to clients.
Event-driven
Services publish to Kafka, NATS, or Redis. Cosmo Streams exposes selected events as GraphQL subscriptions without adding subscription infrastructure to each service.
Per-user data
The same subscription should return different results by user. Cosmo Streams applies per-subscriber filtering and authorization in the Router.
FAQ
Get started
Cosmo Streams moves subscription infrastructure into the Router. Your services stay HTTP-only.