One Interface, Many Backends
Every state store implements IDataStore<TKey, TValue>. Your stream code stays the same—just swap the store type and Cortex handles the rest.
<K, V>
Why State Stores Matter
Stateful operators—aggregations, windows, joins—need somewhere to keep running totals, session data, and lookup tables. State Stores give them a pluggable, fault-tolerant home.
-
Fault Tolerance
Persistent stores survive crashes and restarts—no data loss. -
Performance
In-memory stores deliver microsecond reads; RocksDB balances speed with durability. -
Scalability
Distributed backends like Cassandra and MongoDB scale horizontally with your workload. -
Seamless Integration
Operators consume state stores automatically—no manual wiring required.
Choose the Right Backend for Your Workload
From lightning-fast in-memory stores to distributed cloud databases—Cortex ships 9 production-ready backends.
In-Memory Store
Fastest possible reads and writes. Ideal for development, testing, and transient state that doesn't need to survive restarts.
Fastest Non-PersistentRocksDB Store
Embedded, high-performance key-value store. Persistent, LSM-based, perfect for single-node production workloads.
Embedded PersistentSQL Server Store
Enterprise-grade state management with full transactional support. Both key-value and structured store variants.
Enterprise TransactionalPostgreSQL Store
Reliable, ACID-compliant storage with advanced querying capabilities. Ideal for cloud-native deployments.
Cloud-Native ACIDSQLite Store
Lightweight, file-based persistent store. Zero configuration—perfect for edge, IoT, and single-process applications.
Lightweight Zero-ConfigClickHouse Store
Columnar analytics engine. Designed for high-performance analytical processing over massive state datasets.
Analytics ColumnarMongoDB Store
Document-oriented, schema-flexible storage. Great for complex state structures and rapid schema evolution.
Flexible Schema DistributedCassandra Store
Distributed, fault-tolerant, and highly available. Write-optimized for geo-distributed, always-on applications.
Distributed High AvailabilityDuckDB Store
In-process OLAP database. Blazing-fast analytical queries directly on state data without external infrastructure.
OLAP EmbeddedChoosing the Right Store
| Store | Persistence | Speed | Distributed | Best For |
|---|---|---|---|---|
| In-Memory | No | ⚡ Fastest | No | Dev / test, transient state |
| RocksDB | Yes | ⚡ Very Fast | No | Single-node production |
| SQLite | Yes | Fast | No | Edge / IoT, single-process |
| SQL Server | Yes | Fast | Optional | Enterprise, transactional |
| PostgreSQL | Yes | Fast | Optional | Cloud-native, ACID |
| ClickHouse | Yes | ⚡ Very Fast | Yes | Analytics, columnar queries |
| MongoDB | Yes | Fast | Yes | Flexible schema, documents |
| Cassandra | Yes | Fast | Yes | Geo-distributed, always-on |
| DuckDB | Yes | ⚡ Very Fast | No | Embedded OLAP analytics |
When You Need State
Financial Transactions
Running balances, fraud scores, and transaction histories that must survive restarts.
IoT & Sensor Data
Aggregate sensor readings over time and alert on threshold violations.
Session Tracking
Maintain user session state for real-time personalization and analytics.
Real-Time Analytics
Windowed aggregations over click-streams, logs, and event data at scale.
Add State to Your Streams
Pick the backend that fits your workload, plug it in with one line, and let Cortex manage the rest—persistence, recovery, and performance included.