Home Set data type
Post
Cancel

Set data type

When to use

  • Enforce uniqueness of elements
  • Creating relationship between other entity
    Benefits from set example

  • Common elements between other entity
    Benefits from set example2
  • Guarantee operation idempotence
  • Order of elements doesn’t matter.
    ex) ip black list.

Tips

Why do we need store operation?

  • SINTERSTORE
  • SDIFFSTORE
  • SUNIONSTORE

Reduce the number of execution those operation.
Those operations’ cost is expensive.

This post is licensed under CC BY 4.0 by the author.

Which data is to be cached

Redis sorted set

Trending Tags