Ash
Ash

Reputation: 21

Do we need to acquire distributed lock when we generate sequence id using redisson RAtomicLong?

Do we need to acquire distributed lock when we generate sequence id using redisson RAtomicLong? We are using redis cluster setup and to avoid same id being generated twice in case of failover of a clsuter node should we acquire lock?

Upvotes: 0

Views: 61

Answers (1)

Nikita Koksharov
Nikita Koksharov

Reputation: 10783

No, you don't since it's generated atomically.

Upvotes: 0

Related Questions