Reputation: 111
I've a table of cars. with the items, CarName, ModelYear, Color, Transmission, Used-Mileage. how can I query the car by just ModelYear or just color or just Transmission? I mean, how can I specifically query the data, available in the table.
Upvotes: 0
Views: 24
Reputation: 31
@hassan are you able to share what you have already. There are a lot of strategies you could use, you could create multiple item collections or indexes. I’ve made an app which may help you in deciding which models a winfarm https://github.com/dariusjs/windpark
It also depends what access patterns you will have on the app. Are you sensitive to low latency, how much data will there be. You could get away with scans and filtering but that will not scale.
You could try something like this which would target your requirement to get cars by date
PK: MAKE#DODGE SK: YEAR#1969#MODEL#CHARGER TRANSMISSION:MANUAL PK: MAKE#DODGE SK: YEAR#1970#MODEL#CHARGER TRANSMISSION:AUTO PK: MAKE#DODGE SK: YEAR#1971#MODEL#CHALLENGER TRANSMISSION:AUTO PK: MAKE#PLYMOUTH SK: YEAR1970#MODEL#ROADRUNNER TRANSMISSION:AUTO
Next to this you could fill out the rest of the attributes of the car and potentially use indexes to list query those
I recommend giving the aws dynamodb workbench tool a try and trying to experiment a bit on this
Upvotes: 1