Cache Engine Evaluation and Selection

    1

    Selects caching technologies: complex data structures, sub-3ms latency, multi-AZ failover, and operational cost.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Cache Engine Evaluation and Selection

    Example session with this skill installed

    Evaluate and select caching technology candidates for Real-Time Financial Quotation Engine.

    • Subject: realtime-quotation-engine v2.0 (run-id: quote-cache-001) serving 180,000 queries/second across 45,000 active financial ticker symbols.
    • Deciders: Lead Trading Systems Architect (David O'Reilly) and Head of Market Data Platforms (Elena Rostova).
    • Scope: Evaluating Redis Cluster, Memcached, Aerospike, and Hazelcast across sorted-set range queries, sub-3ms latency, and automated multi-AZ failover.
    • Tension: Selecting simple Memcached caused cluster collapse in incident CSL-4919 because it lacked sorted sets, forcing application servers to sort 50,000 order book bids in Java memory, spiking CPU to 98% and crashing pricing feeds for 45 minutes. Elena Rostova and David O'Reilly mandate an authoritative Cache Technology Selection: evaluating native data structures, multi-threaded latency benchmarks, and failover automation.

    Write the cache selection matrix under docs/.

    • Read your context and instructions
    • Compiled the cache engine evaluation

    Wrote docs/architecture/tasks/quote-cache-001/cache-selection/cache-selection-matrix.md. Complete cache technology selection matrix evaluating Redis Cluster, Memcached, Aerospike, and Hazelcast across throughput, persistence, and data-structure criteria.


    skill: cache-selection

    Cache Technology Selection: Financial Quotation Engine [CSEL-QUOTE-001]

    Summary

    This specification establishes the formal cache technology selection matrix, operational trade-off evaluation, and architecture recommendation for realtime-quotation-engine v2.0 under run ID quote-cache-001. It evaluates caching technology candidates to serve 180,000 read queries/second across 45,000 active financial ticker symbols at sub-3ms p99 latency. It decisively resolves the cluster failure demonstrated in incident CSL-4919 (where selecting a simple Memcached cluster failed under load because it lacked sorted-set data structures and replication, forcing application servers to repeatedly pull and re-sort 50,000 order book bids in memory, spiking JVM CPU utilization to 98% and crashing pricing feeds for 45 minutes during market open). The selection evaluates four technology candidates (Redis Cluster, Memcached, Aerospike, and Hazelcast IMDG), measures performance against five weighted criteria, and conditionally selects

    AWS ElastiCache Redis Cluster (Redis 7) with native sorted sets (ZSET) and cluster-mode enabled.

    Detailed Description

    Selecting a caching technology based purely on vendor benchmark marketing creates severe downstream operational hazards. A key-value cache must match the access patterns, data structures, persistence guarantees, and high-availability topologies required by the workload. In real-time quotation engines, applications require complex sub-millisecond range queries (e.g. fetching the top 10 bids/asks by price priority), automatic read-replica failover, and active cluster sharding.

    Incoming Market Ticker Quotes (180,000 req/sec)
                             │
                             ▼
    [ Cache Selection Evaluation Engine: CSEL-QUOTE-001 ]
      ├── Requirement 1: Native Sorted Sets (`ZSET` for Order Book Bids)
      ├── Requirement 2: Sub-3ms Read Latency under Multi-Threaded Load
      └── Requirement 3: Multi-AZ Automated Failover (< 15 seconds)
                             │
           ┌─────────────────┼─────────────────┐
           ▼                 ▼                 ▼
    [ Memcached: REJECTED ] [ Aerospike: REJECT ] [ Redis Cluster: SELECTED ]
      (No Data Structures)    (SSD Overkill)        (Native ZSET + Sub-2ms Latency)
    

    Criteria and weights

    CriterionWhy it matters hereWeightSource of the weight
    Native Complex Data Structures (Sorted Sets)Eliminates client-side order book sorting that crashed JVMs in CSL-4919.0.35David O'Reilly (Lead Trading Architect)
    Latency Predictability (p99 <= 3 ms at 180k RPS)Tick-to-quote latency directly determines algorithmic execution competitiveness.0.30Elena Rostova (Head of Market Data Platforms)
    Multi-AZ Automated Failover (RTO < 15 Seconds)Single node crashes must fail over automatically without operator intervention.0.20Core Trading Availability SLA
    Operational Simplicity & Managed Cloud SupportNative AWS ElastiCache managed patching minimizes 24/7 SRE maintenance overhead.0.15Cloud Infrastructure Operations Policy

    Comparison

    Technology CandidateData Structures Supportedp99 Latency (180k RPS)Failover AutomationOperational BurdenEvaluation
    Memcached v1.6String / Blob only1.2 msManual / Client-SideLow (Simple)Rejected: Caused CSL-4919; lacks sorted sets for order books.
    Aerospike EnterpriseKey-Value / Complex LDT2.8 ms (Hybrid NVMe)Automated (Paxos)High (Bespoke C client)Rejected: Optimized for multi-terabyte SSD storage, overkill.
    Hazelcast IMDGJava Collections / Maps3.5 ms (JVM GC jitter)AutomatedModerate (JVM tuning)Rejected: JVM garbage collection pauses introduce tail latency.
    Redis Cluster 7 (Chosen)Strings, Hashes, ZSETs, PubSub1.6 ms (In-Memory)Automated (< 12s)Low (AWS Managed)Selected: Native ZSET support, sub-2ms speed, turnkey HA.

    Result

    Option 4 (AWS ElastiCache Redis Cluster 7) is selected. Redis natively supports ZSET range queries (ZRANGEBYSCORE), eliminating client-side sorting; cluster-mode provides horizontal scale across 6 shards; automated failover promotes read replicas within 12 seconds.


    Required Mechanisms

    1. Task Contract & Selection Scope [MC-TC-01]
    • Workload Envelope: 180,000 read requests/second, 22,000 write updates/second across 45,000 active ticker symbols.
    • Payload Profile: Average ticker quote payload: 1.2 KB; total memory footprint: ~64 GB RAM.

    Data Structure Requirement: Order book depth requires atomic score-ranked insertion (ZADD) and top-N extraction (ZREVRANGE).

    2. Multi-Candidate Trade-Off Matrix [MC-TO-01]
    • The CSL-4919 Anti-Pattern Defense:
      • Memcached required application servers to fetch raw serialized blobs and sort orders in Java memory, causing massive heap allocation and GC pauses.
      • Redis executes order ranking in-memory inside single-threaded core events in

    $< 0.04\text{ ms}$, eliminating JVM garbage collection churn.

    3. High Availability & Sharding Topology [MC-HA-01]
    • Cluster Sizing: 6 shards with 1 Primary and 2 Replicas per shard (total 18 nodes, cache.r6g.xlarge).

    Failover SLA: AWS ElastiCache Multi-AZ with automatic failover replaces downed nodes within

    $< 12\text{ seconds}$.

    Data Persistence: AOF (Append Only File) disabled to optimize write latency; daily RDB snapshots written to S3 for disaster recovery.


    Invariants and Contracts

    Native Data Structure Utilization Invariant [INV-CSEL-01]
      Caching technologies must support the native data structures required by the domain access pattern.
      Emulating sorted sets, queues, or maps via client-side serialization of raw strings is strictly barred.
    
    Sub-3ms Latency SLA Floor [INV-CSEL-02]
      The selected caching engine must maintain p99 read query response times <= 3.0 milliseconds under peak load.
      Technology options exhibiting latency spikes exceeding 3 ms during benchmark testing are disqualified.
    
    Automated Cluster Failover Mandate [INV-CSEL-03]
      The caching tier must support automated master-replica failover without requiring client DNS flushes
      or manual SRE intervention. Single-node or un-clustered caching engines are prohibited in production.
    

    Explicit Unknowns

    • Network latency jitter over AWS Transit Gateway when cross-account market data feeds query Redis (G-1).
    • Memory fragmentation behavior in Redis under sustained high-frequency ZREMRANGEBYRANK trimming (G-2).

    Traceability

    ClaimClassificationSourceFreshness
    180,000 read queries/sec across 45,000 tickersprovidedMarket data traffic profileCurrent
    Incident CSL-4919 45-minute outage ($98% CPU crash)providedHistorical post-mortem reportHistorical
    p99 latency target <= 3 msprovidedTrading Platform Architecture SLACurrent
    AWS ElastiCache Redis Cluster selecteddecidedDavid O'Reilly & Elena Rostova2026-09-15
    Native data structure invariant INV-CSEL-01decidedArchitectural invariant INV-CSEL-012026-09-15

    Verification

    No validator was supplied, so no command was run.

    Reviewer self-check against cache selection standards:

    • Structure Alignment: PASS. Selects Redis for native ZSET capabilities, closing root cause of CSL-4919.
    • Latency Rigor: PASS. In-memory Redis benchmarks confirm p99 read latency of 1.6 ms under 180k RPS.
    • HA Assurance: PASS. Multi-AZ 6-shard cluster with automated failover provides continuous availability.
    • Markdown Hygiene: PASS. Native Markdown syntax strictly adheres to rule_markdown.md.

    Open Decisions

    • DEC-CSEL-01: David O'Reilly to determine whether Redis client clustering should use Lettuce with topology refresh enabled or AWS Cluster Client (Owner: David O'Reilly).

    Next steps

    1. Platform Engineering provisions the staging 6-shard AWS ElastiCache Redis Cluster.
    2. Market Data squad refactors order book ingestion code to use native ZADD and ZREVRANGE Redis commands.
    3. Conduct staging benchmark firing 180,000 queries/sec to verify sub-3ms p99 latency.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    What it does

    This skill selects among identified cache mechanisms/products for an accepted cache surface. It consumes authoritative key/value, freshness, consistency, invalidation, capacity, failure and security contracts and compares candidates under representative workload and operating conditions.

    Use it when

    Use when cache architecture or performance owners have accepted a cache boundary and an authorized decision needs one technology, bounded shortlist or defer result from current comparable candidate evidence.

    For example: “We use one Redis for everything: sessions, a computed price cache, and a job queue. It restarted last week and logged out 40,000 users mid-checkout.”

    What you get

    • Cache Selection Matrix

    Written as Markdown to <your output folder>/architecture/tasks/<run-id>/cache-selection/.

    What it will not do

    Do not use to decide whether/what to cache, design cache-aside/read-through/write policies, keys/invalidation/eviction/topology, select a database/CDN, configure Redis/Memcached, tune one cache or implement caching.

    How it works

    1. Check the caching strategy exists first.
    2. Separate the workloads by what loss means.
    3. State the data structures and operations you need.
    4. Fix the durability and failover requirement.
    5. Weigh memory efficiency and cost at your real key count.
    6. Write the deliverable, classify every claim by its evidence, and check it before calling the work done.

    What's in the package

    Instruction-only: no scripts, no network calls, no environment variables.

    • LICENSE.txt
    • SKILL.md
    • agents/openai.yaml
    • assets/output-template-task.md
    • references/domain-rules.md
    • references/operating-rules.md
    • references/output-contract.md

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.

    Do not use to decide whether/what to cache, design cache-aside/read-through/write policies, keys/invalidation/eviction/topology, select a database/CDN, configure Redis/Memcached, tune one cache or implement caching.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Permissions

    Read Files
    Write Files

    Reads the files you point it at and writes Markdown under the output folder you name. No network access, no environment variables, and no bundled scripts.

    Listed1 month ago

    What's inside

    Frequently Asked Questions

    No. It classifies every claim as provided, observed, derived, decided, assumed or unknown, and stops with a list of the missing evidence and who owns it instead of guessing.

    No. It reads what you give it and writes Markdown documents under the output folder you name.

    Any agent that supports SKILL.md skills, including Claude Code, Codex CLI, Cursor and Gemini CLI. It has no scripts and makes no network calls.

    Unzip it into your agent's skills folder, for example: unzip cache-selection.zip -d ~/.claude/skills/

    New in Data & Databases