Java-Interview-Advanced/docs/distributed-system/zookeeper-distribute-lock-s...

12 lines
592 B
Markdown
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Redis和ZooKeeper哪种分布式锁更好
从分布式系统协调语义而言是ZooKeeper做分布式锁更好一些因为Redis本身其实是缓存但是Redis能抗高并发高并发场景下更好一些
zookeeper本身不适合部署大规模集群他本身适用的场景就是部署三五台机器不是承载高并发请求的仅仅是用作分布式系统的协调的
RedisZooKeeper
有redis集群没有zookeeper集群那你当然就选择redis了如果你们公司两个都有用哪种分布式锁都可以高并发场景redis