The Entity-Attribute-Value (EAV) model is a solution that initially looks very clever.
It allows developers to add new fields without changing the database structure.
For this reason it has often been used in CMSs, e-commerce platforms, and systems that support dynamic fields.
The idea is simple: instead of storing data in tables with fixed columns such as name, surname, or age,
data is saved as generic rows composed of entity, attribute, and value.
This makes the database very flexible, but that flexibility comes with a cost.
Why it is still used today
EAV is still widely used because it allows systems to support custom fields,
add extensions without modifying the database schema,
and keep a structure that appears stable over time.
For these reasons it still appears in many modern projects, including those written in PHP.
The problem is that what looks convenient at the beginning can become complicated as the project grows.
Main problems
The first issue is query complexity.
In a traditional relational database, reading data is simple and direct.
With EAV, even basic operations often require multiple joins,
data transformations, and logic that is harder to optimize.
The second issue is performance.
EAV tables tend to grow very quickly,
indexes become less effective,
and the database has to work harder to perform fast searches.
There is also a data integrity problem.
In a traditional relational model, the database itself can enforce types, constraints, and consistency.
With EAV, many of these guarantees move into the application code,
which can make the system more fragile.
Finally, EAV makes the database harder to understand.
In a relational system the structure is visible directly in the tables.
In an EAV system the real structure is hidden inside the data itself
and often has to be reconstructed by reading queries and application logic.
Why it made sense in the past
Historically, EAV also became popular because modifying database tables used to be risky.
Operations such as ALTER TABLE could lock large tables or require long downtime.
To avoid these problems, many systems preferred to use a generic structure.
Today, however, modern relational databases handle schema changes much better.
In many cases adding a column is much simpler and safer than it used to be.
Conclusion
The real advantage of EAV is flexibility,
but that flexibility often comes at the cost of slower queries,
more complex code,
less clarity,
and weaker data management.
For many modern systems, modifying the database structure directly can be a better choice:
clearer, faster, and easier to maintain over time.
Inside MilkAdmin I decided to experiment with this idea by building an admin form system
that, instead of using EAV, modifies the structure of the original database tables directly.
giuliopanda
/
milk-admin
Open-source PHP admin panel and dashboard built with Bootstrap 5 — relational CRUD generator, authentication, REST API, CLI, modular architecture, MySQL & SQLite.
Milk Admin
Milk Admin is a PHP framework for building backoffice and internal management tools — without framework lock-in, SaaS dependencies, or vendor tie-ins.
Project Status: Beta The core architecture is stable. Actively developed toward a 1.0 release in mid-2026.
Official links: Website · Documentation · Live Demo
The Form Builder That Generates Code
Most form builders store their configuration in the database and generate forms at runtime. Milk Admin is different.
The Projects module lets you design modules visually — tables, forms, field types, relations — and generates real PHP modules that you own completely.
How it works:
- The builder generates PHP modules extended by JSON configuration files
- The JSON layer handles the builder's configuration updates
- The PHP code is always the final authority — modify, extend, or rewrite freely
- Both layers coexist: you can start with the builder and continue with code
This means you can prototype rapidly…


Top comments (0)