I've got a design decision to make and am looking for some best practice advice. I have a java program which needs to store a large number (few hundred a day) of floating point arrays in a MySQL database. The data is a fixed length Double
array of length 300. I can see three reasonable options:
- Store the data as a BLOB.
- Serialize the data and store it as a VARCHAR.
- Write the data to disk as a binary file and store a reference to it instead.
I should also mention that this data will be read from and updated frequently.
I want to use a BLOB since that is what I have done in the past and it seems like the most efficient method (e.g., maintains fixed width & no need to convert to a comma separated string). However my coworker is insisting that we should serialize and use varchar for reasons which seem mostly dogmatic.
If one of these methods is better than the other, are the reasons Java or MySQL specific?