Skip to content

feat(backend): add Redis cache layer#12

Merged
GRACENOBLE merged 1 commit into
mainfrom
backend.cache
Jun 14, 2026
Merged

feat(backend): add Redis cache layer#12
GRACENOBLE merged 1 commit into
mainfrom
backend.cache

Conversation

@GRACENOBLE

@GRACENOBLE GRACENOBLE commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Defines CacheService port interface in internal/usecase/ — the correct Clean Architecture home for interfaces the use case layer depends on
  • Implements it in internal/infrastructure/cache/redis/ using go-redis/v9
  • Bootstraps Redis via REDIS_URL env var — optional, probed with the same jittered-retry logic as Postgres, and closed on graceful shutdown

Architecture note

Stays faithful to Uncle Bob's Clean Architecture: domain (entities) and usecase (application logic + port interfaces) remain distinct layers. The hexagonal application/ports convention was considered and rejected in favour of this approach.

Test plan

  • Set REDIS_URL in .env and run make watch — confirm bootstrap logs service ready for both postgres and redis
  • Leave REDIS_URL empty — confirm server starts normally without Redis
  • Run make test — existing tests still pass

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.
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@GRACENOBLE, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6f1274dc-1031-44c5-b046-5ef8e1a4bb9f

📥 Commits

Reviewing files that changed from the base of the PR and between f97b3d1 and 1e00cc2.

⛔ Files ignored due to path filters (1)
  • backend/go.sum is excluded by !**/*.sum
📒 Files selected for processing (6)
  • backend/.env.example
  • backend/cmd/api/main.go
  • backend/go.mod
  • backend/internal/bootstrap/bootstrap.go
  • backend/internal/infrastructure/cache/redis/cache.go
  • backend/internal/usecase/cache.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backend.cache

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added area: backend Go REST API type: chore Cleanup or maintenance tasks labels Jun 14, 2026
@GRACENOBLE GRACENOBLE merged commit 63e827d into main Jun 14, 2026
2 checks passed
@GRACENOBLE GRACENOBLE deleted the backend.cache branch June 14, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: backend Go REST API type: chore Cleanup or maintenance tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant