0

What is the best approach to load CSV with example:

id1,mike,123 id1,joe,234 id2,ben,235 id2,jack,445

The need is to query based on a first column (key) but there are keys that are repeating...

1 Answer 1

1

I recommend you to use HASHES because you're trying to do an object representation. According to best practices, you should use it every time it is possible; the key would be your first column and the value would be the repeating lines.

If you want more information about Redis data types, you can go on: https://redis.io/topics/data-types

Also this link is very useful for optimizing Redis: https://redis.io/topics/memory-optimization

From the memory optimization page:

Use hashes when possible

Small hashes are encoded in a very small space, so you should try representing your data using hashes every time it is possible

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.