I'm learning to use DynamoDB table and storing some job postings with info like date posted, company, and job title.
The query I use most is get all job posting greater than x date.
What partition key should I use so that I can do the above query without using a scan?
Partition key can only be checked for equality so using date as the partition key is no good. Date as the sort key seems best since I can query using equality on that.
However I'm a bit stuck on what is a good partition key to use then. If I put company or job title, I would have to include that as part of my query but I want ALL job postings after a certain date not just for specific company or job.
One way I thought of was using month as a partition key and date as the sort key. That way to get say last 14 days I know I need to hit the partition key of this month and maybe the last month. Then I can use the sort key to just keep the records within the last 14 days. This seems hackish tho.