professional-wings icon indicating copy to clipboard operation
professional-wings copied to clipboard

可定制ID,按段赋予业务含义

Open trydofor opened this issue 3 years ago • 1 comments

当前id均为LightId策略,无block的全序列布局。考虑在序列中区分前缀或后缀。 比如在多租户的场景,可以使用blockId作为tenant范围,但bits按位运算的可读性不好。

考虑的问题点包括,

  • 顺序行,是否可以满足排序要求
  • 范围定位,可以容易的按range select
  • 可读性,看到id,能够快速识别,比如按十进制划分

trydofor avatar Oct 14 '22 08:10 trydofor

生成如100#####,200#####的可读性较好的id

id布局上,2选一

  • 使用block=0,
  • 使用blockfirst=fasle布局

Sequence上,2选一

  • insert时,设置range
  • select时,增加range

trydofor avatar Oct 15 '22 09:10 trydofor

mirara add LightIdProvider:Generator. support customizing Generator, but not real impl

trydofor avatar Nov 14 '23 10:11 trydofor