Skip to content

Improve efficiency using redis #42

@t-persson

Description

@t-persson

Description

Investigate the use of Redis as a cache and warm storage for the API.

The idea is that the storage component attempts to write to Redis instead of MongoDB with a TTL (remove the event after a while).
In Redis there is a LUA script or something else which will replicate this DB write over to MongoDB for cold storage.

When getting an event via the GraphQL API, request Redis. Redis will return if it exists, else it will run a LUA script or something else which will get the response from MongoDB instead (cold storage)

This will cache more common requests into warm storage, it will increase efficiency on "new" events and will keep data in cold storage for long term traceability.

Motivation

Efficiency on recent events and more common requests without the loss of long term traceability

Exemplification

When there are a lot of events, the databases will start to slow down but we don't want to clean up data as this means a loss of historical traceability.
The idea is that we have a warm storage of newly received events for immediate use in the CI/CD pipeline and a cold storage of events that are required after a long while.

Benefits

Speed and a strategy for long-term storage of events.

Possible Drawbacks

Another layer of complexity with Redis as well as locking this project to use Redis.

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