V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ooToo
V2EX  ›  程序员

AtomicLong 有什么好的分布式实现方式吗? 优缺点是?

  •  
  •   ooToo · 2020-03-05 09:32:42 +08:00 · 1534 次点击
    这是一个创建于 1505 天前的主题,其中的信息可能已经有所发展或是发生改变。
    5 条回复    2020-03-05 23:04:14 +08:00
    qwerthhusn
        1
    qwerthhusn  
       2020-03-05 09:38:04 +08:00
    Redis 的 INCR
    ooToo
        2
    ooToo  
    OP
       2020-03-05 09:59:54 +08:00
    @qwerthhusn 嗯, 这个知道. 那如果从面试造火箭的角度呢?😂
    yannxia
        3
    yannxia  
       2020-03-05 10:02:54 +08:00
    大致上都差不多吧,1. 依赖中间件,Leaf,Redis 之类的。2. 不依赖中间件:snowflake
    yannxia
        4
    yannxia  
       2020-03-05 10:03:20 +08:00
    补充下:严格单调递增只能依赖中间件
    jelipo
        5
    jelipo  
       2020-03-05 23:04:14 +08:00
    能实现分布式锁的中间件都可以
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   963 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 21:15 · PVG 05:15 · LAX 14:15 · JFK 17:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.