Architecture et Fonctionnement
Sous le capot: microservices, cache intelligent, protection PII, files d'attente asynchrones, optimisation adaptative.
System Overview
BTOVEN Translate is a translation middleware platform layered on LibreTranslate (Argos models), adding production-grade features: PII protection, smart caching, async queues, advisory debugging, and multi-SDK distribution — all with zero data retention.
Layer Diagram
Request Flow
- Client calls SDK.translate() or POST /jobs/translate (async) or POST /translate (sync)
- Edge Middleware receives request → observes (latency, chars, errors) → generates advisories (X-Btoven-Advisory header)
- PII Protector (if enabled) scans payload → replaces 52 PII patterns with
{TYPE N}placeholders - Glossary Protection (SDK) wraps brand terms in
{GL N}placeholders that survive translation - Job Queue (async): enqueues with priority, dedup by content hash, supersede queued twins
- Worker (bounded concurrency) picks job → calls LibreTranslate internal → saves result
- Restore: placeholders → original terms; PII restored if enabled
- Response: JSON result + advisory headers + optional webhook callback
- Insights: observation persisted to Redis JSONL → /insights aggregates (p50, p95, throughput, repeats, errors)
Key Design Decisions
Redis JobStore (not in-memory)
Cross-process visibility, survives edge restarts, zset priority queue, content-hash index for dedup.
Protected-mode Redis on host
L0KL shared redis (127.0.0.1:6379) runs protected-mode → container needs password or dedicated redis. Documented in compose.
Single worker per edge (--workers 1)
JobStore is in-memory in worker process; >1 worker splits state. Priority queue is per-process zset in Redis.
No translation persistence
Zero data retention by design. Only job metadata (TTL 1hr) and insights (aggregated) stored.