ferrokinesis
A local AWS Kinesis mock server for testing, written in Rust.
Features
- Pure Rust implementation
- Uses redb for in-memory storage (ACID, zero-copy reads)
- Implements all 39 Kinesis Data Streams API operations
- Supports both JSON and CBOR content types
- 125+ integration tests
Installation
Binary
Download pre-built binaries from GitHub Releases:
# macOS (Apple Silicon)
# macOS (Intel)
# Linux (amd64)
Cargo
Docker
Quick Start
Start the server:
Example using aws CLI:
# Create a stream with 2 shards
# Publish a record to the stream
# Read all records across all shards:
| | while ; do
iter=
done |
Outputs:
Example using AWS SDK for Rust:
let config = defaults
.endpoint_url
.load
.await;
let client = new;
// Create a stream with 2 shards
client.create_stream
.stream_name
.shard_count
.send.await?;
// Publish a record
client.put_record
.stream_name
.partition_key
.data
.send.await?;
// Read all records across all shards
let shards = client.list_shards
.stream_name
.send.await?;
for shard in shards.shards
// => pk1: hello world
Usage
ferrokinesis --help
A local AWS Kinesis mock server for testing
Options:
-p, --port <PORT> Port to listen on [default: 4567]
--create-stream-ms <MS> Time streams stay in CREATING state [default: 500]
--delete-stream-ms <MS> Time streams stay in DELETING state [default: 500]
--update-stream-ms <MS> Time streams stay in UPDATING state [default: 500]
--shard-limit <LIMIT> Shard limit for error reporting [default: 10]
-h, --help Print help
-V, --version Print version
API & Test Coverage
| Operation | Status | Notes |
|---|---|---|
| Stream Management | ✅ | |
| CreateStream | ✅ | |
| DeleteStream | ✅ | |
| DescribeStream | ✅ | |
| DescribeStreamSummary | ✅ | |
| ListStreams | ✅ | |
| UpdateStreamMode | ✅ | PROVISIONED / ON_DEMAND |
| UpdateShardCount | ✅ | Uniform scaling |
| Data Operations | ✅ | |
| PutRecord | ✅ | |
| PutRecords | ✅ | |
| GetRecords | ✅ | |
| GetShardIterator | ✅ | All 5 iterator types |
| SubscribeToShard | ✅ | Event stream over HTTP/1.1 |
| Shard Management | ✅ | |
| ListShards | ✅ | |
| MergeShards | ✅ | |
| SplitShard | ✅ | |
| Retention | ✅ | |
| IncreaseStreamRetentionPeriod | ✅ | |
| DecreaseStreamRetentionPeriod | ✅ | |
| Enhanced Fan-Out (Consumers) | ✅ | |
| RegisterStreamConsumer | ✅ | |
| DeregisterStreamConsumer | ✅ | |
| DescribeStreamConsumer | ✅ | |
| ListStreamConsumers | ✅ | |
| Monitoring | ✅ | |
| EnableEnhancedMonitoring | ✅ | |
| DisableEnhancedMonitoring | ✅ | |
| DescribeLimits | ✅ | |
| DescribeAccountSettings | ✅ | |
| UpdateAccountSettings | ✅ | |
| Encryption | ✅ | |
| StartStreamEncryption | ✅ | |
| StopStreamEncryption | ✅ | |
| Tagging (Stream-name) | ✅ | |
| AddTagsToStream | ✅ | |
| RemoveTagsFromStream | ✅ | |
| ListTagsForStream | ✅ | |
| Tagging (ARN-based) | ✅ | |
| TagResource | ✅ | |
| UntagResource | ✅ | |
| ListTagsForResource | ✅ | |
| Resource Policies | ✅ | |
| PutResourcePolicy | ✅ | |
| GetResourcePolicy | ✅ | |
| DeleteResourcePolicy | ✅ | |
| Other | ✅ | |
| UpdateStreamWarmThroughput | ✅ | |
| UpdateMaxRecordSize | ✅ |
39/39 operations implemented (100%)
Building
Testing
Acknowledgements
Inspired by kinesalite by Michael Hart.
License
MIT