I am trying to store "dynamic" properties about objects in SQL. As an example, let's say I have a table called objs
that has two columns (id
, name
). Now some users may want to store a property called hocus
while others may want to store a property called pocus
(or even banana
). Anything really.
My thought is to create two tables, props
and obj_props
. props
would have two columns (id
and prop_name
), and obj_props
would have (obj_id
, prop_id
, and value
).
My only concern is this seems like a lot of overhead if there are millions of objects, each with 20-30 properties. I know I could create an index in obj_props
on obj_id
and prop_id
but will this still be able to perform well? Is there a better solution for something like this? I'm looking into MongoDB but the lack of joins is frustrating.