logo

Caching KMS data keys in multi-thread environments: Per-tenant encryption for event-driven systems at scale

ID: 03abf0e8-98ea-50ee-9f31-20f7487a4791

STIX ID: report--03abf0e8-98ea-50ee-9f31-20f7487a4791

Feed Name: AWS Security Blog

Date Published: 2026-08-06

Date Updated: 2026-08-07

Author: Maria Gutovsky

...
...

This post explains how envelope encryption at multi-tenant, high-throughput scale can cause a cache stampede that drives millions of redundant AWS KMS GenerateDataKey and Decrypt calls, increasing cost and latency, and presents two mitigation approaches: (A) AWS-recommended hierarchical keyring with DynamoDB branch keys to coordinate cache refreshes across instances, and (B) a custom CachedKmsClient using Caffeine LoadingCache to enforce single-flight KMS API calls per region. NICE Actimize implemented the custom caching approach and reported a 77% reduction in KMS costs while maintaining per-tenant cryptographic isolation and simplifying operations.

Your team is not currently subscribed to this feed. You must subscribe to it in order to see this post.