tags:

views:

498

answers:

2

I'm interested in playing around with the EAV model over an SQL Server Database. Is anybody able to point me to an article or framework for an existing model/schema (I'm not intrested in Saas for this)?

+7  A: 

Best Practices for Semantic Data Modeling for Performance and Scalability

EAV is notoriusly problematic as it leads to severe deployment performance and scalability problems. The Whitepaper in the link, released by the SQL Server Customer Advisory Team tries to offer some guidance to deploy a succesful EAV model.

Remus Rusanu
A: 

Why not create a very simple table with an entity column, an attribute column, and a value column:

CREATE TABLE eav(
    entity STRING,
    attribute STRING,
    value STRING);

And then populate the table using a script of some sort to generate some test data.

INSERT INTO eav ('banana','color','yellow');
INSERT INTO eav ('banana','fluffy','no');
INSERT INTO eav ('banana','origin','Guatemala');
INSERT INTO eav ('orange','origin','USA');
INSERT INTO eav ('orange','origin','Mexico');
INSERT INTO eav ('pear','origin','USA');
INSERT INTO eav ('peach','fluffy','yes');

And then try running queries on it, to play around, learn how it works, etc.

In general though, the above data organization scheme doesn't really mesh well with relational database theory. The above meshes more with document database theory, like Couch DB. I'd look more into that if you need to store/manage data of EAV nature in the wild.

sheepsimulator
If you have access to a Siebel system, the LOV system works in the exact same way.
sheepsimulator
Doing that would be easy, but after about 2 seconds I'd be asking a bunch of questions, hence why i was really looking for an existing article or framework that would have already answered those questions.
Jaimal Chohan
@ Jaimal - What kinds of questions? Your question states that you want an example schema to play around in.
sheepsimulator