public inbox for [email protected]
help / color / mirror / Atom feedFrom: Adrian Klaver <[email protected]>
To: Skorpeo Skorpeo <[email protected]>
To: [email protected]
Subject: Re: Json table/column design question
Date: Thu, 23 May 2024 09:15:27 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAMXrOMOY_ky6z8W4Fh=FoWdPB5xd12ZBeCj4JMqiu4eU7s97hQ@mail.gmail.com>
References: <CAMXrOMOav1m8Ep01o7_GDLWxLSpgMp+o4d3FNdmOY7RoWe5B7Q@mail.gmail.com>
<[email protected]>
<CAMXrOMOY_ky6z8W4Fh=FoWdPB5xd12ZBeCj4JMqiu4eU7s97hQ@mail.gmail.com>
On 5/23/24 09:06, Skorpeo Skorpeo wrote:
> Thank you for the valuable feedback. I see people are big fans of json
> here.
You can be a fan of JSON and still think it is not the correct way to
store data in a relational database. When you do that you often end up
with nested, possibly unstructured, data sets. That ends up with the
exertion of more effort to get the data out in any meaningful form and
in a timely manner then the time and effort it would take to enter it in
a structured way.
>
> On Thu, May 23, 2024 at 3:04 AM Laurenz Albe <[email protected]
> <mailto:[email protected]>> wrote:
>
> On Wed, 2024-05-22 at 22:38 -0500, Skorpeo Skorpeo wrote:
> > 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?
>
> It doesn't matter much if you use one or two columns.
> But the word "collection" makes me worry. Perhaps this article can give
> you some ideas:
>
> https://www.cybertec-postgresql.com/en/json-postgresql-how-to-use-it-right/ <https://www.cybertec-postgresql.com/en/json-postgresql-how-to-use-it-right/;
>
> Yours,
> Laurenz Albe
>
--
Adrian Klaver
[email protected]
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: <[email protected]>
* 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