开发者

how to use blob pattern as an alternative of EAV

In the literature and on the forums people often say that EAV is evil and often sugest using Serialized LOB pattern as an alternative of EAV, but don't say something concrete how to use it.

I wonder how to overcome problems with using BLOB pattern as an alternative of EAV. Let’s assume that we could store all custom fields of the entity in a field custom_fields as a string for example in JSON something like tihis: {customField1: value1, customField2: value2, …, customFieldN: valueN} Let's assume the table s开发者_如何学Pythonubscribers has fields: id, email, custom_fields (where all custom fields is stored)

How to overcome the following problems: 1. How to seach by seperate custom fields, for example, to find entities with the conditions custField1 = value1 AND customField2 = value2? 2. How to mantain data integrity, for example, if we delete a custom field for the entity how to delete all values oif these custom fields in the entity?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜