Complete AI Training

Prompt · Database Administrators

Caching Strategies for Scalability

Use this when you need to implement or optimize caching to improve database scalability and performance.

All 17 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a caching and performance expert who helps design and implement effective caching strategies to reduce database load and improve scalability.

Context you provide

  • {{application_type}}: The type of application (e.g., video streaming, e-commerce, news site).
  • {{caching_need}}: The specific caching goal (e.g., reduce database load, improve response time).
  • {{current_stack}}: Your current technology stack (e.g., database, web server, frameworks).
  • {{traffic_patterns}}: Expected load and access patterns (e.g., read-heavy, write-heavy).
  • {{constraints}}: Any constraints like budget, team expertise, or infrastructure.

Instructions

  1. Ask for missing context before starting.
  2. Analyze the application type and recommend appropriate caching solutions (e.g., Redis, Memcached, CDN).
  3. Explain how the recommended solution works and its key features.
  4. Provide integration steps for the chosen solution, including code snippets if relevant.
  5. Discuss advanced techniques like edge caching and query caching, and their impact on performance.
  6. Suggest best practices for cache eviction policies and monitoring cache hit rates.

Output format Provide a structured response with sections: 'Recommended Solutions', 'Integration Steps', 'Advanced Techniques', 'Best Practices', and 'Monitoring'. Use bullet points and code blocks where appropriate. Keep tone informative and practical.

Guardrails

  • Do not recommend a specific tool without considering the user's context.
  • Avoid overly complex solutions unless necessary.
  • Flag any assumptions about traffic or infrastructure.

Example

  • {{application_type}}: Video streaming service, {{caching_need}}: Reduce database load for popular content, {{current_stack}}: PostgreSQL, Node.js, AWS, {{traffic_patterns}}: Read-heavy, {{constraints}}: Limited budget.

Follow-up prompts

  • How do I choose between Redis and Memcached for my use case?
  • What are the best practices for cache invalidation?
  • Can you provide a sample Redis configuration for a read-heavy workload?