Most efficient way to store data from laboratory instrumentation

Wayne Knowles 0 Reputation points
2023-08-17T18:09:37.32+00:00

I would like to know the most efficient table architecture to store the following: I have two machine analysing samples. Each machine takes a reading from 3 sensors every second up to a period of twenty minutes and the analysis run is complete. Samples have unique IDs and run into the 10s of thousands. I envisage a table that contains sample information, ID, the machine ID and the date of the analysis neatly in rows with one row per sample. The problems comes with the sensor readings. The number of readings (1/sec) would produce too many columns (i.e. 60x20) for a regular table if the sensor readings were stored in rows for each sample. However, if I stored time and the sensor readings in columns (i.e. vertically), then I would have a lot of data continuously duplicated (The time increment and sample ID).

I am really scratching my head on how best to store these data in SQL table. Could storing the time increments and sensor readings as 'blobs' be a solution?

Thanks

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,494 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 120.2K Reputation points MVP
    2023-08-17T21:39:25.9933333+00:00

    First question: Have you considered Azure Data Explorer, also known as Kusto. I have not worked with it myself, but I believe Kusto is really great for time-series data.

    If there are three sensor, I would start with one column per sensor, particularly if they measure different things. Together with this, you could have the sample ID and the timestamp as the key columns. The sample ID would be repeated, but the timestamp would not. Actually, you could stored the sampleIDs in a separate table with stop and start times for these samples, and then you would not need the sampleIDs in the sensor table.

    Or is there something I have missed?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.