Individual skill
opensearch-personalize-caching-strategies
Caching strategies in front of AWS OpenSearch (Elasticsearch) or AWS Personalize — search, recommenders, multi-recommender pages, anon vs logged-in traffic. Covers ROI decision (TPS/minProvisionedTPS, Zipf, amplification), key design (canonicalisation, cohort vs user, solution-version pinning, bucketing), personalisation boundary (anon/logged split, fan-out coalescing), strategies (cache-aside, refresh-ahead, write-through, batch precompute, L1+L2), TTL (volatility, soft/hard, jitter, event-driven invalidation), stampede protection (single-flight, XFetch, stale-while-revalidate, circuit breaker), observability (hit-rate, cost-per-1k, cardinality drift, log-replay), defensive caching (negative, Bloom filter), and tier composition (LRU, ElastiCache Redis, CloudFront, OpenSearch request/filter cache). Triggers on cache hit rate, Personalize throttling, stampede, single-flight, L1/L2, ElastiCache sizing. Complements opensearch-function-scoring-algorithms.
skills/.experimental/opensearch-personalize-caching-strategies/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Not checked yet
- Last checked
- Nov 5, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 222
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: codex
- design Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
AGENTS.mddoc · 24,412 bytesSKILL.mdcore · 19,303 bytesSKILL.mdcore · 19,303 bytesassets/templates/_template.mddoc · 2,029 bytesmetadata.jsonasset · 8,341 bytesreferences/_sections.mddoc · 6,443 bytesreferences/decide-amplification-multiplier.mddoc · 3,923 bytesreferences/decide-cache-roi-calculation.mddoc · 3,790 bytesreferences/decide-cardinality-floor.mddoc · 3,596 bytesreferences/decide-hot-key-distribution.mddoc · 3,628 bytesreferences/decide-latency-budget.mddoc · 3,591 bytesreferences/decide-personalize-quota-budget.mddoc · 3,502 bytesreferences/decide-search-vs-personalize-asymmetry.mddoc · 4,576 bytesreferences/key-bucket-numerical-ranges.mddoc · 4,187 bytesreferences/key-canonicalize-query.mddoc · 3,716 bytesreferences/key-locale-currency-explicit.mddoc · 3,473 bytesreferences/key-segment-not-user.mddoc · 4,205 bytesreferences/key-stable-hash-algorithm.mddoc · 3,495 bytesreferences/key-strip-volatile-params.mddoc · 3,681 bytesreferences/key-version-the-model.mddoc · 4,226 bytesreferences/neg-bloom-filter-against-misses.mddoc · 4,275 bytesreferences/neg-cache-empty-results.mddoc · 4,177 bytesreferences/neg-cache-throttled-personalize.mddoc · 4,661 bytesreferences/neg-poison-pill-detection.mddoc · 5,429 bytesreferences/obs-cache-simulation-from-logs.mddoc · 5,716 bytesreferences/obs-cost-attribution.mddoc · 5,002 bytesreferences/obs-hit-rate-by-key-class.mddoc · 4,088 bytesreferences/obs-key-cardinality-tracking.mddoc · 4,191 bytesreferences/obs-latency-histograms-with-without.mddoc · 4,239 bytesreferences/obs-stale-served-ratio.mddoc · 4,460 bytesreferences/pers-anonymous-vs-logged-split.mddoc · 4,542 bytesreferences/pers-cohort-precomputation.mddoc · 4,297 bytesreferences/pers-cold-start-cache-priority.mddoc · 4,401 bytesreferences/pers-recommender-fan-out-coalescing.mddoc · 5,367 bytesreferences/pers-session-vector-write-through.mddoc · 4,872 bytesreferences/pers-shared-candidates-private-ranking.mddoc · 4,989 bytesreferences/stamp-circuit-breaker-on-origin-error.mddoc · 4,712 bytesreferences/stamp-coalesce-concurrent-misses.mddoc · 4,837 bytesreferences/stamp-distributed-lock-rebuild.mddoc · 5,274 bytesreferences/stamp-probabilistic-early-expiration.mddoc · 4,922 bytesreferences/stamp-serve-stale-on-rebuild.mddoc · 4,937 bytesreferences/strat-async-warm-up.mddoc · 4,660 bytesreferences/strat-cache-aside-default.mddoc · 4,465 bytesreferences/strat-precompute-batch.mddoc · 4,612 bytesreferences/strat-refresh-ahead-hot-keys.mddoc · 4,087 bytesreferences/strat-tiered-promotion.mddoc · 4,325 bytesreferences/strat-write-through-mutations.mddoc · 4,368 bytesreferences/tier-cdn-for-anonymous.mddoc · 4,964 bytesreferences/tier-l1-in-process.mddoc · 4,360 bytesreferences/tier-l2-elasticache-redis.mddoc · 4,190 bytesreferences/tier-opensearch-filter-context.mddoc · 4,865 bytesreferences/tier-opensearch-request-cache.mddoc · 4,751 bytesreferences/ttl-bound-by-staleness-tolerance.mddoc · 4,576 bytesreferences/ttl-by-content-volatility.mddoc · 4,314 bytesreferences/ttl-event-driven-invalidation.mddoc · 4,868 bytesreferences/ttl-jitter-to-prevent-thundering.mddoc · 3,639 bytesreferences/ttl-personalize-solution-version.mddoc · 4,405 bytesreferences/ttl-soft-and-hard.mddoc · 4,233 bytes
Read excerpt
# Marketplace-Research OpenSearch + Personalize Caching Best Practices
A reference distillation of caching strategies for two-sided marketplaces running AWS OpenSearch (search) and AWS Personalize (recommendations behind a microservice). Contains **52 rules across 9 categories**, ordered by cascade effect — from the upstream decision of *whether* to cache, through key design, personalisation boundary, strategy selection, TTL design, stampede protection, observability, and the lower-cascade categories of negative caching and tier composition. Each rule explains the WHY (the cost, latency, or correctness mechanism), shows incorrect-vs-correct code (TypeScript/Node for the microservice layer, Python for batch and analytics, OpenSearch JSON for OS-specific queries, YAML for CDN/Kubernetes), and cites the canonical source — AWS Personalize/OpenSearch/ElastiCache documentation, the XFetch paper (Vattani et al. VLDB 2015), RFC 5861 (stale-while-revalidate), and the engineering blogs of cache infrastructure teams (Netflix EVCache, Pinterest Cachelib, Twitter Twemcache, Cloudflare).
This is the **complement** to [`opensearch-function-scoring-algorithms`](../opensearch-function-scoring-algorithms/) — that skill answers "what should the ranking compute?", this skill answers "how do you scale it to production traffic without burning down OpenSearch or Personalize?"
## When to Apply
Reach for this skill when:
- Adding caching to a search or recommendation surface for the first time — start with [decide-cache-roi-calculation](references/decide-cache-roi-calculation.md) and [decide-hot-key-distribution](references/decide-hot-key-distribution.md)
- A homepage or category page renders 5+ recommenders and Personalize bills are growing faster than traffic — [decide-amplification-multiplier](references/decide-amplification-multiplier.md), [pers-recommender-fan-out-coalescing](references/pers-recommender-fan-out-coalescing.md), [pers-cohort-precomputation](references/pers-cohort-precomputation.md)
- Cache hit rate is suspiciously low (under 30-40%) and you don't know why — [key-canonicalize-query](references/key-canonicalize-query.md), [key-strip-volatile-params](references/key-strip-volatile-params.md), [key-bucket-numerical-ranges](references/key-bucket-numerical-ranges.md), [obs-key-cardinality-tracking](references/obs-key-cardinality-tracking.md)
- Personalize is throttling (HTTP 429) during traffic spikes — [decide-personalize-quota-budget](references/decide-personalize-quota-budget.md), [neg-cache-throttled-personalize](references/neg-cache-throttled-personalize.md), [stamp-circuit-breaker-on-origin-error](references/stamp-circuit-breaker-on-origin-error.md)
- p99 spikes at TTL boundaries — [stamp-coalesce-concurrent-misses](references/stamp-coalesce-concurrent-misses.md), [stamp-probabilistic-early-expiration](references/stamp-probabilistic-early-expiration.md), [stamp-serve-stale-on-rebuild](references/stamp-serve-stale-on-rebuild.md), [ttl-soft-and-hard](references/ttl-soft-and-hard.md), [ttl-jitter-to-prevent-thundering](references/ttl-jitter-to-prevent-thundering.md)