←back to thread

47 points gm678 | 1 comments | | HN request time: 0.206s | source
Show context
hot_gril ◴[] No.44506100[source]
Definitely don't want to store types as columns in a DB, especially because of the inevitable thing that qualifies as two different types. In this situation, I'd usually take the first one (nullable cols) without much consideration. The DB doesn't need an xor constraint, but it can if you really want. New cols can be added without much impact on existing data.

And if the info is non-scalar, it's either option 2 (nullable FK) or 5 (JSON), depending on whether or not other things join with fields inside it.

replies(1): >>44507047 #
1. hobs ◴[] No.44507047[source]
First one gets messier faster than most, the fourth one generally grows the least crappily over time.