SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Ensuring Each Client has a Full Set of Key-Value Pairs


Ensuring Each Client has a Full Set of Key-Value Pairs

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)

Group: Administrators
Points: 620888 Visits: 21265
Comments posted to this topic are about the item Ensuring Each Client has a Full Set of Key-Value Pairs

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (897K reputation)SSC Guru (897K reputation)SSC Guru (897K reputation)SSC Guru (897K reputation)SSC Guru (897K reputation)SSC Guru (897K reputation)SSC Guru (897K reputation)SSC Guru (897K reputation)

Group: General Forum Members
Points: 897345 Visits: 48321
Don't you "love" it when someone rates an article as a "2" (the rating I encountered I first saw the posting) and doesn't take the time to explain why they rated the article that low?

Haven't read the article yet but thanks for posting it. EAVs are always a good subject to write about and discuss.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

When you put the right degree of spin on it, the number 318 is also a glyph that describes the nature of a DBAs job. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Steve Jones
Steve Jones
SSC Guru
SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)

Group: Administrators
Points: 620888 Visits: 21265
Smile, opinions do vary.

I really dislike EAVs, though they do have a very limited place at times. Perhaps someone feels differently and really likes them. Or they hate them and think no one can mention them.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Dibs-129480
Dibs-129480
Valued Member
Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)

Group: General Forum Members
Points: 52 Visits: 137
I don't think you are the only one to dislike them, I do too. Detest would be a better description.

It's like someone couldn't be bothered to learn normalisation and just "had a go".
Steve Jones
Steve Jones
SSC Guru
SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)

Group: Administrators
Points: 620888 Visits: 21265
It could be, but I also have used these in places where we weren't sure of the domain model for an entity. The business is a little flaky, and they want a couple random attributes that vary for customers. If it's low volume, like settings for a client, I've done this before. We've had a case where this was loaded once by each client in a session, and there were a few settings they wanted for some, but not for others. Since it was a rapidly changing set of requirements, making constant table alterations and having a wide table of settings didn't make sense. Simpler and easier to EAV these.

Of course, we had to convince the developers to "reload" these settings in the app if the client changed things. For some reason they thought forcing a client to log out to get a new setting that changed was a good idea

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
qbrt
qbrt
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2067 Visits: 885
Not a fan of EAVs. Whenever EAVs topic comes up, I bring up non-relational/hybrid solutions. Losing most of the relational database engine goodness, such as type enforcement, proper indexing, and the query acrobatics that must be done to gather the proper sets of data, and business rules enforcement gets messy. The trade-offs are not worth it, imho. But, for a small, quick private/internal app it may work. All about the time/cost.
alen teplitsky
alen teplitsky
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27611 Visits: 4926
Jeff Moden - Tuesday, July 10, 2018 7:37 AM
Don't you "love" it when someone rates an article as a "2" (the rating I encountered I first saw the posting) and doesn't take the time to explain why they rated the article that low?

Haven't read the article yet but thanks for posting it. EAVs are always a good subject to write about and discuss.

Obviously someone in the business of selling extremely expensive MDM software

Dibs-129480
Dibs-129480
Valued Member
Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)Valued Member (52 reputation)

Group: General Forum Members
Points: 52 Visits: 137
Steve Jones - SSC Editor - Tuesday, July 10, 2018 7:58 AM
If it's low volume..

That's the key phrase. If it's low volume, then as long as it works, I wouldn't be bothered but if it's any kind of volume, poor design will only come back to bite you.

SoHelpMeCodd
SoHelpMeCodd
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5291 Visits: 898
A well-written article about a knotty problem and a naughty design for an RDBMS. I am afraid the article's "let the DBA fix it" comments will earn this article a low rating - I will not contribute to that as a rating, but I will explain the low rating (from a DBA's viewpoint):

I have almost 1000 databases (one per customer, across multiple environments) using a similar "Item" and "ItemSetting" EAV design. As a twist (of the EAV knife), "Item" includes a PrimaryID and a SecondaryID relationships as self-references. Apart from one or two Item Settings that will be present per active system user, most are singular to absent (depending upon the features a customer wants to use). I typically see approximately 100 different query hashes used in approximately 1000 different execution plans, per database. That's about a million execution plans to ponder. Parameter sniffing issues are common, but the number of plan guides I can create are finite, and many plan guides become obsolete in the next release. Now that we implemented "microservices", the issues are compounded ("Who's on First? What's on Second? IDunno's on Third!"), ASYNC_NETWORK_IO waits have spiked, and we have doubled the sizes of app and web servers (as a partial mitigation for that wait). All because some thought the database's %_Settings tables were "too many and too confusing". There was, and still is, no dictionary for the developers, and two different ORMs are in use.

Meanwhile, a coworker DBA (or me or another, when he is out of office) spends half their day manually running scripts designed "customize" ItemSettings. When ItemSettings are "missing", the DBAs say "that's an application problem". But what the DBAs say falls on the deaf ears of Agile development and a need to keep production up. We only have 100 customers in production, and our customer base has grown 10-fold in the past 3 years. We plan on hiring a junior DBA. Given our growth rate, that junior DBA will do nothing but "fix" ItemSettings, full time, with the next 2 years.

This doesn't scale. There are rumblings about somewhat trashing the Item/ItemSettings EAV design. I and my DBA coworkers already know our skills are squandered on the trash heap of an EAV design. I expect our next move will be towards a hierarchical DBMS (away from SQL Server). That for me is not a pleasant thought, with the saving grace being that our business may survive.
Steve Jones
Steve Jones
SSC Guru
SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)SSC Guru (620K reputation)

Group: Administrators
Points: 620888 Visits: 21265
Dibs-129480 - Tuesday, July 10, 2018 8:01 AM
Steve Jones - SSC Editor - Tuesday, July 10, 2018 7:58 AM
If it's low volume..

That's the key phrase. If it's low volume, then as long as it works, I wouldn't be bothered but if it's any kind of volume, poor design will only come back to bite you.


That's true, but I found that every few months we need to re-evaluate this and think about moving EAV items to proper columns. Easy to have this get out of control.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum









































































































































































SQLServerCentral


Search