Querying vs Scanning practice for specific scenario DynamoDB

435
April 25, 2017, at 2:02 PM

There seems to be about a hundred ways of retrieving items in dynamo db. I have heard that Querying is only for Hash and Range Key values, however the, I have also seen that scanning is very slow and expensive on memory for my read and write units. However, some of the code and articles I've read are outdated, I am unsure where to go from here.

I need some help determining which is the most efficient way to find entries in the following ways.

Currently all my data is contained on one table "User_Table", I have "username" as my hash key, but do not use a Range Key, the items I'm trying to load should be around 30-50kb each

Scenario #1 Search for accounts with 2 attributes between 2 values each

I want to find nearby users locations so I can add them to a GoogleMap on the home screen, so I need to search dynamodb for my users with a "latitude" value between A and B, also a "longitude" value between C and D.

Scenario #2 Search by Hash Key

A user wants to search for others by username

Scenario #3 searching for a specific non hash key value (string)

My app allows users to add for example a Twitter account to their profile, no other profiles are allowed to have the same Twitter account linked, so I would just need to search and find the user containing a "twitter" value of "billymitchell" etc

QUERYING

querying has these different options

dynamoDBMapper.query(), dynamoDBMapper.queryPage() 
amazonDynamoDBClient.query(), amazonDynamoDBClient.getItem(), amazonDynamoDBClient.batchGetItem()

SCANNING

scanning seems to have the following options

dynamoDBMapper.scan(), dynamoDBMapper.scanPage(), dynamoDBMapper.parallelScan() 
amazonDynamoDBClient.scan()

I only have a few a entries in my DynamoDB Table currently, so I don't have a clear view of how well things will scale if my app starts to gain thousands of requests at a time, also . I know that adding more read and write units can get expensive very quick. Can anyone point me in the right direction?

Thanks!

Rent Charter Buses Company
READ ALSO
Android Snackbar covering the control buttons in Google Pixel

Android Snackbar covering the control buttons in Google Pixel

The Snackbar covers the control buttons of the Google Pixel deviceThe device is running Nougat and the screenshot illustrates the issue:

274
init warning: Service myservice needs a SELinux domain defined. Please fix

init warning: Service myservice needs a SELinux domain defined. Please fix

I want to excute an executable on boot On a target board with Android 51 so I add this in init

933
Very terrible quality photos when I photo in Genymotion emulator on Windows 10 x64

Very terrible quality photos when I photo in Genymotion emulator on Windows 10 x64

I'm looking for a solution of low quality photos in android emulators like Genymotion, NOX, Bluestacks or other) on WindowsThe task is to get application work perfectly, which makes photo text documents and sends them to Internet for text recognition...

397