Re: Database schema for "custom fields"

2024-09-11 Thread Greg Sabino Mullane
I'd go with option 2 (jsonb), as it's likely already well supported by your applications, while the other approaches will require a good bit of customization. JSONB can be indexed, so performance should be on par with "traditional" tables. Cheers, Greg

Re: Database schema for "custom fields"

2024-09-10 Thread Shaheed Haque
The relational purists will gave their concerns, but especially given what you described about your performance and volumetrics, there is a reason why JSON(b) is a thing. For type checking, and more, I've had success a multi-key approach so that one entry might comprise: - A "name" - A "type" - A

Re: Database schema for "custom fields"

2024-09-10 Thread Peter J. Holzer
On 2024-09-10 12:08:14 +0500, Muhammad Usman Khan wrote: > There is not a properly defined solution but you can try the > Entity-Attribute-Value (EAV) Model. This is an alternative approach, where a > separate table is used to store custom fields as attributes for each record. > New fields can be a

Re: Database schema for "custom fields"

2024-09-10 Thread Muhammad Usman Khan
Hi, There is not a properly defined solution but you can try the Entity-Attribute-Value (EAV) Model. This is an alternative approach, where a separate table is used to store custom fields as attributes for each record. New fields can be added without altering the schema. There will be no need for D