davechallis / ocypod

Ocypod is a Redis-backed service for orchestrating background jobs. Clients/workers can be written in any language, using HTTP/JSON to queue/fetch jobs, store results, etc.
Apache License 2.0
194 stars 14 forks source link

Adding configurable namespace for redis keys #22

Closed joe-at-startupmedia closed 2 years ago

joe-at-startupmedia commented 2 years ago

All of the keys are specific in the keys file: https://github.com/davechallis/ocypod/blob/master/src/application/keys.rs

The issue is that for redis servers which are used by multiple applications, the designated key names could possibly clash with a keys used by other applications with something as generic as failed etc. One solution is to allow this value to be configurable and used in the keys.rs to build the key name. e.g. default ocypod:failed versus failed. This also makes it easier to scan for keys only belonging to the ocypod application.

davechallis commented 2 years ago

Sounds like a good idea to me. I'll probably add a configuration option to set the namespace, but leave it as blank (i.e. no namespace, same as now) if not specified, just to avoid breaking backwards compatibility with existing setups if people upgrade.

I'd probably change this default in future to e.g. ocypod:failed as you suggested next major release though, since there are some other breaking changes that I'd like to add too.