I am currently developing an Alexa skill based on health care. So I need to store information about diseases, their diagnosis and symptoms. I have made a basic skill including information about one disease in a file, made a zip file, uploaded it to AWS Lambda and got certified by Amazon. Now I need to make this more extensive where I need to have information about many diseases. Where can I store this huge data and how to retrieve it from my Lambda function? If using DynamoDB is the right way, then how to retrieve data from there from my Lambda function? Or Is there any other better way?
2 Answers
You'll likely need to set up account linking on your skill first. It can be a bit of a process, but check out this page here. I would suggest using Google or Amazon as your OAuth provider.
Account linking allows you to associate a particular user and their echo with an entry in a database you own. So after you have a user linked up with your database, you have two options.
Option 1 is (I believe) you can query your database directly from the Lambda service using any of the available languages.
Option 2, set up a web service that can get and set information in the database using some sort of RESTful service, and then make calls to that service instead.
It's not easy to get this kind of thing done, but It's very possible.
Edit: In addition, if you're looking to provide information on a lot of diseases, consider researching if there is an already available database of diseases, and if APIs exist to access it. This could save a lot of time for you.

- 805
- 1
- 11
- 27
-
What if there's an existing database that i need to access via alexa, and the functionality is pretty much the same as the asker. Instead of creating a new DB or migrating our existing DB to dynamo, is there a way to access my old, existing database,names MySQL? Please respond, thanks :) – Vishwanth Iron Heart Jan 04 '17 at 12:39
-
You can definitely access any database you'd like to within a lambda service. It seems like DynamoDB is the easiest, but if you were, for example, doing this in node, you can include a library to make SQL calls. – master565 Jan 11 '17 at 22:00
-
is there any way to store a simple data (ex: some 16 char id) without using account linking? – hasbi Dec 15 '17 at 13:19
-
1Yes, you can use the userID that is provided during a request and store all user related info in your database by connecting it to that ID. – master565 Dec 16 '17 at 23:22
DynamoDB seems to be the easiest way. Just add the aws-java-sdk-dynamodb dependency and interact with the database using AmazonDynamoDBClient
if you are using Java. You can just define the tables that you want using @DynamoDBTable
annotations. Go to https://console.aws.amazon.com/iam/home?#roles and create a role and add permission AmazonDynamoDBFullAccess
permission and you are all set.

- 4,377
- 7
- 26
- 40