I have a temperature reading device.
I require to store the last N records of its temperature reading in an object
it will either be 5, 10 or 20 records
I was thinking of a dictionary with ID and array:
it should look like this:
ID, array of [N] records
i.e. in this example, there are 2 ID's and I store the last 5 temperature values
My first question is about the array ordering
Can i define the size of the array, and push to it so it always inserts the latest temperature at top, and discards the oldest record at bottom, always keeping the correct size and order? (if not what other object should i use)
second question, is there a better way to do this, maybe using a different object??
I will be reading and updating it once a second so it needs to be FAST as there could be a million ID's each with 5-20 temperature readings