I don't want to say that this is what ZSETs are made for, but redis has this on lock.