0

I have to design a DynamoDB table for a Monitoring System.

The attributes present for each item are:

  • name (Monitor Name: String)
  • et (milliseconds epoch: Number)
  • owner (Owner of the monitor: String)

Below are the queries that I need to perform:

  1. Retrieve all monitors:
    1.1 That ran today
    1.2 In et (milliseconds epoch) range
  2. Retrieve by owner and name
  3. Retrieve by owner
  4. Retrieve by owner, name, and in et (milliseconds epoch) range

I came up with below selection of keys:

  • Partition Key: Owner#MonitorName
  • Sort Key: ET (milliseconds epoch)
  • GSI Partition Key: ET (milliseconds epoch)

How I think queries would be executed:

  • Query 1:
    • Query 1.1 et = :val
    • Query 1.2 et between :val1 and :val2
  • Query 2: Owner#MonitorName = :val
  • Query 3: Owner#MonitorName begins_with(:val)
  • Query 4: (Owner#MonitorName = :val) and (et between :val1 and :val2)

Is this design efficient? What are the drawbacks for the design? How can it be improved?

adarsh
  • 1,393
  • 1
  • 8
  • 16

0 Answers0