How akkshatbhandari/dislog works
DisLog is an event-ingestion and persistence service: a Node.js gateway receives requests, FastAPI accepts events and publishes them to Kafka, and a background consumer validates and batches records into PostgreSQL. The graph also shows event retrieval, offset tracking, bounded work, retries, and dead-letter handling. The worker excerpt is partial, so internal worker relationships are included only where it shows the relevant behavior; the gateway-to-API handoff follows the README, not inspected gateway source.
Main entry points: main.py FastAPI · worker.py Stream Consumer · database.py Database Sessions · server.ts Node Gateway
Components 16
Request Ingress
- Node Gateway
services/gateway/src/server.ts
Ingestion API
- FastAPI
services/ingestion/main.py - Event Schemas
services/ingestion/app/schemas.py - Kafka Producer
services/ingestion/app/kafka.py - Event Retrieval
services/ingestion/main.py
Kafka Processing
- Stream Consumer
services/ingestion/app/worker.py - Event Validation
services/ingestion/app/worker.py - Bounded Work Queue
services/ingestion/app/worker.py - Offset Tracking
services/ingestion/app/worker.py - Batch and Retry
services/ingestion/app/worker.py - Dead Letter Queue
services/ingestion/app/worker.py
Persistence
- Database Sessions
services/ingestion/app/database.py - Event Model
services/ingestion/app/models.py
Other components
- Event Client
- Kafka Broker
- Neon PostgreSQL
Connections 18
- Event Client → Node Gateway: sends events
README.md - Node Gateway → FastAPI: forwards requests
README.md - FastAPI → Event Schemas: validates with
services/ingestion/main.py - FastAPI → Kafka Producer: publishes events
services/ingestion/main.py - Kafka Producer → Kafka Broker: sends events
services/ingestion/app/kafka.py - Kafka Broker → Stream Consumer: delivers records
- Stream Consumer → Event Validation: validates records
services/ingestion/app/worker.py - Stream Consumer → Bounded Work Queue: enqueues records
services/ingestion/app/worker.py - Stream Consumer → Offset Tracking: registers offsets
services/ingestion/app/worker.py - Stream Consumer → Dead Letter Queue: sends failures
services/ingestion/app/worker.py - Bounded Work Queue → Batch and Retry: dispatches batches
services/ingestion/app/worker.py - Batch and Retry → Database Sessions: persists events
services/ingestion/app/worker.py - Batch and Retry → Event Model: inserts records
services/ingestion/app/worker.py - Database Sessions → Neon PostgreSQL: opens sessions
services/ingestion/app/database.py - Event Model → Neon PostgreSQL: maps event rows
- FastAPI → Database Sessions: queries events
services/ingestion/main.py - FastAPI → Event Retrieval: routes retrieval
services/ingestion/main.py - Event Retrieval → Neon PostgreSQL: reads event
services/ingestion/main.py