
Database ID Design: UUID vs Auto Increment vs ULID — Which to Choose?
This article was originally published on bmf-tech.com . What is an ID An ID is something that uniquely identifies an entity. In set theory, a one-to-one correspondence between an entity and its attributes is called a bijection. An entity that forms a bijection can function as an ID. When considering IDs, it is necessary to consider whether it is for a single entity or multiple (group) entities, and if multiple, at what granularity? For example, when considering the attribute "crab," what type is it? What family does it belong to? What color is it? What is its name? Even attributes that do not seem to have uniqueness at first glance can function as IDs in certain contexts. For example, an item that a specific group possesses only one of. It is better to avoid designs that embed meaning into parts of an ID. For example, including identifiers like color in part of a product number. Such designs can prevent meeting the first normal form, unnecessarily complicating queries and negatively im
Continue reading on Dev.to
Opens in a new tab


