lundi 31 août 2015

Is this the right approach to index creation in DynamoDB?

I want to create an app that has a list of clients with ids (emails in this case), their phone number and other important information. Most of the time the clients table will be searched by using the client id (their email) but occasionally I want to be able to do this search using their phone number. Basically I want the app to have a text field where you can either type the email or phone number and be able to retrieve the client data.

Client ( ID, PhoneNumber, Name, LastName, etc...)

After researching on DynamoDB, I came up with the solution of having a table for the clients and having an index hash key for the ids with a lot of throughput for read and write since querying based on this attribute will be the most common task. Then, I created a global secondary index, with a key for the attribute phoneNumber, and giving this a low throughput number for reading and writing since the search of a client by its phone number won't be too occasional. However, The app will never make an update using the phone number as a key, it will only make updates using the id as a key.

Is this the right approach, or would there be a better thing to do? Are the throughput values right based on my needs or do you think that there is no need to have any write throughput values for the secondary index? Is there maybe something wrong with thought process?

Thank you very much!




Aucun commentaire:

Enregistrer un commentaire