当前位置:网站首页>Distributed ID solution
Distributed ID solution
2022-07-07 06:50:00 【Knock the little crisp of the code】
Distributed id problem
It's mainly the problems caused by sub database and sub table . After the same business data table , Also ensure the data of different tables id only . Otherwise, business data of the same type , Data taken out id It's all the same , How to distinguish these data ?
Solution
Snowflake algorithm :
Unique generated based on timestamp and machine code id. Basic guarantee id Increasing . But when the server time calls back , There may be duplication id.
In response to this question , Baidu UIDGenerator With meituan Leaf Provides a solution , For business scenarios with high requirements , These two solutions can be used .
UUID
It's guaranteed to be unique , But it wastes too much performance .
redis&&Zookeeper
utilize redis or zookeeper Self increasing characteristics of
summary
The most recommended is the snowflake Algorithm . If not sensitive to time callback , Use the snowflake algorithm
边栏推荐
- String (explanation)
- ViewModelProvider.of 过时方法解决
- FPGA课程:JESD204B的应用场景(干货分享)
- Redhat5 installing vmware tools under virtual machine
- Stack and queue-p79-10 [2014 unified examination real question]
- 企業如何進行數據治理?分享數據治理4個方面的經驗總結
- DB2获取表信息异常:Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][4.25.13]
- 根据IP获取地市
- dolphinscheduler3. X local startup
- 线性代数(一)
猜你喜欢
随机推荐
DB2获取表信息异常:Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][4.25.13]
Pinduoduo lost the lawsuit: "bargain for free" infringed the right to know but did not constitute fraud, and was sentenced to pay 400 yuan
二十岁的我4面拿到字节跳动offer,至今不敢相信
地质学类比较有名的外文期刊有哪些?
Tkinter window selects PCD file and displays point cloud (open3d)
大促过后,销量与流量兼具,是否真的高枕无忧?
UIC (configuration UI Engineering) public file library adds 7 industry materials
dolphinscheduler3.x本地启动
ceres-solver和g2o性能比较
【luogu P1971】兔兔与蛋蛋游戏(二分图博弈)
分布式id解决方案
MATLAB小技巧(30)非线性拟合 lsqcurefit
线性代数(一)
The difference between string constants and string objects when allocating memory
使用net core优势/为什么使用
MySQL SQL的完整处理流程
偏执的非合格公司
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书
途家、木鸟、美团……民宿暑期战事将起
企業如何進行數據治理?分享數據治理4個方面的經驗總結