How to design a database for User Defined Fields?

前端 未结 14 597
花落未央
花落未央 2020-11-27 08:37

My requirements are:

  • Need to be able to dynamically add User-Defined fields of any data type
  • Need to be able to query UDFs quickly
  • Need to be
14条回答
  •  -上瘾入骨i
    2020-11-27 09:17

    This is a problematic situation, and none of the solutions appears "right". However option 1 is probably the best both in terms of simplicity and in terms of performance.

    This is also the solution used in some commercial enterprise applications.

    EDIT

    another option that is available now, but didn't exist (or at least wasn't mature) when the question was original asked is to use json fields in the DB.

    many relational DBs support now json based fields (that can include a dynamic list of sub fields) and allow querying on them

    postgress

    mysql

提交回复
热议问题