Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Improvement - Use Redis As The Unique Queue For Cronjob To Populate Index #6

Open
@skyhit

Description

@skyhit

I would like to improve the service to use Redis as a unique queue for cronjob to populate index.

the refactoring will be like

  1. the Redis support duplication detection and working as a unique queue, so we will just need to update once if in the different periods, the same challenge or match need to update, see https://redis.io/commands/sadd and https://redis.io/commands/spop
  2. the endpoints will push the challenge id or match id into Redis as a candidate to aggregate data and populate the index
  3. there are cronjobs which will run periodically to find the changed challenge ids and match ids.
  4. there will be running threads, which will monitoring Redis to pop challenge ids and match ids and do the real aggregation and populate into index.
  5. so for initial load, we can have endpoints to do this purposely any time, just load every challenge ids and match ids and add into the Redis set (the running threads) will take care of that.

the current architecture, we need to adjust the environment variables, in order to do the initial load

@sushilshinde @ajefts Let me know your thought about this approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions