Introducing Stream
Stream is our real-time event streaming service built for high-throughput applications.
What is Stream?
Stream enables you to publish and consume events at scale. Whether you're building real-time dashboards, processing user activity, or synchronizing data across services, Stream handles the complexity.
Key Features
Consumer Groups
Distribute event processing across multiple consumers. Stream automatically balances the load and handles failover.
import { Stream } from '@fourbyfour/sdk';
const stream = new Stream({ apiKey: 'your-key' });
// Publish events
await stream.publish('user-events', {
type: 'signup',
userId: '123',
timestamp: Date.now()
});
// Consume with consumer groups
stream.subscribe('user-events', {
group: 'analytics-processors',
handler: async (event) => {
console.log('Processing:', event);
}
});Partitions
Control event ordering and parallelism. Events with the same partition key are always processed in order.
Guaranteed Ordering
Within a partition, events are delivered in exactly the order they were published. No surprises.
At-Least-Once Delivery
Every event is delivered at least once. Your handlers should be idempotent.
Use Cases
- Real-time Analytics: Process user events as they happen
- Microservice Communication: Decouple services with event-driven architecture
- Activity Feeds: Build real-time feeds and notifications
- Data Synchronization: Keep systems in sync
Performance
- Sub-10ms publish latency
- Millions of events per second
- 99.9% uptime SLA
Getting Started
npm install @fourbyfour/sdkCheck out the documentation to get started with Stream.