Relational database - how to connect data

Hi,

I have a question on how to structure the database when data types are linked.

Suppose, I have a data type A that contains a number of fields, say 1,2,3,4…50.
And I have a data type B that contains a number of fields, say a,b,c,d,…z.
A and B are related, so I link them by creating a data field B in the data type A and a data field A in the data type B.

I tend to create, for example, data fields of B in the data type A as well (after linking two data types) like b,d,f,k,m…(from data type B) also in the data type A because I thought this way rendering linked data could be faster in terms of performance.

I feel that many data are redundant by doing this way and wonder if added complexity in database structure affect the overall performance.

So, my question in this case is if or not it is better just link A and B and retrieve linked data in the front end by calling data type A’s a, A’s b… rather than searching directly for a,b,c from data type A.

I guess this is very basic question on database design, but need help.

Thank you.
John

Hi there, @yj.johnrhee… your question is similar to another thread from today, and the bottom line is I would avoid redundant fields unless it is really necessary, and it doesn’t sound like it is in your case.

Hope this helps.

Best…
Mike

1 Like

Hi @mikeloc, long time and thanks again.

So, having redundancy in database affect the overall performance of the app? What would be the bad impacts?

Thanks.
John

Performance can mean a lot of things, and in my opinion, it’s not really about that (I’m guessing any impact of redundant data on “performance” would be negligible anyway). It’s about the (bad? less than ideal?) practice of storing data in more than one place and then having to manage the data in multiple places. Why go that route unless you have a very good reason for doing so, with that reason being a lot more specific than “performance” (for example, check out the last reply in the thread I referenced).

1 Like

Thank you @mikeloc.

1 Like