0
votes

DynamoDB table

I was planning to remove the restaurantId (primary key) attribute, and make the restaurantName (partition key) and the restaurantAddress (sort key) a composite primary key. This is partly because the restaurantId has no business value here and it makes putting new items troublesome.

My question here is that if using a postal address as sort key is appropriate.

1

1 Answers

1
votes

The general question with a DB key is whether it's unique and stable. Both are dubious. A food court in a building may have multiple restaurants share a single address, and a restaurant may switch to a PO box which changes their postal address.