News Feed
Jobs Feed
Sections




News Archive
Arnold Daniels' Blog:
An alternative way of EAV modeling
July 31, 2008 @ 12:54:23

Arnold Daniels has posted some thoughts on a topics recently featured in a cover story by php|architect - EAV modeling.

I had seen this db structure in other project, but didn't know that it was called EAV. For those who don't read php|architect, EAV describes a method of saving a large set of attributes, only some of which apply to an individual entity. Normally you would create a table, with a row for each entity and save each attribute in a column. With EAV you save each attribute as a row.

He suggests two ways to do the modeling - the more "common" way and an alternative way that splits up the data types to make querying simpler (into scalars and arrays). A sample database structure and example query for it are included.

1 comment voice your opinion now!
eav modeling database attribute query common alternative method


blog comments powered by Disqus

Similar Posts

7PHP.com: Interview with Patrick Allaert - Creator of the Alternative PHP Monitor

PHP-Coding-Practices.com: How Table Migrations In CakePHP 1.2 Can Save Your Life

Jacob Santos' Blog: Object Oriented Programming Isn't Easy

Zend: Zend Framework Database Access Webinar (Oct 31st, 2007)

PHP-Coding-Practices.com: Composing Methods: Replace Temp With Query


Community Events











Don't see your event here?
Let us know!


zendframework2 functional usergroup testing development series symfony2 interview conference phpunit release unittest language framework introduction database opinion rest podcast community

All content copyright, 2013 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework