| "The key difference is that the components of a complex data type don't stand on their own, or it's a violation of 1NF." The characters or substrings that make up a string stand on their own. In fact, it's pretty hard to differentiate a string from an array of characters. Similarly, the date component of a timestamp stands on its own, and timestamps are routinely broken up in that fashion. "The interesting thing about arrays is depending on the work you're doing with them, they could either be a violation of 1NF or not." In other words, you're saying that queries are a violation of 1NF, rather than the schema? What about integers and modulo division? Is modulo division considered to be accessing a component of an integer? "people reading are developers and will take this as carte blanch to store repeated values or sets as arrays" There's no substitute for careful thought when designing a schema. "Intuitions about database storage and performance tend to be incorrect." Good point. "loss of relational correctness" I still don't think you've justified this. Remember that the normal forms are formally defined, so you should be able to show a clear distinction, which I've not seen yet. "All optimizations are trading flexibility for performance." What particular kind of flexibility is lost in this example (product tags)? "The rule of thumb on arrays is don't use them, and there are good reasons for that." This really sums up the situation. It's easy to use arrays for the wrong things, so the rule of thumb is to never use them. But they are still useful often enough for developers to get frustrated, and the rule of thumb may cause them to invent a worse solution elsewhere. We should make the good reasons known, rather than just the rule of thumb. |
It's difficult to differentiate a number from an ordered n-tuple of bits, but that doesn't make storing the number 123 storing an array.
I took the parent post's point to be clear: it isn't whether you can look at something as, in some sense, an array, it's whether you treat it as an atomic value. That's generally what you do with numbers: you update the whole number, not the third bit. And it's likely what you do with strings---even if you just want to change one character, you update the whole string, not the third character.
Likewise, if you want to store a complex number as a 2-tuple, you could treat that as an atomic data type even though it consists of two elements by always operating on the pair*. That's the respect in which it "stands on its own"---you don't peer inside.