Pagination with Redis sets vs sorted sets -


we storing users , friends (relationships) in redis sets. easy can't figure out how results when paginating. example: when showing logged in users's friends, need first 20 results, on following click, next 20 results, etc.. don't care order, provided don't repeated data following queries. prefer use sets vs sorted sets, sets lets use cheap sinter other queries. recommended aproach be? storing them both sets , sorted sets? sounds bit redundant.

you can paginate through set using sscan, note can return same result twice though. alternatively, sorted sets best kind of task. lastly, lists can work lrange expensive operation.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -