what about a text
column type to store json objects
that will contains all the error log data, this is the approach used by wordpress for its custom fields feature
search functionality can be implementing by creating an full text
index
, more here: http://dev.mysql.com/doc/refman/5.5/en/fulltext-search.html
I feel that you shouldn't search a JSON encoded text field, Especially like user ids etc you would have to match on "user_id":4
it would just be a nightmare.
mysql has regexp support, so you can build very complex searches
second, you don't must rely in only one field, in this case the json field, before inserting the json data, you previously must to analyze it to extract the unique data, like user_id, timestamp, etc
So I would analyze it for?
I was considering making a meta table with 2 columns, keys
(string [dot notation for arrays]) and then value
, would this not be more effective?
first of all, have you some sample/idea that how will looks the meta data to be manipulated??
Well meta is going to be user defined so I am guessing they could have anything from:
user: { name: 'N/A', id: 9 }
to:
error: { serverId: 'N/A', hostname: '' }
So there is no rules on meta data totally up to what is sent to me in the request.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community