DynamoDB newbie question
I am trying to build a job table which really acts as a priority queue(One Lambda fills once a day and other lambda executes by reading one at a time). Below is the high level flow:
- First Lambda --> reads the job parameters from JSONs and inserts to DDB table --> Second Lambda --> reads each job and executes the job accordingly.
Trying to see what Partition Key and Sort Key would make sense? Couple of things I thought of
- UUID as JobID: But Second Lambda wouldn't know this random ID to read from the DDB Table
- IndexName#RunDate: For any reason, if the first lambda re-runs after few hours, records shall be overridden and the previous state is lost.
- IndexName#RunDate#Run1: This needs that first lambda to read the records to check if the records are already present and then increment the number
I am looking for some simpler approach; not having multiple tables or bringing in another service etc. But I am open to listen to ideas.