Imagine a fusion of ‘Eskom se Push’ and ‘X’. The Republic allows users to raise concerns and spread awareness about government services through incident reports, with cool data visualizations providing a dynamic overview of public sentiment on service delivery.
Implement Redis caching in our backend to improve performance, reduce database load, and enhance overall application responsiveness.
Background
Our current backend architecture directly queries the database for each request, leading to increased response times and unnecessary load on our database, especially for frequently accessed data. Implementing a caching layer will help mitigate these issues.
Tasks
[x] Set up Redis
[x] Install and configure Redis
[x] Create a Redis client for our application
[x] Implement caching middleware
[x] Develop a middleware to handle caching for read operations
[x] Ensure proper cache key generation to avoid conflicts
[x] Create cache utilities
[x] Implement functions to clear specific cache entries
[x] Implement functions to clear cache patterns
[x] Integrate cache clearing in write operations
[x] Update controllers
[x] Modify existing controllers to use caching for read operations
[x] Implement cache clearing for write operations
[x] Implement error handling and fallback
[x] Ensure graceful degradation if Redis is unavailable
[x] Implement proper error logging for Redis-related issues
[x] Conduct performance testing
[x] Measure response times before and after caching implementation
[x] Compare database load before and after caching implementation
Objective
Implement Redis caching in our backend to improve performance, reduce database load, and enhance overall application responsiveness.
Background
Our current backend architecture directly queries the database for each request, leading to increased response times and unnecessary load on our database, especially for frequently accessed data. Implementing a caching layer will help mitigate these issues.
Tasks
[x] Set up Redis
[x] Implement caching middleware
[x] Create cache utilities
[x] Update controllers
[x] Implement error handling and fallback
[x] Conduct performance testing