How does read query works in dynamoDB? I know that it internally calculates the hash based on the partition key and finds out the in which partition the item is present. After finding the partition how do you find the specific location of the item/record. Does it scan the complete partition for that item. If it scans the complete partition then how is dynamoDB called a key value lookup store?
I have searched for that in AWS Documentation, It's quite fascinating that is not mentioned anywhere.
A query returns all items with a given partition key value, ordered by sort key value. No, it doesn't need to scan the partition to do this because there is an internal index.
See Data distribution: Partition key and sort key:
I agree that it's difficult to find any AWS-supplied documentation that confirms that there is a partition-level index on pk+sk or discusses the implementation of the indexing (LSM, B-Tree etc.) Will update this answer if/when I find evidence.