feat(backend): add Redis cache layer#12
Conversation
Define CacheService port in usecase/, implement with go-redis in infrastructure/cache/redis/, and bootstrap with optional REDIS_URL env var — probed with the same retry logic as Postgres, closed on graceful shutdown.
|
Warning Review limit reached
More reviews will be available in 29 minutes and 23 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
CacheServiceport interface ininternal/usecase/— the correct Clean Architecture home for interfaces the use case layer depends oninternal/infrastructure/cache/redis/usinggo-redis/v9REDIS_URLenv var — optional, probed with the same jittered-retry logic as Postgres, and closed on graceful shutdownArchitecture note
Stays faithful to Uncle Bob's Clean Architecture:
domain(entities) andusecase(application logic + port interfaces) remain distinct layers. The hexagonalapplication/portsconvention was considered and rejected in favour of this approach.Test plan
REDIS_URLin.envand runmake watch— confirm bootstrap logsservice readyfor both postgres and redisREDIS_URLempty — confirm server starts normally without Redismake test— existing tests still pass