Hi all,
I know there are very good reasons to record each item on a separate row of a table, but my question arises from a specific need and I'd like to hear what you think about it.
We should record for each of about 500 employees, each day, their selection for a complete lunch (four to ten items, if they order for a guest too). There's no need to search for an item or manage it (update, delete..) once stored.
Traditionally I would think about a table like below:
id, lunch_date, fk_employee_id, fk_item
where fk_xxx are foreign keys to tables Employee and Items (where a few info about an item are stored).
But what about "cheating" and storing all the items for a specific employee/date in a BLOB field?
I would convert the array object to an array of bytes with B4xSerializator's ConvertObjetToBytes, then store this group of bytes to a BLOB data field.
Later on, I would read it back and convert it again to an array of ints. What do you think?
About DBes, I would have Sqlite locally on mobile and MySql/MariaDB on remote server.
I read about the addition of a JSON datatype to MySql but I guess it could cause problems to store it plainly to a TEXT field in Sqlite. Anyway I never used it before so, eventually, some tests should be coducted on this kind of solution if it's to be considered.
Any other good and efficient strategy? TIA
udg