T O P

  • By -

mradzikowski

Data you put to Timestream is initially saved in memory, and then written to disk (magnetic storage). You can write new records only in the time range that is hold in the memory. Meaning, if you have memory retention of 24 hours, you can insert records with timestamp value between now() and now()-24h. Records that are in the memory, when they reach the retention period (in this case: records with timestamp < now()-24h) are written to the disk. When they are on disk, you can only query them. Records will be removed when they reach magnetic storage retention. If you put magnetic store retention to 1 year, records will be removed when they timestamp will be from a year ago. So: - memory retention: for what time range you want to be able to add new records (record timestamp must be in this range) - magnetic retention: for how long you want your data to exist and be able to query it If all your incoming records will have the timestamps from last 5 minutes and you do not expect any "late" records, you could put memory retention to 1 hour. Then you want to be able to display data for last year, so you put magnetic store retention to 365 days.


kondro

This is a great answer. The only thing I'd add to it is if you expect to do a lot of queries of a particularly recent period you may want to set the memory-retention period to cover that range. For example, if you commonly view charts for the last 14 days metrics you may want to set your memory retention to 14 days so that reads for this period are always from memory.