Skip to content

Documenting cache backends#90

Merged
ksysoev merged 2 commits into
mainfrom
cache_backends
Jun 29, 2026
Merged

Documenting cache backends#90
ksysoev merged 2 commits into
mainfrom
cache_backends

Conversation

@ksysoev

@ksysoev ksysoev commented Jun 29, 2026

Copy link
Copy Markdown
Owner

This pull request improves the documentation and code comments for the layered and memcache backends, clarifying their behavior, caveats, and consistency guarantees. The changes provide a new backend comparison table in the README.md, add detailed explanations of each backend's semantics, and enhance inline comments for maintainability and onboarding.

Documentation improvements:

  • Added a comprehensive backend comparison table and detailed sections to README.md, explaining TTL support, persistence, interoperability, and tradeoffs for each backend, as well as specific caveats for memcache and layered backends.

Layered backend clarifications:

  • Updated comments in storage/layered/layered.go to clarify that operations are sequential (not transactional), partial failures are possible, and consistency is best effort/eventual. Also explained read, write, and delete semantics in detail. [1] [2] [3] [4] [5]

Memcache backend clarifications:

  • Expanded comments in storage/memcache/memcache.go to document that values are always stored as protobuf envelopes (not raw bytes), explain TTL handling and interoperability caveats, and describe the rationale behind value encoding/decoding. [1] [2] [3] [4] [5] [6]

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request improves developer-facing documentation for the memcache and layered storage backends (and adds a README comparison table) to make their TTL semantics, value formats, and cross-layer failure/consistency behavior explicit for users and maintainers.

Changes:

  • Added a backend comparison table and expanded backend-specific caveats/semantics sections in README.md.
  • Clarified storage/memcache’s protobuf envelope storage format and TTL constraints in code comments.
  • Clarified storage/layered’s sequential/non-transactional behavior, partial failure modes, and back-population error semantics in code comments.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
README.md Adds a backend comparison table plus detailed caveats for memcache and semantics/failure modes for layered.
storage/memcache/memcache.go Documents protobuf value-envelope encoding and TTL constraints/behavior used by GetWithTTL.
storage/layered/layered.go Documents sequential cross-layer operations, partial-apply behavior, and back-population error semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ksysoev ksysoev merged commit fed8f69 into main Jun 29, 2026
1 check passed
@ksysoev ksysoev deleted the cache_backends branch June 29, 2026 14:42
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.22%. Comparing base (203c8b2) to head (3c7ca09).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #90   +/-   ##
=======================================
  Coverage   88.22%   88.22%           
=======================================
  Files           9        9           
  Lines         501      501           
=======================================
  Hits          442      442           
  Misses         34       34           
  Partials       25       25           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document backend tradeoffs and storage-specific semantics for Redis, Memcache, Badger, InMemory, and Layered

2 participants