当前位置:网站首页>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
边栏推荐
- Data of all class a scenic spots in China in 2022 (13604)
- 数据资产管理与数据安全国内外最新趋势
- Tkinter window selects PCD file and displays point cloud (open3d)
- 企業如何進行數據治理?分享數據治理4個方面的經驗總結
- 【mysqld】Can't create/write to file
- 常用函数detect_image/predict
- [opencv] morphological filtering (2): open operation, morphological gradient, top hat, black hat
- 从零到一,教你搭建「CLIP 以文搜图」搜索服务(二):5 分钟实现原型
- How to find the literature of a foreign language journal?
- C language (structure) defines a user structure with the following fields:
猜你喜欢

使用TCP/IP四层模型进行网络传输的基本流程

Abnova循环肿瘤DNA丨全血分离,基因组DNA萃取分析

Tkinter window selects PCD file and displays point cloud (open3d)

数据资产管理与数据安全国内外最新趋势

Ha Qu projection dark horse posture, only half a year to break through the 1000 yuan projector market!

基于JS的迷宫小游戏

ESXI挂载移动(机械)硬盘详细教程

快速定量,Abbkine 蛋白质定量试剂盒BCA法来了!
![[GNN] graphic gnn:a gender Introduction (including video)](/img/b3/0855885dafa7afaa7375b8d2195974.png)
[GNN] graphic gnn:a gender Introduction (including video)

unity3d学习笔记
随机推荐
MySQL的安装
js装饰器@decorator学习笔记
ANR 原理及实践
What are the classic database questions in the interview?
学术报告系列(六) - Autonomous Driving on the journey to full autonomy
Abnova循环肿瘤DNA丨全血分离,基因组DNA萃取分析
多个kubernetes集群如何实现共享同一个存储
Go straight to the 2022ecdc fluorite cloud Developer Conference: work with thousands of industries to accelerate intelligent upgrading
基于JS的迷宫小游戏
Programmers' daily | daily anecdotes
AddressSanitizer 技术初体验
How can I check the DOI number of a foreign document?
How to use wechat cloud hosting or cloud functions for cloud development of unapp development applet
【mysqld】Can't create/write to file
JWT 认证
MySQL installation
程序员的日常 | 每日趣闻
What books can greatly improve programming ideas and abilities?
MySQL卸载文档-Windows版
C language interview to write a function to find the first occurrence of substring m in string n.