I will soon need to store measurements (from within MATLAB) in a database – maybe MySQL.
Each measurement will consist of some let’s say meta-data and a measurement vector of 4096 float (double) entries.
Which way should I store them into the database? Converting then into a BLOB or taking them as an ARRAY type column? I found those column type within JAVA jdbc Docs.
Any hints are welcome – even different solutions.
I will soon need to store measurements (from within MATLAB) in a database –
Share
Note that MySQL does not have array types, when you make your choice of engine. Arrays are defined in the ANSI/ISO SQL standard, so it is likely that more DBMS will adopt support for them over time instead of the other way around.
You are likely to need some conversion even when using arrays, as arrays results are usually encoded as a string representation, which will need to be parsed, though that shouldn’t be a problem with a simple 1-dimensional array of doubles. The choice of storage method depends more on what you’re going to do with that data once it is in the database, than on the way you want to store it.
It makes sense to use arrays, if you intend to operate on the vector contents on the server, e.g. to search for values (
:value = ANY (array_column)). If you’re only going to retrieve the vector, without inspecting its contents directly in queries, it won’t matter that much what storage you decide on. Actually you might benefit from blob/text storage in order to avoid any additional processing on the DBMS side (i.e. the encoding of the array value as a string representation for the result).