1

I am writing a service that queries some occupation data from remote stations in carparks and storing it in DynamoDB. This is a sample dataset:

<PublicCarparksStallCount>
  <AsOf>2018-05-01T10:57:15</AsOf>
  <Carparks>
    <Carpark>
      <CarparkId>1</CarparkId>
      <CarparkName>Azrieli Sarona</CarparkName>
      <CarparkSummary>
        <Usable>1242</Usable>
        <Vacant>478</Vacant>
        <Occupied>712</Occupied>
        <Reserved>0</Reserved>
        <MedicalVacant>1</MedicalVacant>
        <MedicalOccupied>3</MedicalOccupied>
      </CarparkSummary>
      <Levels>
        <Level>
          <LevelId>1</LevelId>
          <LevelName>מפלס -2</LevelName>
          <LastValidCountTime>2018-05-01T10:57:16</LastValidCountTime>
          <LevelCount>
            <Usable>171</Usable>
            <Vacant>11</Vacant>
            <Occupied>159</Occupied>
            <Reserved>0</Reserved>
            <MedicalVacant>0</MedicalVacant>
            <MedicalOccupied>1</MedicalOccupied>
          </LevelCount>
        </Level>
      </Levels>
    </Carpark>
  </Carparks>
</PublicCarparksStallCount>

What is the best way to define a partition key for such data? The service runs once every minute and stores this data for later use or for real time visualization.

Alex Gill
  • 179
  • 1
  • 8

1 Answers1

0

Its not really possible to answer this question. Your table schema depends on how you are going to use your data, for example the kind of queries you are going to do.

Just as an example I could say create PublicCarparksStallCount UUID attribute for partition key and store the whole document in an attribute called document, but this could be a terrible solution depending on what you want to do in your application.

I suggest having a read through this answer and refining your question.

F_SO_K
  • 13,640
  • 5
  • 54
  • 83