I have a redis database, and client for it, written in Ruby. What is the size of this database?
def follow!(user)
$redis.multi do
$redis.sadd(self.redis_key(:following), user.id)
$redis.sadd(user.redis_key(:followers), self.id)
end
end
def redis_key(str)
"user:#{self.id}:#{str}"
end
# Usage:
userA.follow!(userB)
I think that it is 2N, but someone tell me that it is N^2, what is true?