当前位置:网站首页>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
边栏推荐
- LM small programmable controller software (based on CoDeSys) Note 23: conversion of relative coordinates of servo motor operation (stepping motor) to absolute coordinates
- JWT的基础介绍
- Apache ab 压力测试
- DHCP路由器工作原理
- 健身房如何提高竞争力?
- 屏幕程序用串口无法调试情况
- Unable to debug screen program with serial port
- 算法---比特位计数(Kotlin)
- 2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第二阶段答案
- 什么情况下考虑分库分表
猜你喜欢
JWT certification
POI export to excel: set font, color, row height adaptation, column width adaptation, lock cells, merge cells
Tkinter window selects PCD file and displays point cloud (open3d)
数据资产管理与数据安全国内外最新趋势
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第一阶段答案
循环肿瘤细胞——Abnova 解决方案来啦
一文带你了解静态路由的特点、目的及配置基本功能示例
unity3d学习笔记
ESXI挂载移动(机械)硬盘详细教程
大促过后,销量与流量兼具,是否真的高枕无忧?
随机推荐
MySQL卸载文档-Windows版
MySql用户权限
Learning notes | data Xiaobai uses dataease to make a large data screen
多学科融合
[solution] final app status- undefined, exitcode- 16
毕业设计游戏商城
[GNN] graphic gnn:a gender Introduction (including video)
Data of all class a scenic spots in China in 2022 (13604)
String (explanation)
Programmers' daily | daily anecdotes
7天零基础能考证HCIA吗?华为认证系统学习路线分享
企業如何進行數據治理?分享數據治理4個方面的經驗總結
ip地址那点事
品牌·咨询标准化
[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)
软件测试到了35岁,真的就干不动了吗?
什么情况下考虑分库分表
How to find the literature of a foreign language journal?
Can't you really do it when you are 35 years old?
2022/07/04学习记录