24 ms·
I actually agree. This was probably only an issue because some dev I work with didn't read the docs or didn't think it mattered at the time because our userbase
by willio58 4y ago
I actually agree. This was probably only an issue because some dev I work with didn't read the docs or didn't think it mattered at the time because our userbase was so small the difference between a scan and a query was negligible at the time.
Part of me does wonder if there would be a benefit in DynamoDB providing a function that under the hood creates secondary indices and uses queries where that would be the most efficient choice automatically. But maybe that would be a better fit for an ORM of some sort.
- gregplaysguitar 4y agoThat sounds like a query planner… but it’s fundamentally not really what dynamodb is about. Query planners are amazing but the tradeoff is unpredictable performance - dependent on traffic, data size etc. Dynamodb offers “predictable performance at any scale” precisely because it doesn’t offer this sort of abstraction.
- silisili 4y agoThat would have been a killer feature for me. Instead of reading about GSIs, LSIs, and even going so far as having to create a dummy field to do sorting properly[1], it would be pretty nice if you could somehow input the queries you want to do, and have Dynamo make suggestions. 1 - In a collection, I could find no way to easily do 'give me the latest record.', which is super easy in rdb. I ended up creating a key something static like 'x', with date as the range key to accomplish this. If anyone has a cleaner way, please share.