DynamoDB query() versus getItem() for single-item retrieval based on the index

后端 未结 4 609
闹比i
闹比i 2021-02-06 20:28

If I\'m retrieving a single item from my table based on the indexed hash key, is there a performance difference between query() or getItem()?

4条回答
  •  被撕碎了的回忆
    2021-02-06 21:12

    In Amazon's DynamoDB, your performances are guaranteed whatever the access method. (you pay for it).

    There may be a couple a milliseconds differences on the DynamoDB servers themselves as suggested by Chen Harel but these are negligible because of the HTTP request RTT.

    This said, it's a good practice to issue a GET instead of QUERY when you have enough informations to do so.

提交回复
热议问题