P
💻DeveloppementAdvancedClaude

Design an Application Caching Strategy

Design a complete Redis caching strategy with appropriate patterns, TTL policy, invalidation, and stampede protection.

Paste in your AI

Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.

Tu es un architecte systèmes expert en stratégies de mise en cache et en optimisation des performances applicatives. Je dois mettre en place une stratégie de cache robuste pour mon application.

Contexte de l'application :

  • Type : [EX: API REST à fort trafic, application web B2C, plateforme de données]
  • Stack : [EX: Node.js + PostgreSQL, Python + MongoDB]
  • Solution de cache envisagée : [EX: Redis 7, Memcached, cache en mémoire]
  • Trafic actuel : [EX: 1000 requêtes/minute, pics à 5000]
  • Problème de performance : [EX: requêtes DB trop lentes, API tierce rate-limited, calculs coûteux]

Données candidates au cache :
[LISTER_LES_TYPES_DE_DONNÉES: ex. profils utilisateurs, résultats de recherche, configurations, sessions, tokens JWT révoqués]

Conçois une stratégie de cache complète :

  1. Analyse des données : classe chaque type de donnée par fréquence d'accès, taux de modification et coût de recalcul pour prioriser ce qui mérite d'être caché.
  2. Patterns de cache : recommande et implémente les patterns appropriés (Cache-Aside, Write-Through, Write-Behind, Read-Through) pour chaque cas d'usage.
  3. Politique d'expiration (TTL) : définis des TTL appropriés pour chaque type de donnée avec justification.
  4. Stratégie d'invalidation : comment invalider le cache lors des mises à jour des données (invalidation par clé, pattern, event-driven).
  5. Gestion des ratés de cache (Cache Miss) : protection contre le Cache Stampede (thundering herd) et le Cache Penetration.
  6. Cache distribué : considérations pour un environnement multi-instances (Redis Cluster, serialisation).
  7. Métriques : métriques à surveiller (hit rate, miss rate, memory usage, évictions) et seuils d'alerte.
100% found this useful

Personalize this prompt with Léa

Léa rewrites this prompt for your job and your exact goal — 3 quick questions.

Why this prompt works

<p>This prompt is structured to approach caching as a complete systems engineering problem. The initial analysis by access frequency and recomputation cost is the most important step: caching the wrong data (data that changes constantly or is rarely accessed) is worse than not caching at all because it adds complexity without benefit.</p><p>Protection against Cache Stampede (thundering herd) is often ignored until the first production incident: when a cache expires, all simultaneous requests hit the database at once, causing exactly the overload you were trying to avoid. This prompt forces anticipation of this scenario.</p><p>Requesting specific metrics with alert thresholds transforms the design into an observable system: a hit rate below 80% generally indicates a bad TTL policy or overly aggressive invalidation, metrics that allow continuous cache tuning in production.</p>

Use Cases

Performance optimization through cachingHigh-traffic system architectureReducing database costs

Expected Output

A complete caching strategy with data analysis, recommended patterns, TTL policy, invalidation strategy, and monitoring metrics.

Improve this prompt

Run this prompt through the Optimizer to strengthen its context, constraints and expected format.

Improve this prompt with the Optimizer

Comments

  • LéaAI

    Ajoute une section "Analyse des coûts de cache vs recalcul" pour justifier le TTL de chaque donnée en fonction de son volume et de son taux d'obsolescence acceptable. Cela évite de cacher des données rarement lues qui consomment inutilement de la mémoire.

📬 Get new prompts every week

Join our newsletter and never miss a prompt.

Go further

Similar Prompts

💻DeveloppementIntermediateAll AIs

Feature Flag Management

Progressive deployments with feature flags

0213
💻DeveloppementIntermediateAll AIs

Midjourney Prompt for Creating a Chatbot

Midjourney has become an essential tool for designing a chatbot's visual identity. Whether you're developing a virtual assistant for customer service, a conversational bot for your e-commerce site, or an AI companion for a mobile app, your chatbot's appearance plays a crucial role in user engagement. A well-designed avatar inspires trust, humanizes the interaction, and reinforces your brand image. With Midjourney, you can generate avatars, conversational interfaces, mascots, and UI visual elements without needing graphic design skills. The right prompts let you create visuals consistent with your brand guidelines, from accessible cartoon styles to clean corporate designs. In this guide, you'll find optimized prompts to generate all the visual assets your chatbot needs: main avatar, emotion variations, stylized speech bubbles, and welcome screens. Each prompt has been tested and refined to produce professional results you can use directly in your development projects.

0238
💻DeveloppementAdvancedClaude

Configure a CI/CD Pipeline with GitHub Actions

Configure a professional CI/CD pipeline with GitHub Actions covering tests, security, Docker build, and multi-environment deployment.

45512
💻DeveloppementBeginnerAll AIs

Encryption at rest and in transit

Securing data at rest and in transit

0229