

Naturally, in such scenarios RDMS resources cannot be used efficiently. Some refer to this as an example of the inner-platform effect. In order to achieve this, EAV bypasses normal schema restrictions. Originally, EAV was introduced to workaround a problem which cannot be easily solved within relational model. In the following paragraphs we briefly discuss the pros, the cons and pointers to keep in mind when using EAV. As with every tool, it should not be overused. When used carelessly, however, it can complicate database schema, degrade the performance and make maintainance hard. When used appropriately, it can introduce great flexibility, cut prototyping time or deacrease complexity. It is more of a gray pattern - it exists in some context, to solve certain set of problems.

As such, it should not be thought of as either an amelioration pattern, nor an anti-pattern. Wikipedia - Entity–attribute–value modelĮAV is a trade-off between flexibility and complexity.You will find detailed description of the EAV here: This implementation also makes it easy to edit attributes in Django Admin and form instances. Values are an intermediate table between attributes and entities, each instance holding a single value.

Attributes (name and type) are stored in their own table, which makes it easy to manipulate the list of available attributes in the system. Value(value_float=15.5, person=mike, attr=height).Įntities in django-eav2 are your typical Django model instances.
