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

Use lists to store arrays in Redis #2

Open
evanp opened this issue Jul 31, 2012 · 1 comment
Open

Use lists to store arrays in Redis #2

evanp opened this issue Jul 31, 2012 · 1 comment

Comments

@evanp
Copy link
Member

evanp commented Jul 31, 2012

For Redis, we should probably store Javascript arrays as Redis lists.

This will make our append() and prepend() methods atomic and just damn better.

However, it'll make other access pretty crummy. There don't seem to be give-me-the-whole-list methods in Redis lists, see:

http://redis.io/commands#list

Might not be worth it.

Copied from https://github.com/evanp/databank/issues/17

@Kelym
Copy link

Kelym commented Jun 25, 2014

List (linked list) in redis provide fast access on head and tail, but it can be too slow to access the middle. Though theoretically a linked list can provide a fast iteration through the whole list, redis doesn't seem to provide this kind or method. So, it seems more practical to use sorted set to store arrays ( one array[]=XX actually has two properties: value + order.) .

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

No branches or pull requests

2 participants