feat(api): complete Phase 2 - framework-less asyncio Ingestion API with backpressure and metrics

This commit is contained in:
2026-09-19 13:18:40 +03:30
parent e40af20331
commit 66a50cd3ba
22 changed files with 775 additions and 20 deletions

View File

@@ -69,4 +69,3 @@ The architecture is constrained to pure Python without web frameworks (FastAPI,
- **[Risk] ClickHouse outage stalls worker** → **[Mitigation]** Retries are bounded to 3 attempts with exponential backoff. If ClickHouse remains unreachable, batch is offloaded to DLQ and offsets committed to prevent infinite consumer lag loops.
- **[Risk] Worker crashes between ClickHouse ACK and Kafka commit** → **[Mitigation]** Re-consumed batch is re-inserted; `ReplacingMergeTree(processed_at)` deduplicates rows sharing the order key `(service_type, radio_access_type, cell_id, session_start_time, msisdn)`.
- **[Risk] Phone number parsing performance overhead** → **[Mitigation]** Use `phonenumbers` library with fast-path prefix checks (`00`, `011`, `+`) before full parsing.