This is my use case:
- 10,000 IoT devices
- Each IoT device sends its environmental data (temperature, pressure, etc.) every 30 seconds
- Data of each device will be kept for 24 hours
The main requirement is to retrieve the latest data of a specific device (from device_id). Retrieve of the data will be step-wise. Meaning, at one time, only 100 records will be read. Then if the user wants, he will request the read the previous 100 records, and so on.
Also, it is possible that multiple users try to retrieve data of multiple devices at the same time.
My concerns are:
- How to structure the DB (I am specifically looking at AWS's DynamoDB)
- Creating a table for each device would be elegant, however seems creating 10,000 tables is not recommended
- If I put all the 10,000 devices in one huge table, reads from this would be very inefficient.
Could someone advice on what would be the best design strategy for this case?