DEV Community

Cover image for Handling burst passive-liveness queues and on-prem template isolation for an e-KYC face verification service
Habeeb
Habeeb

Posted on Edited on

Handling burst passive-liveness queues and on-prem template isolation for an e-KYC face verification service

Hey devs,

We're designing an on-premise e-KYC and user onboarding microservice for a financial/enterprise rollout in the UAE, where strict data-residency policies rule out sending live selfies or national ID scans to external public cloud APIs.

We are integrating the TekVerifii Face Recognition SDK into our local Kubernetes cluster (Ubuntu 22.04 workers, NVIDIA L4 GPUs, FastAPI gateway in front of a containerized inference worker) to handle passive liveness screening, 1:1 document-to-selfie matching, and 1:N deduplication against an internal gallery.

Current Architecture & Bottleneck: During simulated morning onboarding spikes (~40 concurrent mobile web clients), our API gateway forwards base64/multipart frames over gRPC to the liveness + embedding worker, which verifies the match before writing an audit record to PostgreSQL (pgvector for 512-d embeddings).

yaml

Simplified worker deployment excerpt

resources:
limits:
nvidia.com/gpu: 1
memory: 8Gi
env:

  • name: LIVENESS_MODE value: "passive_single_frame"
  • name: MAX_CONCURRENT_INFERENCE value: "8"

When concurrent KYC requests exceed the worker pool, we're seeing two issues:

  1. - Tail latency spikes on passive liveness: Requests queue behind 1:N gallery checks, pushing p99 response times past 2.8s and causing mobile WebView timeouts.
  2. - Stateless retry vs. replay risk: If a client retries after a gateway timeout, re-submitting the same capture payload triggers our anti-replay check unless we issue a short-lived single-use session nonce before capture.

For teams running self-hosted face recognition SDK pipelines inside a private VPC:

  • Is it better to decouple passive liveness (fast-fail gate on a dedicated lightweight pod) from the 1:1 / 1:N embedding lookup via a Redis/NATS queue, or keep both stages in one GPU worker to avoid extra frame serialization overhead?
  • How are you structuring single-use capture tokens (JWT + short TTL in Redis) so mobile retries on flaky cellular networks don't trip presentation-attack / replay-detection rules?

Top comments (0)