blocky icon indicating copy to clipboard operation
blocky copied to clipboard

Redis rework

Open 0xERR0R opened this issue 2 years ago • 3 comments

  • [x] Implementation of GroupedCache to enable read access with multiple groups. (#944)
  • [x] Rewrite current logic to use rueidis
  • [ ] Redis implementation of GroupedCache (using rueidis)
  • [ ] Redis implementation of ExpirationCache (DNS response caching) (using rueidis)
  • [ ] Rework Prefetching (Redis & in-memory implementation)
  • [ ] if Redis enabled: execution of Jobs (e.g. List refresh, periodic metrics with lists count, prefetching, ...?) only on one instance, (using Redis lock with https://github.com/rueian/rueidis/tree/main/rueidislock)
  • [ ] If Redis enabled: synchronization of enabled/disabled (blocking) status via Redis.

0xERR0R avatar Mar 21 '23 16:03 0xERR0R

I picked this one up again since rueidis is stable now and I hadn't worked with it in a while.

I'm stuck with the unit tests(again). 😞 Most of the tests need to be rewritten since minredis don't support some features which rueidis neets.

I can't get my head around how to solve the requirements of the test setups with rueidismock.

I'm currently considering simply spinning up a test container with redis running alongside the tests...

kwitsch avatar Feb 10 '24 09:02 kwitsch

If we can cover all use cases with e2e tests, why not? Unit test can be helpful to test some edge cases, but if it needs much efford to mock the infrastructure, it is better to throw them away 😄

0xERR0R avatar Feb 10 '24 09:02 0xERR0R

I'll open a PR draft without the tests soon. Maybe I'm only missing something and it isn't that hard.

more eyes & more thoughts may help 😅

kwitsch avatar Feb 10 '24 09:02 kwitsch