Skip to content

Conversation

@justindbaur
Copy link
Member

🎟️ Tracking

📔 Objective

Adds a ADR about adopting FusionCache for all our caching needs, this is a little retrospective as we've already started down the road of using it in server but this documents the reasons it was chose and why it was chose over alternatives.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@justindbaur justindbaur requested review from a team as code owners December 2, 2025 19:52
@github-actions github-actions bot added the adr label Dec 2, 2025
@claude
Copy link

claude bot commented Dec 2, 2025

Claude finished @justindbaur's task —— View job


Review Complete ✓

I've completed a comprehensive review of this ADR document. Here are my findings:

Overall Assessment

✓ Ready to merge - This ADR is well-structured, complete, and has successfully addressed all previous review feedback.


What's Been Addressed

All feedback from previous reviews has been properly incorporated:

  1. Status updated - Changed from "Proposed" to "Accepted" as requested (docs/architecture/adr/0028-adopt-fusion-cache.md:3)
  2. Timeline removed - Removed the "Q1 2026" date commitment from the plan section
  3. Formatting consistency - All option titles now use backticks consistently: HybridCache, FusionCache, etc.
  4. Metrics documentation - Added to the plan: "Configure and document how to view caches hits and misses for your FusionCache usages" (line 139)
  5. Custom words - "backplane" properly added to custom-words.txt

Style Guide Compliance

✓ Excellent adherence to repository documentation standards:

  • Proper ADR frontmatter with all required fields (adr, status, date, tags)
  • Correct heading capitalization (first word capitalized, following words lowercase)
  • Code blocks properly formatted with syntax highlighting
  • No inline code for commands
  • All technical terms spelled correctly
  • Proper use of <AdrTable> component

Content Quality

Strengths:

  1. Clear problem definition - Effectively describes the fragmented caching approaches in the server codebase and the critical missing metrics (docs/architecture/adr/0028-adopt-fusion-cache.md:12-30)

  2. Comprehensive option analysis - Five alternatives considered with balanced pros/cons:

    • Continue implementing custom caching solutions
    • Adopt HybridCache
    • Adopt FusionCache
    • Adopt FusionCache as HybridCache
    • Implement other third-party libraries
  3. Thorough technical justification - Clearly explains why FusionCache was chosen over Microsoft's HybridCache (backplane extensibility for L1 cache synchronization)

  4. Practical implementation plan - Includes both "Today" and "In the near future" sections with concrete examples, including a JSON configuration sample (lines 154-168)

  5. Well-researched alternatives - Evaluates other third-party options (CacheManager, LazyCache, CacheTower) with specific reasons for rejection


Structure Completeness

✓ All required ADR sections present:

  • Context and problem statement
  • Considered options (with detailed subsections)
  • Decision outcome
  • Positive consequences (4 benefits listed)
  • Negative consequences (1 realistic concern)
  • Plan (with actionable implementation steps)

Technical Accuracy

✓ Correctly explains:

  • L1 (in-memory) and L2 (distributed) cache layers
  • Cache stampede protection
  • Backplane synchronization for multi-node environments
  • DI (Dependency Injection) patterns
  • AOT (Ahead-of-Time) compilation concerns

Reference Quality

✓ All 6 reference links properly formatted:

  • Microsoft HybridCache documentation
  • FusionCache GitHub repository
  • Server codebase AddExtendedCache reference
  • Alternative library references (CacheManager, LazyCache, CacheTower)

Minor Observations

No blocking issues, but a couple of optional enhancements for future consideration:

  1. The plan section could potentially benefit from success metrics or acceptance criteria for migrations, though this may be tracked in project management tools

  2. Line 78 mentions "Memory cache node synchronization mechanism" - this is the backplane feature, which is mentioned elsewhere but could be explicitly stated here for added clarity

These are purely optional suggestions and don't impact the quality or completeness of the ADR.


Comparison with Existing ADRs

This ADR maintains consistency with other ADRs in the repository (e.g., ADR-0024, ADR-0026) in terms of:

  • Depth of analysis
  • Balance of technical detail
  • Practical migration considerations
  • Clear rationale with realistic trade-offs

Final Recommendation

👍 Approve and merge - This document successfully:

  • Follows all repository guidelines
  • Provides comprehensive technical justification
  • Addresses all reviewer feedback
  • Includes a clear implementation path
  • Maintains high documentation quality standards

The ADR effectively documents why FusionCache was chosen for Bitwarden's caching needs and provides a practical roadmap for adoption across the server codebase.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

Logo
Checkmarx One – Scan Summary & Details1b9d26f9-58d4-4094-86b9-e9bf157db48c

New Issues (1)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
HIGH CVE-2025-66031 Npm-node-forge-1.3.1
detailsRecommended version: 1.3.2
Description: Forge (also called `node-forge`) is a native implementation of Transport Layer Security in JavaScript. An Uncontrolled Recursion vulnerability in n...
Attack Vector: NETWORK
Attack Complexity: LOW

ID: Cf%2BLjPIcYWOhmz%2FEMwexhD2MzoM%2FL455mjkbCp1HMiQ%3D
Vulnerable Package

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 2, 2025

Deploying contributing-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: f55cd44
Status: ✅  Deploy successful!
Preview URL: https://0e9473fb.contributing-docs.pages.dev
Branch Preview URL: https://fusion-cache-adr.contributing-docs.pages.dev

View logs

Copy link
Contributor

@withinfocus withinfocus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bunch of little ⛏️s but reads well and explains the cache rationale.


- New features desiring cache should use `IFusionCache`
- Finish up Caching package in server SDK (Target: Q1 2026)
- Individual migration plans for existing cache uses
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 What do we think about a Claude Skill created to help create a migration plan for each scenario it finds in our code base? Maybe the skill could even create the Jira story with suggested code change 🤯


- Could make caching too easy to use when caching isn't the right solution all the time

### Implementation plan
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 We mentioned telemetry/monitoring our cache as a motivating factor for the project but we do not mention it as part of our implementation plan. I think that if it is important enough to be mentioned in the problem statement then it would also be found as part of the implementation plan.

Co-authored-by: Matt Bishop <matt@withinfocus.com>
Copy link
Contributor

@withinfocus withinfocus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be in sync, the latest Claude comment pretty much sums up what's still desired -- the high and medium priority items.

@justindbaur
Copy link
Member Author

@withinfocus Should be all set other than the status one, should we roll this with Accepted already or leave it as Proposed?

Copy link
Contributor

@withinfocus withinfocus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple small things from the last commit, and yeah let's move this to Accepted as we have already discussed these options.

### Plan

- New features desiring cache should use `IFusionCache`
- Finish up Caching package in server SDK (Target: Q1 2026)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎨 Let's remove any date commitments from this sort of document.

- If only `IDistributedCache` is needed memory cache and backplane can be turned off
- If no `IDistributedCache` is needed it can be turned off and only memory and the backplane will
be used.
- Configure and document how to view caches hits and misses for your fusion cache uses
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Configure and document how to view caches hits and misses for your fusion cache uses
- Configure and document how to view caches hits and misses for your `IFusionCache` usages

@@ -0,0 +1,177 @@
---
adr: "0028"
status: Proposed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
status: Proposed
status: Accepted

Co-authored-by: Matt Bishop <matt@withinfocus.com>
@justindbaur justindbaur merged commit 7682557 into main Dec 4, 2025
17 checks passed
@justindbaur justindbaur deleted the fusion-cache-adr branch December 4, 2025 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants