web dev//UI//schema-driven UI//EAV

Entity-Attribute-Value (EAV) is a database pattern that stores rows of `(entity_id, attribute_name, value)` instead of one column per field, so that every field is a row. It allows unlimited custom fields without schema migrations, and Salesforce and Jira use it under the hood.


Entity-Attribute-Value (EAV) is a database pattern that stores rows of (entity_id, attribute_name, value) instead of one column per field, so that every field is a row. It allows unlimited custom fields without schema migrations, and Salesforce and Jira use it under the hood.

The tradeoff is brutal, because it gives up everything SQL is good at: no column types, no foreign keys, no indexes on specific attributes, and queries that become multi-join nightmares.

Reading one email is SELECT value FROM attributes WHERE entity_id = 42 AND attribute = 'email' against SELECT email FROM contacts WHERE id = 42 in a typed table, and asking for all contacts whose email contains X requires scanning the entire attributes table filtered by attribute name.

The usual and better alternative is JSONB columns in SQL for the flexible fields, on top of a typed relational core.