473,695 Members | 3,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Want expert opinion on a way of storing 'relations'

i've a database where relations are hold in a special way which the project
leaders think of as "performant and uncomplicated" but which is very
questionable to me:
------------------------------------------------
Table [Attributes]
Fields [AttributeID] and [AttributeText]

Table [Objects]
Fields object stuff.... and [AttributeIDs] (varchar with 0-20 ids usually)

in AttributeIDs there is a backslash separted list of Attribute-IDs like
'\34\12\2\78\'
so to get 20 object with a special attribute (which we need often) we do

SELECT TOP 20 *
FROM Objects
INNER JOIN Attributes
ON (Objects.Attrib uteIDs LIKE ('%\' + (CAST AttributeID AS varchar) + '\%'))
ORDER BY ObjectText

ps: to store data we need for communication we include a dozen of fields in
*every* table and its content makes about 100 bytes/record
------------------------------------------------
i would do this stuff with a table to store the object/attribute
correlations.

could someone tell me if that stuff makes any sense to an expert and how to
valuate it in regard of performance(we have big customers where that *is* an
issue), design, scalability, pragmatism and sense ;)

thanks in advance,
ViperDK
Jul 20 '05 #1
1 1657
Just for starters (I'm sure you'll get plenty of contributions to this
thread!)
Against this design:
(a) You won't be able to index the relations easily - this will be a major
database layer performance issue
(b) Constraints will be exceedingly difficult (although the architect is
probably performing constraints in the application layer)
(c) AttributeID violates first normal form (although the architect probably
doesn't care as he seems to be after an OO design rather than a relational
design)
(d) Your query will always scan the table because the wildcard search in the
join predicate is not useful as a search argument - would be the same
problem even if join predicate shifted to where clause btw.. This is a
related problem to (a)

For this design:
(a) Very (too) flexible - allows changes to be made at the application
easily without much consideration for impact on database (at the expense of
database performance & probably consistency also)

General comments - this design makes little sense to the relational DBA, as
it is so foreign to the concept of RDBMS. Even as an OODBMS it's a
questionable design as AttributeID could at least be normalised - possibly
even presented back to the application as this schema using a view if really
needed.

I have worked with similar projects, notably one where a heavy committment
to the application layer was made by the architect (using Java / Struts /
JDBC & Websphere technology). A similar RDBMS design was employed, although
a little more rationally - without your AttributeID fiasco. My instinctual
reaction was strongly against this at first, however I have to say that this
application performs fine (an international B2B website for a major US
supermarket brand) as the application layer has extensive caching technology
& the application layer has more knowledge about how / when to hit the
database. Sometimes there's more than meets the eye when you bump into one
of these type of designs. Sometimes the trade offs achieve significant goals
(mainly extensibility) that you might do well to seek out from the architect
of the system before standing your ground too strongly. Generally though -
if the architect can't point you to solid documentation that describes the
design / trade-offs, you should drive him / her for it in writing now
because if you don't, you'll be paying the price in trying to maintain that
system later..

HTH

Regards,
Greg Linwood
SQL Server MVP

"ViperDK (Daniel K.)" <vi************ **@viperdk.dynd ns.org> wrote in message
news:bp******** *****@news.t-online.com...
i've a database where relations are hold in a special way which the project leaders think of as "performant and uncomplicated" but which is very
questionable to me:
------------------------------------------------
Table [Attributes]
Fields [AttributeID] and [AttributeText]

Table [Objects]
Fields object stuff.... and [AttributeIDs] (varchar with 0-20 ids usually)

in AttributeIDs there is a backslash separted list of Attribute-IDs like
'\34\12\2\78\'
so to get 20 object with a special attribute (which we need often) we do

SELECT TOP 20 *
FROM Objects
INNER JOIN Attributes
ON (Objects.Attrib uteIDs LIKE ('%\' + (CAST AttributeID AS varchar) + '\%')) ORDER BY ObjectText

ps: to store data we need for communication we include a dozen of fields in *every* table and its content makes about 100 bytes/record
------------------------------------------------
i would do this stuff with a table to store the object/attribute
correlations.

could someone tell me if that stuff makes any sense to an expert and how to valuate it in regard of performance(we have big customers where that *is* an issue), design, scalability, pragmatism and sense ;)

thanks in advance,
ViperDK

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2988
by: Bose | last post by:
Hi I have to make export of SQL Server Database to MS Access and I have done it with the tables but now I need to transfer(export) the relations, keys and indexes. Can any1 tell me how to read relations,keys and indexes from SQL Server and convert them to MS Access.(it seams that for creation of indexes in MS Access ADOX is the only way but ADOX cannot read all information about keys,indexes from SQL Server.) All I can see is that I have...
2
945
by: DelphiBlue | last post by:
I have a Nested Datagrid that is using a data relations to tie the parent child datagrids together. All is working well with the display but I am having some issues trying to sort the child datagrid. HTML Datagrid1 TemplateColumn Table Header information Detail Information
1
1798
by: Jef De Rycke | last post by:
Hi access group, I have written code to create relations between tables according to a corresponding relations information table. At first I thought my code was not working properly because after running the code the relations don't show in the relations window. However when I enter data in an underlying table I get referential integrity error messages so the relations does actually exist. The created relations do show in the relations...
1
5127
by: Randy Fraser | last post by:
How do I create a relationship on muliple columns in an untyped dataset. Why does this not work. da.Fill(ds) ds.Tables(0).TableName = "DesignSummary" ds.Tables(1).TableName = "FormulaSummary" ds.Tables(2).TableName = "MaterialSummary" ds.Tables(3).TableName = "ItemUsage" ds.Tables(5).TableName = "UsageSummary"
2
2870
by: Joe | last post by:
Hi I have a dataset with 3 tables and 2 relations Is there a way to when I am at 1 row to tell if there is a relation on that row ??? I have the code hardcoded but try to make it work if the # of tables and #relations increase or decrease So I can just pass any dataset and walk thru the rows?? Thanks
7
1735
by: Matik | last post by:
Hi to everyone, My problem is, that I'm not so quite sure, which way should I go. The user is inputing by second part application a long string (let's say 128 characters), which are separated by semiclon. Example: A20;BU;AC40;MA50;E;E;IC;GREEN
24
4668
by: Phil Latio | last post by:
Let's say I have a simple web application running with just two MySQL tables. The tables structure is as follows: Table: category category_id (PK) category_name parent_category (FK) //references category_id in this table Table: link link_id (PK)
6
1296
by: Lint Radley | last post by:
Hi Everyone, I need an opinion here on storing data for a program I am working on the processes DICOM images. Essentially, my program stores 25-45 (it varies depending on the user) ranges of pixel values to search the image for. Currently, I am using a .MDF database that requires SQL Express to be installed. For only 25-45 records it seems like overkill to me. That being said, I love the ability to easily update records, delete, add,...
0
8640
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8582
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9122
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8860
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7672
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3018
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2281
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1984
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.