Hacker News new | past | comments | ask | show | jobs | submit login

As soon as you allow some kind of user-defined meta data, you basically end up with the entity-attribute-value pattern.

Every sufficiently advanced system does that, be it a CRM that allows custom fields, or a project management or ticket system, a workflow system etc. And basically all enterprise software contains elements of these systems.




I always felt like the separation between DDL and DML in standard databases might be fundamentally contributing to that though. I'm not smart enough to come up with a better paradigm. But sometimes it seems like the most basic principles of how SQL databases work are at war with how they are used.


A good alternative would be to use JSON types in RDBMS in combination with classic field types. EAV is really just free form data and JSON is easier to query in MySQL or Postgres.


Yes, but that's a fairly recent development, often without good ORM support, and I don't know how cross-database compatible the support is.

For a new application that only supports one database, it's probably a better choice.


In some cases, you can also expose in some ways the database schema to the user through a custom made ORM.

The result is also a nightmare, it makes for really difficult upgrades, and a complex product for the customer as he has to have some database knowledge and can shoot himself in the foot quite easily.

I still don't know which approach is the worst between EAV and exposing the data schema...


Aren't you describing GraphQL Here?


To me it sounds more like the way Salesforce allows you to add custom fields to objects.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: