public inbox for [email protected]
help / color / mirror / Atom feedFrom: David G. Johnston <[email protected]>
To: Skorpeo Skorpeo <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Json table/column design question
Date: Wed, 22 May 2024 20:50:47 -0700
Message-ID: <CAKFQuwbDLizRmcrc5=e5AMdsgZ1DrxBNuvrudcrCdeHaOKDPZw@mail.gmail.com> (raw)
In-Reply-To: <CAMXrOMOav1m8Ep01o7_GDLWxLSpgMp+o4d3FNdmOY7RoWe5B7Q@mail.gmail.com>
References: <CAMXrOMOav1m8Ep01o7_GDLWxLSpgMp+o4d3FNdmOY7RoWe5B7Q@mail.gmail.com>
On Wednesday, May 22, 2024, Skorpeo Skorpeo <[email protected]> wrote:
> Hi,
>
> I was wondering if having unrelated columns in a table is a sound approach
> when using json. In other words, if I have two collections of unrelated
> json objects, for example "Users" and "Inventory", would it be ok to have
> one table with a "Users" column and a "Inventory" column? My concern is
> that from a row perspective the columns could be different lengths, such as
> more inventory items as users. And for any given row the data in one
> column would have no relation to another column. I would only query a
> single column at a time.
>
> Would this approach be ok or are there pitfalls such that it would be
> advantageous/recommended to have a separate table for each column?
>
> Any thoughts/inputs are greatly appreciated.
>
What do you expect to gain? The relational model and normalization has
earned its longevity, I suggest you learn and apply those techniques.
Which generally means avoiding json as a data type. (The single table
abomination you describe isn’t even really on the table - you did a fine
job arguing against it yourself.)
David J.
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Json table/column design question
In-Reply-To: <CAKFQuwbDLizRmcrc5=e5AMdsgZ1DrxBNuvrudcrCdeHaOKDPZw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox