Prompt
I'm trying to move from batch ETL to real-time event streaming, what platform setup makes sense?
Latest observation
A good move from batch ETL to real-time streaming usually means shifting from a pipeline-first mindset to an event-driven platform. The “right” setup depends on your latency, scale, governance, and operational tolerance, but a solid default architecture looks like this:
1) Core platform pieces
Event backbone
Use a durable distributed log as the central transport layer:
- Apache Kafka (most common)
- Confluent Cloud / Platform if you want managed Kafka + tooling
- AWS MSK, Azure Event Hubs, or Google Pub/Sub depending on cloud preference
This becomes the system of record for event movement, decoupling producers and consumers.
Stream processing
For transforms, enrichment, windowing, and joins:
- Kafka Streams for simpler app-embedded processing
- Apache Flink for more advanced stateful streaming and low-latency processing
- Spark Structured Streaming if you already have Spark and need a smoother transition
- ksqlDB for SQL-based streaming transformations if your use cases are simpler
Schema and data contracts
To keep events reliable and evolvable:
- Schema Registry with Avro, Protobuf, or JSON Schema
- Strict schema versioning rules
- Compatibility checks in CI/CD
Storage / serving layers
You’ll usually want multiple sinks:
- Operational databases for real-time app reads
- Data lake / warehouse for analytics and historical replay
- Search / cache / OLAP store if you need fast queries
Common targets:
- Snowflake, BigQuery, Databricks, Redshift
- S3/ADLS/GCS data lake
- Elasticsearch/OpenSearch
- Redis, Cassandra, DynamoDB, Postgres depending on access pattern
Orchestration and governance
- Airflow / Dagster / Prefect for batch-like coordination around streaming jobs
- Data catalog and lineage: DataHub, Collibra, Unity Catalog, Amundsen
- Access control / policy: RBAC/ABAC, PII masking, encryption, audit logs
Observability
Must-have for streaming:
- Lag monitoring
- Consumer health
- Dead-letter queues
- Schema change alerts
- End-to-end tracing
- Metrics on throughput, latency, and failure rates
2) Recommended reference architecture
A practical setup is:
Producers
Applications, CDC from databases, SaaS integrations, IoT devices
→ Event bus
Kafka / managed Kafka / Pub/Sub
→ Stream processing layer
Validation, enrichment, deduplication, sessionization, routing
→ Multiple consumers
- Real-time APIs/services
- Feature store / ML pipelines
- Warehouse/lake for analytics
- Alerting and operational dashboards
This keeps ingestion, processing, and consumption decoupled.
3) Best setup by maturity level
If you’re early in the transition
Start simple:
- Managed Kafka or Pub/Sub
- A small number of well-defined topics
- Schema Registry
- One stream processor
- Warehouse sink for analytics
This gets you real-time capability without overbuilding.
If you have moderate scale and complexity
Add:
- Flink or Kafka Streams for stateful processing
- CDC from OLTP databases
- Dead-letter queues and replay strategy
- Data catalog + governance
- Strong SLOs and alerting
If you’re operating at large scale / mission-critical
Consider:
- Multi-region replication
- Exactly-once or effectively-once processing where needed
- Event sourcing or CQRS in parts of the system
- Dedicated platform team
- Standardized event contracts across domains
- Self-service tooling for teams
4) Key design choices to get right
Event design
- Use domain events, not raw table dumps
- Keep events immutable
- Include metadata: event_id, timestamp, source, version, correlation_id
- Prefer compact, explicit schemas
Partitioning strategy
- Partition by business key when ordering matters
- Avoid hot partitions
- Plan for scaling consumers independently
Delivery semantics
- “Exactly once” is useful but not a silver bullet
- Often “at least once + idempotent consumers” is the realistic choice
CDC vs application events
- CDC is great for quickly streaming database changes
- Application events are better for business semantics
- In many cases, use both
5) A sensible default platform recommendation
If you want a modern, broadly applicable setup, I’d suggest:
- Managed Kafka as the event backbone
- Schema Registry
- Flink or Kafka Streams for processing
- CDC tool like Debezium for database change capture
- S3 + warehouse for analytics
- Data catalog/lineage
- Centralized observability
- DLQ + replay tooling
This is a proven setup that balances flexibility, reliability, and scale.
6) Migration approach
Don’t replace ETL all at once. Instead:
- Identify one high-value low-risk use case
- Stream only that domain first
- Keep batch ETL for the rest
- Build common platform standards
- Gradually shift downstream consumers to event streams
- Retire batch paths only when streaming is stable
If you want, I can also give you:
- a reference architecture diagram in text,
- a platform stack recommendation for AWS/Azure/GCP, or
- a decision matrix comparing Kafka vs Pub/Sub vs Kinesis.