Architecture Overview
Uniflow is a fully serverless CDP deployed to your AWS account. Every component auto-scales and runs at near-zero cost when idle.
Data flow
Section titled “Data flow”Client SDK └─▶ API Gateway (HTTP API) └─▶ Lambda (validate + enrich) ├─▶ Kinesis Data Stream ──▶ Firehose ──▶ S3 (raw, GZIP) └─▶ Kinesis Data Stream └─▶ Lambda (processor) ├─▶ DynamoDB (identity graph + profile upsert) └─▶ SQS (destination fan-out) └─▶ Lambda (connector) ──▶ External system
EventBridge Scheduler (hourly) └─▶ Glue PySpark Job (audience-builder) └─▶ Athena query over S3 ──▶ DynamoDB (segment membership)
Cognito ──▶ API Gateway ──▶ Lambda (management API)Next.js static export ──▶ S3 ──▶ CloudFrontComponent breakdown
Section titled “Component breakdown”Ingestion pipeline
Section titled “Ingestion pipeline”- Client SDKs send events (track, identify, page, group) to the ingest endpoint
- API Gateway HTTP API receives the request with write-key authentication
- Ingest Lambda validates the event against Zod schemas, enriches with server-side context (IP, timestamp), and writes to Kinesis
Stream processing
Section titled “Stream processing”- Kinesis Data Stream buffers events with 7-day retention
- Firehose delivers raw events to S3 in GZIP-compressed NDJSON format
- Processor Lambda consumes from Kinesis, performs identity resolution (linking anonymous → known users), upserts profiles in DynamoDB, and fans out to SQS
Destination delivery
Section titled “Destination delivery”- SQS queues events per destination with dead-letter queues for reliability
- Connector Lambda executes the destination connector (webhook, S3 export, or custom)
Segmentation
Section titled “Segmentation”- EventBridge Scheduler triggers hourly
- AWS Glue runs the audience-builder PySpark job, which reads S3 via Spark SQL and writes segment membership to both S3 (Parquet) and DynamoDB
- Management API Lambda provides CRUD for sources, destinations, segments, and profiles
- Admin UI is a Next.js static export served via CloudFront
Compute decisions
Section titled “Compute decisions”| Component | Compute | Why |
|---|---|---|
| Ingest API | Lambda | Zero idle cost, auto-scales |
| Stream processor | Lambda | Short-lived, stateless |
| Audience builder | AWS Glue (PySpark) | Serverless Spark for complex segment queries, no VPC needed |
| Destination connectors | Lambda | Event-driven, short-lived |
| Management API | Lambda | Low-traffic CRUD |