Requesting Serverless Sample using Managed CockroachDB in AWS



With CockroachDB as a Managed service in AWS, it becomes an attractive option for those who are architecting fully serverless solutions in AWS and need scalable SQL (beyond and cheaper than AWS RDS).

The latest serverless API trend in AWS is to implement your APIs as GraphQL APIs, using AWS AppSync. Most of the sample code and examples out there show how to use AppSync with Amazon’s NoSQL database, DynamoDB, however Amazon has published a really nifty sample project which shows how to implement an entirely serverless GraphQL API which is backed by a relational database-as-a-service (RDS) in AWS, using AWS Lambda functions to marshal the data between the database and AppSync.

The project implements a GraphQL API (much nicer than REST) using AWS AppSync. When API calls are made, AppSync in turn calls an AWS Lambda function, and this Lambda function in turn call the database service. I would love to see sample code (Node.js) for an AWS lambda function that accesses a Managed CockroachDB cluster in AWS, as well as instructions on how to configure such a lambda function. This would answer some of my questions such as how to deal with the client IP whitelist when the client is an AWS Lambda function, and also how to deal with the client cert within the lambda function.

I think such a sample would be a real benefit to many of the developers out there who are contemplating using Managed CockroachDB in AWS.