This directory contains production-ready StreamForge configurations for common use cases.
Each configuration demonstrates best practices for specific scenarios:
| Config | Use Case | Primary trade-off | Complexity |
|---|---|---|---|
| user-filtering.yaml | User event filtering and routing | More destination-specific work | Medium |
| cross-region-replication.yaml | Multi-region Kafka replication | WAN efficiency and recovery point | Low |
| cdc-to-datalake.yaml | Database CDC to data lake | Freshness versus batching | Medium |
| multi-tenant-filtering.yaml | Multi-tenant event routing | Isolation versus pipeline count | Medium |
| pii-redaction.yaml | PII minimization and pseudonymization | Stronger transforms cost more CPU | High |
Scenario: Filter and route user events based on status, tier, and region.
Key features:
- Multi-destination routing with independent filters
- Region-based partitioning for locality
- Timestamp-based filtering for time windows
- CONSTRUCT transforms for field extraction
When to use:
- User activity streams
- Event-driven architectures
- Regional data processing
- Multi-tier systems
Tuning:
- Increase
threadsfor higher throughput - Adjust
batch_sizefor latency vs throughput trade-off - Use
fetch_min_bytesto control batch sizes
Scenario: Replicate events from one Kafka cluster to another for DR or multi-region.
Key features:
- Batching-oriented configuration for WAN efficiency
- Compression for WAN transfer
- TLS/SASL for secure cross-region
- Offset management with
earliestfor DR
When to use:
- Disaster recovery
- Multi-region deployments
- Data center migration
- Hub-and-spoke architectures
Tuning:
- Large
batch_sizeandlinger_msfor WAN efficiency - High
fetch_min_bytesto reduce round trips - Aggressive
retrysettings for reliability - Consider
commit_interval_msvs RPO requirements
Security:
- Use separate credentials for source/dest clusters
- Encrypt credentials with Kubernetes secrets
- Enable TLS for both source and destination
- Use SASL_SSL protocol for authentication
Scenario: Stream database changes (CDC) to data lake via Kafka.
Key features:
- Debezium CDC format parsing
- Operation-based routing (INSERT/UPDATE/DELETE)
- Schema change handling
- Field extraction from CDC envelope
When to use:
- Database replication
- Data warehouse ETL
- Real-time analytics
- Audit logging
CDC operations:
c(create): Extract/payload/after(new row)u(update): Extract/payload/after(updated row)d(delete): Extract/payload/before(deleted row)s(schema change): Extract/payload(DDL)
Tuning:
- Moderate
batch_sizefor balanced throughput - Higher
linger_msfor data lake batching - Consider
commit_interval_msvs data freshness
Integration:
- Works with Debezium, Maxwell, or similar CDC tools
- Output topics can be consumed by:
- Kafka Connect S3 sink
- Apache Flink
- Spark Streaming
- Custom data lake consumers
Scenario: Route events from shared topic to tenant-specific topics.
Key features:
- Tier-based routing (enterprise/professional/free)
- Tenant-specific destinations
- Active/inactive filtering
- Dedicated topics for high-value customers
When to use:
- SaaS platforms
- Multi-tenant applications
- Customer-specific SLAs
- Usage-based billing
Tuning:
- Cache tenant metadata for enrichment
- Use
partitioning: hashfor even load distribution - Consider separate pipelines for enterprise tier (lower latency)
Scaling:
- Scale replicas based on total tenant count
- Monitor lag per destination topic
- Use separate consumer groups for tenant tiers
Scenario: Redact or mask PII before sending to analytics/third-party systems.
Key features:
- Field hashing (SHA256, MD5)
- Selective field extraction with CONSTRUCT
- Consent-based routing
- Full data retention for compliance
When to use:
- GDPR/CCPA compliance
- Third-party integrations
- Analytics pipelines
- Data minimization
PII handling:
- Hash: Use SHA256 for irreversible anonymization
- Redact: Remove fields entirely with CONSTRUCT
- Mask: Replace with placeholder (not yet supported, use CONSTRUCT)
- Encrypt: Use encrypted Kafka topics + TLS
Compliance considerations:
- Audit all PII access (enable Kafka audit logs)
- Implement data retention policies
- Document data lineage
- Encrypt at rest and in transit
- Use field-level encryption for sensitive data
# Validate syntax
streamforge-validate examples/production/user-filtering.yaml
# Check for deprecations
streamforge-validate examples/production/user-filtering.yaml --fail-on-warningsUsing kubectl:
# Create ConfigMap from file
kubectl create configmap streamforge-config \
--from-file=config.yaml=examples/production/user-filtering.yaml \
-n streamforge
# Apply deployment
kubectl apply -f k8s/deployment.yaml -n streamforgeUsing Helm:
# Install with custom config
helm install streamforge streamforge/streamforge \
--namespace streamforge \
--create-namespace \
--values examples/production/user-filtering.yamlUsing Operator:
# Convert YAML to StreamforgePipeline CRD
kubectl apply -f - <<EOF
apiVersion: streamforge.io/v1alpha1
kind: StreamforgePipeline
metadata:
name: user-filtering
namespace: streamforge
spec:
image: streamforge:1.0.0
replicas: 3
config:
$(cat examples/production/user-filtering.yaml | sed 's/^/ /')
EOFPodman:
podman run --rm \
-v $(pwd)/examples/production/user-filtering.yaml:/app/config.yaml:ro \
--network host \
streamforge:1.0.0 \
--config /app/config.yamlPodman Compose:
version: '3.8'
services:
streamforge:
image: streamforge:1.0.0
volumes:
- ./examples/production/user-filtering.yaml:/app/config.yaml:ro
environment:
RUST_LOG: info
networks:
- kafka-networkThe following profiles illustrate configuration trade-offs; they are not capacity or latency promises. Measure them with representative messages, partitions, brokers, delivery guarantees, and hardware.
threads: 8
performance:
fetch_min_bytes: 10240
batch_size: 5000
linger_ms: 50
compression: "zstd"
commit_strategy: "manual"
commit_interval_ms: 10000threads: 2
performance:
fetch_min_bytes: 1
fetch_max_wait_ms: 10
batch_size: 100
linger_ms: 0
commit_strategy: "per-message"threads: 4
performance:
fetch_min_bytes: 5120
batch_size: 2000
linger_ms: 20
compression: "zstd"
commit_strategy: "time-based"
commit_interval_ms: 1000threads: 4
performance:
fetch_min_bytes: 5120
fetch_max_wait_ms: 500
batch_size: 2000
linger_ms: 100
compression: "zstd"
commit_strategy: "manual"
commit_interval_ms: 10000
resources:
requests:
cpu: 500m
memory: 1GiThroughput:
rate(streamforge_messages_consumed_total[5m])
rate(streamforge_messages_produced_total[5m])
Lag:
streamforge_consumer_lag
Error Rate:
rate(streamforge_errors_total[5m])
DLQ Rate:
rate(streamforge_dlq_messages_total[5m])
Latency (p95):
histogram_quantile(0.95, rate(streamforge_processing_duration_seconds_bucket[5m]))
Critical:
- Consumer lag is growing without recovery
- Error rate breaches the workload-specific error budget
- Pod down
- Memory exhaustion
Warning:
- Consumer lag remains above the workload-specific threshold
- Error rate is elevated
- DLQ accumulation
- Processing latency breaches the workload-specific objective
- Check CPU usage:
kubectl top pods -n streamforge - Scale up replicas:
kubectl scale deployment streamforge --replicas=N - Increase threads in config
- Optimize filters (use KEY_PREFIX instead of REGEX)
- Check DLQ messages:
kafka-console-consumer --topic streamforge-dlq - Review error headers for patterns
- Fix filter/transform logic
- Update config and redeploy
- Check threading: Increase
threadsto match CPU cores - Check batching: Increase
batch_sizeandlinger_ms - Check commit overhead: Use
manualortime-basedstrategy - Enable compression: Use
zstdfor best performance
- Check message sizes
- Reduce
batch_size - Increase memory limits
- Check for memory leaks (restart pods)
TLS for Kafka:
kafka:
security:
protocol: "SSL"
ssl:
ca_location: "/certs/ca.crt"
certificate_location: "/certs/client.crt"
key_location: "/certs/client.key"SASL Authentication:
kafka:
security:
protocol: "SASL_SSL"
sasl_mechanism: "SCRAM-SHA-512"
sasl_username: "${KAFKA_USER}"
sasl_password: "${KAFKA_PASSWORD}"Kubernetes Secrets:
kubectl create secret generic kafka-credentials \
--from-literal=username=myuser \
--from-literal=password=mypassword \
-n streamforgeEnvironment Variables:
env:
- name: KAFKA_USER
valueFrom:
secretKeyRef:
name: kafka-credentials
key: username
- name: KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: kafka-credentials
key: passwordQuestions or Issues?
- GitHub: https://github.com/rahulbsw/streamforge/issues
- Documentation: https://github.datasierra.com/streamforge/