store objects in database
database
Solution
If you want to go with a RDBMS-like document-oriented database, I think you should look into mongoDB:
A key goal of MongoDB is to bridge the gap between key/value stores (which are fast and highly scalable) and traditional RDBMS systems (which are deep in functionality).
Problem
I have lot of objects, each can have many different kind of attributes. a lot of the attributes overlap, for example, many objects have the attribute "name". Since there are many type of objects, if there is a table constructed for each set of objects with same set of attributes, it will take lot of tables. Currently I'm using a mysql, and it is stored this way. ``` object_id|attribute_id|data ``` There are a few tables like this, different table have different type of data. For example, in a Integer table, it only store integers So I can store all kind of object in the system and it is still possible to do filtering and sorting according to the data of the attributes. It make queries a bit more complex and I don't think it is efficient. Is this is only way to do it in mysql or other relational databases? Should I try to find other database models for this problem? EDIT I did some research, it seems what I need is a Document-oriented database with the power of SQL.