Skip to content

Commit f4f715c

Browse files
committed
dynamodb checkpointer
1 parent e68eb4b commit f4f715c

File tree

6 files changed

+1105
-10
lines changed

6 files changed

+1105
-10
lines changed

README.md

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ pip install async-kinesis
7878
# With optional dependencies
7979
pip install async-kinesis[prometheus] # For Prometheus metrics
8080
pip install async-kinesis[redis] # For Redis checkpointing
81+
pip install async-kinesis[dynamodb] # For DynamoDB checkpointing
8182
```
8283

8384
## Basic Usage
@@ -365,25 +366,59 @@ This provides detailed information about shard allocation, closure status, paren
365366

366367
## Checkpointers
367368

368-
- memory (the default but kinda pointless)
369+
Checkpointers manage shard allocation and progress tracking across multiple consumer instances.
369370

370-
```
371-
MemoryCheckPointer()
372-
```
371+
### MemoryCheckPointer
373372

374-
- redis
373+
The default checkpointer (but only useful for single-consumer testing):
375374

376-
```
377-
RedisCheckPointer(name, session_timeout=60, heartbeat_frequency=15, is_cluster=False)
375+
```python
376+
MemoryCheckPointer()
378377
```
379378

380-
Requires ENV:
379+
### RedisCheckPointer
381380

381+
Redis-based checkpointer for distributed consumers:
382+
383+
```python
384+
RedisCheckPointer(
385+
name="consumer-group",
386+
session_timeout=60,
387+
heartbeat_frequency=15,
388+
is_cluster=False
389+
)
382390
```
383-
REDIS_HOST
391+
392+
**Requirements:**
393+
- Install: `pip install async-kinesis[redis]`
394+
- Environment: `REDIS_HOST` (and optionally `REDIS_PORT`, `REDIS_PASSWORD`, `REDIS_DB`)
395+
396+
### DynamoDBCheckPointer
397+
398+
DynamoDB-based checkpointer for serverless deployments:
399+
400+
```python
401+
DynamoDBCheckPointer(
402+
name="consumer-group",
403+
table_name=None, # Optional: defaults to kinesis-checkpoints-{name}
404+
session_timeout=60,
405+
heartbeat_frequency=15,
406+
create_table=True, # Auto-create table if needed
407+
ttl_hours=24 # Automatic cleanup of old records
408+
)
384409
```
385410

386-
Requires `pip install aredis`
411+
**Requirements:**
412+
- Install: `pip install async-kinesis[dynamodb]`
413+
- AWS credentials with DynamoDB permissions
414+
415+
**Benefits over Redis:**
416+
- No infrastructure to manage
417+
- Pay-per-request pricing (no idle costs)
418+
- Automatic scaling
419+
- Built-in backup and recovery
420+
421+
📖 **[DynamoDB Checkpointing Guide](./docs/dynamodb-checkpointing.md)** - Detailed setup and configuration
387422

388423

389424
## Processors (Aggregator + Serializer)
@@ -538,6 +573,7 @@ python tests/resharding/resharding_test.py --scenario scale-up-small
538573
- **[Getting Started Guide](./docs/getting-started.md)** - Step-by-step tutorials for beginners
539574
- **[Common Patterns](./docs/common-patterns.md)** - Real-world use cases and examples
540575
- **[Metrics & Observability](./docs/metrics.md)** - Prometheus integration and monitoring
576+
- **[DynamoDB Checkpointing](./docs/dynamodb-checkpointing.md)** - DynamoDB checkpointer setup and best practices
541577
- **[Troubleshooting Guide](./docs/troubleshooting.md)** - Solutions for common issues
542578
- **[Architecture Details](./docs/DESIGN.md)** - Technical deep dive into the implementation
543579
- **[Why Another Library?](./docs/YETANOTHER.md)** - Comparison with other Kinesis libraries

0 commit comments

Comments
 (0)