← sources

Sidecar, service, or application middleware for data protection?

source: reddit (reddit:kubernetes)published 2026-10-19 10:32ingested 2026-10-20 02:39

retained text

Suppose a Kubernetes-based application needs to protect sensitive fields before requests reach external APIs or AI services.

There are a few architectural options:

A sidecar that handles requests close to each workload

A shared service that centralizes tokenization and policy enforcement

Middleware integrated directly into the application

A sidecar might simplify adoption, but introduces resource overhead and deployment complexity. A shared service can centralize policy, but creates network dependencies and needs careful scaling. Middleware gives control but requires application changes.

For teams running production workloads, which approach would you choose, and what failure modes would you consider first?

I'm particularly interested in latency, availability, and policy consistency.

document fetched 2026-10-20 00:37 · canonical https://reddit.com/r/kubernetes/comments/1x9tbyh/sidecar_service_or_application_middleware_for