当前位置:网站首页>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
边栏推荐
猜你喜欢

POI导出Excel:设置字体、颜色、行高自适应、列宽自适应、锁住单元格、合并单元格...
![[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)](/img/77/bd80ed602208be6a9ef8be60c6ad06.png)
[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)

Several index utilization of joint index ABC

一文带你了解静态路由的特点、目的及配置基本功能示例

软件测试到了35岁,真的就干不动了吗?

品牌·咨询标准化

Apache ab 压力测试

HKUST & MsrA new research: on image to image conversion, fine tuning is all you need

2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书
![[GNN] graphic gnn:a gender Introduction (including video)](/img/b3/0855885dafa7afaa7375b8d2195974.png)
[GNN] graphic gnn:a gender Introduction (including video)
随机推荐
Stack and queue-p78-8 [2011 unified examination true question]
What are the classic database questions in the interview?
MySQL卸载文档-Windows版
What books can greatly improve programming ideas and abilities?
【从零开始】win10系统部署Yolov5详细过程(CPU,无GPU)
屏幕程序用串口无法调试情况
JWT 认证
项目实战 五 拟合直线 获得中线
学习笔记|数据小白使用DataEase制作数据大屏
品牌·咨询标准化
C language interview to write a function to find the first public string in two strings
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]
Comment les entreprises gèrent - elles les données? Partager les leçons tirées des quatre aspects de la gouvernance des données
Pinduoduo lost the lawsuit: "bargain for free" infringed the right to know but did not constitute fraud, and was sentenced to pay 400 yuan
How to solve sqlstate[hy000]: General error: 1364 field 'xxxxx' doesn't have a default value error
mobx 知识点集合案例(快速入门)
如何给目标机器人建模并仿真【数学/控制意义】
偏执的非合格公司
sqlserver多线程查询问题
健身房如何提高竞争力?