thelovemsg / chatting_app

0 stars 0 forks source link

make new id generator except for 32 length uuid. #3

Closed thelovemsg closed 1 year ago

thelovemsg commented 1 year ago

objective

make new id generator except for 32 length uuid.

detailed work content

It's really easy to make primary key with uuid and we don't need to think fo many options. In a distriubuted system, if we just use uuid for that, problem is already solved! but another problem is like this.

  • what if the client want to have short primary key? 128bits to 64 bits?
  • what if we want to arrange primary key? there's no way for this.

so, we need to go on a debate which primary key can be a great choice.

note

you need id genterator that can be used in many servers. of course each id should not be the same one.

thelovemsg commented 1 year ago

https://github.com/vladmihalcea/hypersistence-tsid

I think this could be a good recommendation of uuid.