Skip to content

Separate Caching Redis from Webhooks Redis #3282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cimnine opened this issue Jun 21, 2019 · 1 comment
Closed

Separate Caching Redis from Webhooks Redis #3282

cimnine opened this issue Jun 21, 2019 · 1 comment
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Milestone

Comments

@cimnine
Copy link
Contributor

cimnine commented Jun 21, 2019

Environment

  • Python version: 3.6
  • NetBox version: 2.6

Proposed Functionality

Having the ability to configure a separate Redis connection for the caching purpose and one for the webhooks delivery purpose.

Use Case

The Redis required for caching has different requirements regarding data persistency than the Redis for delivering webhooks.

While it doesn't matter for the caching Redis if the data is lost, I would try to avoid data loss for the webhooks Redis.

They also have two different access patterns: One is only ever accessed by one client, i.e. my Netbox instance, while the other is accessed by potentially many clients, i.e. at least one Netbox instance and at least one webhook worker.

And in a container-world this matters: The caching Redis would be an instance that is deployed as a sidecar to the Netbox instance, i.e. in the same pod. The webhooks Redis is a shared instance and would therefore be deployed on it's own, potentially with slaves for redundancy purposes, and definitely have some kind of persistent storage attached.

Therefore it would be nice if I could configure two Redis instances in Netbox, one for caching and one for delivering webhook invocations.

Database Changes

Not necessary

External Dependencies

None

@lampwins
Copy link
Contributor

I could see us mimicking the Django DATABASE dict in which several configurations can be defined.

Something like:

REDIS = {
    'webhooks': {
        ...
    },
    'caching': {
        ...
    }
}

The actual connection logic is already duplicated in that we open separate connections for cacheops and rq, so that won't require any additional overhead.

@lampwins lampwins added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application labels Jun 21, 2019
@lampwins lampwins added this to the v2.7 milestone Aug 7, 2019
@jeremystretch jeremystretch changed the title Seperate Caching Redis from Webhooks Redis Separate Caching Redis from Webhooks Redis Oct 17, 2019
jeremystretch added a commit that referenced this issue Oct 17, 2019
…nfig

implements #3282 - seperate webhooks and caching redis configs
@lock lock bot locked as resolved and limited conversation to collaborators Jan 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

3 participants