当前位置:网站首页>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
边栏推荐
- 【从零开始】win10系统部署Yolov5详细过程(CPU,无GPU)
- MySQL卸载文档-Windows版
- 哈趣投影黑馬之姿,僅用半年强勢突圍千元投影儀市場!
- 7天零基础能考证HCIA吗?华为认证系统学习路线分享
- Installing redis and windows extension method under win system
- js装饰器@decorator学习笔记
- How to install swoole under window
- FPGA课程:JESD204B的应用场景(干货分享)
- Data of all class a scenic spots in China in 2022 (13604)
- MySQL(十)
猜你喜欢

学习笔记|数据小白使用DataEase制作数据大屏

网络基础 —— 报头、封装和解包

线性代数(一)

剑指offer-高质量的代码

品牌电商如何逆势增长?在这里预见未来!

Comment les entreprises gèrent - elles les données? Partager les leçons tirées des quatre aspects de la gouvernance des données

Force deduction 62 different paths (the number of all paths from the upper left to the lower right of the matrix) (dynamic planning)

场馆怎么做体育培训?

反射(二)

MySQL的安装
随机推荐
mobx 知识点集合案例(快速入门)
多学科融合
[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)
健身房如何提高竞争力?
Installing redis and windows extension method under win system
Pinduoduo lost the lawsuit: "bargain for free" infringed the right to know but did not constitute fraud, and was sentenced to pay 400 yuan
2022/07/04学习记录
MySQL的安装
LM11丨重构K线构建择时交易策略
Abnova 膜蛋白脂蛋白体技术及类别展示
请问如何查一篇外文文献的DOI号?
js装饰器@decorator学习笔记
How to solve sqlstate[hy000]: General error: 1364 field 'xxxxx' doesn't have a default value error
品牌电商如何逆势增长?在这里预见未来!
哈趣投影黑馬之姿,僅用半年强勢突圍千元投影儀市場!
Redis (II) - redis General Command
Redis (I) -- getting to know redis for the first time
「运维有小邓」符合GDPR的合规要求
HKUST & MsrA new research: on image to image conversion, fine tuning is all you need
DHCP路由器工作原理