Pages with tag AWS DynamoDB
Global and Local Secondary indexes in DynamoDB
Years ago, Amazon engineers studying SQL queries learned complex queries with JOINs and whatnot were not widely used, and from that observation developed DynamoDB. DynamoDB is a NoSQL database available in the Amazon cloud service offering. It has some interesting characteristics, one of which is the method to use secondary indexes.
How to get AWS SDK for Node.js to return Promises to use with async/await functions
The AWS SDK for JavaScript/Node.js documentation describes receiving results the old way, using a callback function. In the modern era of JavaScript we know what to do -- we wrap such functions in await new Promse, hold our nose, and embed the callback within the Promise. I published an article on the Sourcerer blog describing how to interact with DynamoDB from a Node.js Lambda function, and then a reader asked why it used "await new Promise". A bit of searching revealed that indeed Amazon had updated the SDK to support Promises, but it seems the SDK documentation has not been updated. What follows is a quick example of an AWS Lambda function calling DynamoDB methods using Promise objects in an async/await, and deployed using the Serverless Framework.