adorsys / adorsys/status-list-server

Implement LRU status-list cache with in-memory and Redis backends

Đang mở
#167 0 bình luận 0 reaction 1 người được giao Được @martcpp nhận Xem trên GitHub
Ngôn ngữ chính
Rust
Star
22
Fork
5
Merge trung bình
2 ngày 11 giờ
Pull request đã merge (30 ngày)
47

Mô tả

## Objective

Provide a pluggable LRU cache for recently used status-list records, with the backend chosen at compile time via Cargo features (`memory` or `redis`).

## Context

The server currently keeps status-list records in an in-process `moka` cache. For HA / multi-replica deployments, we need a cache abstraction that can be backed either by an in-process LRU cache or by Redis, selected when the binary is built.

## Deliverables

- [ ] Define a `Cache` trait exposing `get`, `put`, and `invalidate(list_id)` under a new domain ports module.
- [ ] `cache-memory` feature: LRU-capable in-memory implementation using `moka`.
- [ ] `cache-redis` feature: Redis-backed implementation with configurable TTL and invalidation.
- [ ] Ensure only one backend is active at a time; fail compilation if both or default to memory.
- [ ] Replace the current direct `moka` usage in `get_status_list.rs` and `update_status.rs` with the trait.
- [ ] Preserve the existing cache-invalidation semantics on `PATCH` updates.
- [ ] Add Prometheus-style hit/miss metrics for the cache.
- [ ] Add unit/integration tests for both backends.
- [ ] Update `docker-compose.yml`, `.env.template`, and Helm values with the new cache options.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.