rfcmarques / beer-inventory

An inventory management system for my own collection of craft beer
0 stars 0 forks source link

Apply new cache and pagination strategy #13

Open rfcmarques opened 7 months ago

rfcmarques commented 7 months ago

Apply the following rules to query management regarding using cache or pagination

  1. Items & Beers: High Volatility and Heavy Load For Items and Beers, which are both volatile and heavily loaded, prioritize pagination for their listing views to manage the load effectively and ensure responsiveness. Pagination will help in handling the large datasets efficiently by loading only a subset of records at a time, improving user experience. Caching might still be beneficial for frequently accessed queries that don't change often, like aggregated statistics (e.g., total number of items, average price, etc.), or for caching the results of complex queries that are expensive to run multiple times but don't need to be real-time.

  2. Breweries & Styles: Lower Volatility, Variable Load For Breweries and Styles, which have lower volatility, you might use a combination of caching and pagination. Since these are less volatile but can still be somewhat heavy loaded, caching can significantly reduce the load on your database by storing and serving static or infrequently updated data. Pagination will ensure that the user interface remains responsive and manageable, even with relatively large datasets.

  3. Containers: Non-Volatile and Lightly Loaded For Containers, which are non-volatile and not heavily loaded, you can lean more towards caching the entire dataset. Since this data doesn't change often and the load is light, caching can provide fast access to this data without necessitating frequent database hits. This approach will ensure that accessing container data is quick and efficient, improving overall system performance.

rfcmarques commented 7 months ago

Take in consideration that installing a cache driver that enables the use of tags might be needed