Skip to content

Redis-backed AccountProfile repository for velocity counters #23

Description

@Teboho66

Description

AccountProfile stores velocity counters (transactions per 1hr/6hr/24hr)
that must be updated atomically and queried in sub-millisecond time. This
issue replaces InMemoryAccountProfileRepository with a Redis-backed
implementation.

Tasks

  • Install redis-py
  • Create repositories/redis/redis_account_profile_repository.py
  • Implement save() using Redis HSET
  • Implement update_velocity() using Redis INCR (atomic — BR-AP2)
  • Implement find_by_id() using Redis HGET
  • Register REDIS as a new storage type in RepositoryFactory
  • Write integration tests (requires Redis running via Docker)

Acceptance Criteria

  • RepositoryFactory.get("AccountProfile", "REDIS") returns Redis impl
  • Velocity counters increment atomically under concurrent load
  • All existing A11 tests still pass with in-memory backend

Metadata

Metadata

Assignees

Projects

Status
Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions