Streaming data engineering is the discipline of building systems that process unbounded data in near-real-time. Unlike streaming architecture (which focuses on system design), this skill focuses on the hands-on engineering: writing producers and consumers, implementing windowed aggregations, guaranteeing exactly-once delivery, handling backpressure, and operating streaming jobs in production.
Nothing. It ships with Murage, which is open source. Your bots run on the AI plan you already have.
Can I change it?+
Yes. Open it in Settings → Skills to read, edit or duplicate it. Skill Guard scans it again after every edit.
Give your first job to Murage.
Download the app, connect the AI you already pay for, and tell your Chief of Staff what needs doing. Plan on about ten minutes from install to a working team.
Symptoms of backpressure:
- Consumer lag growing continuously
- Processing latency increasing over time
- Memory usage climbing in stream processors
- Checkpoint durations increasing (Flink)
Diagnosis checklist:
[ ] Check consumer group lag: kafka-consumer-groups --describe --group <id>
[ ] Monitor Flink backpressure metrics: taskmanager.job.task.isBackPressured
[ ] Check Spark streaming batch duration vs trigger interval
[ ] Review GC logs for memory pressure
[ ] Profile serialization/deserialization overhead
Backpressure Mitigation Strategies
python
# Strategy 1: Rate limiting at source
kafka_source_config = {
'maxOffsetsPerTrigger': 50000, # Spark: limit records per trigger
'get.max.bytes': 5242880, # Kafka consumer: limit get size
}
# Strategy 2: Async processing with bounded queue
import asyncio
from asyncio import Semaphore
semaphore = Semaphore(100) # Max 100 concurrent operations
async def process_with_backpressure(event):
async with semaphore:
result = await process_event_async(event)
return result
# Strategy 3: Spillable state backend (Flink)
# flink-conf.yaml:
# state.backend: rocksdb
# state.backend.rocksdb.memory.managed: true
# state.backend.rocksdb.memory.fixed-per-slot: 256mb
# Strategy 4: Dynamic scaling
# Monitor lag, scale consumers when threshold exceeded
def autoscale_consumers(current_lag, threshold=100000):
if current_lag > threshold * 3:
scale_consumer_group(replicas=current_replicas * 2)
elif current_lag > threshold:
scale_consumer_group(replicas=current_replicas + 1)
elif current_lag < threshold * 0.1:
scale_consumer_group(replicas=max(1, current_replicas - 1))
Schema Evolution
Avro Schema Registry Integration
python
from confluent_kafka.schema_registry import SchemaRegistryClient
from confluent_kafka.schema_registry.avro import AvroSerializer, AvroDeserializer
schema_registry = SchemaRegistryClient({'url': '[reference URL]'})
# Schema evolution compatibility rules:
# BACKWARD - new schema can read old data (safe for consumers first)
# FORWARD - old schema can read new data (safe for producers first)
# FULL - both backward and forward compatible
# NONE - no compatibility checking
# Set compatibility level
schema_registry.set_compatibility(
subject_name="orders-value",
level="BACKWARD"
)
# Safe schema changes (backward compatible):
# - Add optional field with default
# - Remove field that had a default
# - Change field from specific type to union with null
# Unsafe schema changes:
# - Remove required field
# - Change field type
# - Rename field (no concept of rename in Avro)
Production Monitoring
Key Metrics to Track
yaml
producer_metrics:
- record-send-rate # Records/sec being produced
- record-error-rate # Failed sends/sec
- request-latency-avg # Average broker response time
- batch-size-avg # Bytes per batch
- buffer-available-bytes # Remaining buffer capacity
consumer_metrics:
- records-lag-max # Maximum partition lag
- records-consumed-rate # Records/sec consumed
- commit-latency-avg # Offset commit time
- rebalance-rate # Consumer group rebalances
flink_metrics:
- numRecordsInPerSecond # Input throughput
- numRecordsOutPerSecond # Output throughput
- currentInputWatermark # Watermark progress
- lastCheckpointDuration # Checkpoint time
- isBackPressured # Backpressure indicator
alerts:
- consumer_lag > 100000 for 5m # Falling behind
- checkpoint_duration > 60s # State too large
- error_rate > 0.01 # > 1% errors
- rebalance_count > 3 in 10m # Unstable group
Streaming Job Health Dashboard Query (Prometheus)
promql
# Consumer lag trend
sum(kafka_consumer_group_lag) by (group, topic)
# Processing throughput
rate(flink_taskmanager_job_task_numRecordsInPerSecond[5m])
# End-to-end latency (event time to processing time)
histogram_quantile(0.99,
rate(stream_processing_latency_seconds_bucket[5m])
)
# Backpressure ratio
avg(flink_taskmanager_job_task_isBackPressured) by (task_name)
Delivery Guarantees Decision Guide
Guarantee
How
Trade-off
Use When
At-most-once
Auto-commit before processing
Fastest, may lose data
Metrics, logs, non-critical
At-least-once
Commit after processing
Duplicates possible
Most use cases + idempotent sink
Exactly-once
Transactions or idempotent writes
Slowest, most complex
Financial, inventory, billing
Implementing Idempotent Consumers
python
# Pattern: Deduplication with idempotency key
class IdempotentProcessor:
def __init__(self, redis_client):
self.redis = redis_client
self.dedup_ttl = 86400 # 24 hours
def process(self, event):
idempotency_key = f"processed:{event.topic}:{event.partition}:{event.offset}"
# Check if already processed
if self.redis.exists(idempotency_key):
return # Skip duplicate
# Process within transaction
with db.begin():
result = handle_event(event)
db.execute(insert_result(result))
# Mark as processed
self.redis.setex(idempotency_key, self.dedup_ttl, "1")
Common Anti-Patterns
ANTI-PATTERN FIX
------------------------------------------------------------------
Synchronous HTTP calls in stream Use async I/O or batch lookups
processing
Unbounded state accumulation Set state TTL, use windowed state
Processing one record at a time Use micro-batching or bulk APIs
Ignoring late data Configure watermarks + allowed
lateness + side outputs
Committing offsets before processing Commit after processing succeeds
No dead letter queue Always route failed records to DLQ
Hardcoded parallelism Size based on partition count and
throughput requirements
No schema management Use Schema Registry from day one
When to Use
Use this skill when:
Designing or implementing streaming data engineer solutions
Reviewing or improving existing streaming data engineer approaches
Making architectural or implementation decisions about streaming data engineer
Learning streaming data engineer patterns and best practices
Troubleshooting streaming data engineer-related issues
Do NOT use this skill when:
The question is about a fundamentally different technology domain
A more specific sibling skill covers the exact topic needed
The user needs a complete hands-on tutorial rather than expert guidance
Output Format
markdown
# Streaming Data Engineer Analysis
## Context Assessment
[Situation summary and constraints]
## Recommended Approach
[Primary recommendation with rationale]
## Implementation Steps
1. [Step with specific details]
2. [Step with specific details]
3. [Step with specific details]
## Trade-offs and Considerations
- [Key trade-off 1]
- [Key trade-off 2]
## Next Steps
- [Immediate action item]
- [Follow-up action item]
Example
Input: "Help me implement streaming data engineer for a medium-scale production application"
Output: A structured analysis covering current state assessment, recommended streaming data engineer approach with specific patterns, implementation roadmap with milestones, and risk mitigation strategies tailored to the application scale and constraints.
Edge Cases
Legacy system integration: When streaming data engineer must coexist with legacy approaches, provide a gradual migration path rather than a complete rewrite
Scale mismatch: When the solution complexity exceeds the project scale, recommend a simpler approach and note when to revisit
Team skill gaps: When the team lacks experience with the recommended approach, include learning resources and simpler alternatives
Conflicting requirements: When constraints conflict (e.g., performance vs. maintainability), explicitly state the trade-off and recommend based on stated priorities