Menu

Post image 1
Post image 2
Post image 3
Post image 4
Post image 5
1 / 5
0

ID Capacity — The Math Behind Choosing the Right ID Length

DEV Community·Ponlamai·about 1 month ago
#mEsYx7Hi
Reading 0:00
15s threshold

The main aim of this article is to describe the limitations of ID, in terms of capacity, and the math behind the scene. Alright, good people — ID is not complicated. Various methods can generate it, such as using a counting number, randomizing, or composing/concatenating from multi-attributes (like a national ID or college student ID). Sometimes one can ignore it because the ID is auto-generated in the database, like MongoDB. But what if we must find out how to make the ID as short as possible? That is why we need to take time for consideration. The Proper ID Properties Let's think about the important properties of ID. No duplication — no need to elaborate. If the ID is not unique, it is not an ID. It must be sufficient — in terms of capacity, it depends on the generation method. Assume the system will contain no more than 100 records. If the ID is generated by a running number, 2 digits of decimal is fine (00–99). In contrast, the same 2 digits are not sufficient if the ID is generated by randomizing.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More