View on GitHub
Clean Architecture Toolkit for .NET
Clean Architecture Toolkit is a clean, modular architecture foundation for .NET applications.
It embraces SOLID principles and focuses on maintainability, testability, and scalability through clear boundaries and pluggable design.

|   HOME   |   MODULE OVERVIEW   |   DEMO   |

Plans for Cat.Caching

A caching decorator for queries.
Status: not started. This plan collects what we know. The open questions need an answer before the build.

Contents

The idea

Many reads ask the same question again and again. A book list, a category list. A decorator can answer from a cache and skip the database. The query handler stays as it is, because the decorator wraps it.

What we already know

From the module conventions:

From the demo plan:

From the architecture:

Decisions and open questions

Decided

Topic Decision
Place A decorator on query handlers.
First use The Catalog queries in the demo.

Open

Questions before building

  1. Which cache do you want as the default: memory, distributed or HybridCache?
  2. How should a query say it may be cached?
  3. Do commands invalidate the cache, or do we only use short lifetimes?
  4. How do we guarantee that per user results do not leak?
  5. Should failed responses ever be cached?
  6. Do we need to support several instances in the first version?
  7. Where in the decorator order does the cache sit, relative to logging and validation?
  8. Do we want hit and miss metrics from day one, and does that depend on Cat.Telemetry?
  9. Is there a query in the demo that we know is slow, or do we pick one to show the effect?
  10. Do we ever want to cache service requests, or only queries?