3 ms·
Sometimes, the thing you need to model in a database behind an application you sell to a customer turns out to be... a sort of limited database with a schema th
by jameshart 10y ago
Sometimes, the thing you need to model in a database behind an application you sell to a customer turns out to be... a sort of limited database with a schema the customer can control and design. When that happens, EAV is one of the common attractors in design space that everyone gravitates towards.
Of course, it's worth remembering that real databases do not typically use an EAV storage pattern for their data, so maybe it's not the only way to model a custom data store within a relational system.
- emodendroket 10y agoIt's also an option when the properties of objects going in the table are going to be wildly different or are not known at write time.
- mason55 10y agoThis is a candidate for something like a schemaless datastore or a PostgreSQL JSONB column. Depending on your choice of datastore you can still at least get some indexing and schema help if you choose. With EAV you generally throw all of that out.
- emodendroket 10y agoA whole separate datastore sounds like overkill in a lot of cases.