Skip to content

Optimize 'Leaderboard' query with caching #438

@gabito1451

Description

@gabito1451

Context

Gamification without slowdown.

Problem

Leaderboard scans 'Total Investments' across the whole DB on every hit.

Suggested Execution

  • Implement a 'TopInvestors' cache in Redis.
  • Updates only every 1 hour or when a massive investment occurs.

Acceptance Criteria

  • Scalable leaderboard for millions of users.
  • Instant response time.

References

  • backend/src/reputation/leaderboard.service.ts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions