In context of a tracker system, I have a situation, where the user's device deliver location data to backend and the system subsequently queries that data both per user and in bulk. The structure of the data is as follows:
{"user_id": "user_1", "timestamp": "2020-10-31 07:05:10.153777+00:00", "location": "XYZ", "details": "PQR"}
The queries that we need are:
Get all location and details data for X<timestamp<Y
and
Get all location and details data for user_id=P and X<timestamp<Y
The total size of database would be around 10 TB I am a DynamoDb newbie, and am not sure I understand the concept of partitionKey very well. Currently I would plan to use a table with partitionKey as user_id and rangekey as timestamp, and then create a secondary global index with "day" out of timestamp for satisfying the first query.
- Does anybody have advice about how should the DynamoDb be structured for best scaling and performance?
- Does anybody have any advice/criticism about the currently suggested structure?