Skip to content
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

Refactor RedisItemWriter and RedisItemReader logic #4651

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

suzzingV
Copy link

Hello,

I believe there might be a better way to implement the RedisItemReader and RedisItemWriter. Currently, the RedisItemReader stores the Redis data's value in the chunk. The RedisItemWriter then uses an ItemKeyMapper to derive the key from this value and executes the writeKeyValue function with the key and value.

However, I find it quite cumbersome to implement an ItemKeyMapper that derives the key from the value. In a key-value structure, retrieving the key based on the value seems to underutilize the key-value paradigm.

When I was setting up a batch job to delete specific Redis data, I found it inefficient to implement an ItemKeyMapper that derives the key from the value, so I customized the code accordingly. Instead, I implemented the ItemKeyMapper to return the value when given a key.

Therefore, I believe it would be more efficient for the RedisItemReader to store the Redis data's keys in the chunk. If my suggestion is not accepted, I would be very interested in understanding the reasoning behind that decision.

Thank you for considering my suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant