# Build a serverless recipe-sharing API with Go and Amazon Aurora DSQL

DevFeed: [Build a serverless recipe-sharing API with Go and Amazon Aurora DSQL](<https://devfeed.tech/articles/build-a-serverless-recipe-sharing-api-with-go-and-amazon-aurora-dsql-131173.md>)

Original publisher: [Read original article](<https://aws.amazon.com/blogs/database/build-a-serverless-recipe-sharing-api-with-go-and-amazon-aurora-dsql/>)

Author: Steve Brown

Published: 2026-11-12T16:14:20Z

Content type: tutorial

Language: en

Sources: [AWS Database Blog](<https://devfeed.tech/sources/aws-database-blog.md>)

Topics: [DSQL](<https://devfeed.tech/topics/dsql.md>), [Serverless](<https://devfeed.tech/topics/serverless.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [Erlang](<https://devfeed.tech/topics/erlang.md>)

Tags: [amazon-api-gateway](<https://devfeed.tech/tags/amazon-api-gateway.md>), [amazon-aurora](<https://devfeed.tech/tags/amazon-aurora.md>), [aws-lambda](<https://devfeed.tech/tags/aws-lambda.md>), [cloudformation](<https://devfeed.tech/tags/cloudformation.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [distribution](<https://devfeed.tech/tags/distribution.md>), [dsql](<https://devfeed.tech/tags/dsql.md>), [go](<https://devfeed.tech/tags/go.md>), [iam](<https://devfeed.tech/tags/iam.md>), [integrity](<https://devfeed.tech/tags/integrity.md>), [intermediate-200](<https://devfeed.tech/tags/intermediate-200.md>), [keys](<https://devfeed.tech/tags/keys.md>), [optimistic-concurrency](<https://devfeed.tech/tags/optimistic-concurrency.md>), [recipe](<https://devfeed.tech/tags/recipe.md>), [referential-integrity](<https://devfeed.tech/tags/referential-integrity.md>), [rest-api](<https://devfeed.tech/tags/rest-api.md>), [retries](<https://devfeed.tech/tags/retries.md>), [serverless](<https://devfeed.tech/tags/serverless.md>), [technical-how-to](<https://devfeed.tech/tags/technical-how-to.md>), [token](<https://devfeed.tech/tags/token.md>), [uuid](<https://devfeed.tech/tags/uuid.md>)

## AI overview

The article demonstrates a Go recipe-sharing REST API that runs locally as a Gin HTTP server or on AWS Lambda behind API Gateway, using the same handlers and an Amazon Aurora DSQL store. It describes UUID text primary keys to spread writes across storage partitions; short-lived IAM tokens, TLS, and a pgx connection pool managed by the Go connector; and separate DDL operations because DDL and DML cannot share a transaction. The sample checks chef and recipe references in handlers, though the database can enforce them with foreign keys instead. Aurora DSQL optimistic concurrency conflicts can be retried by the connector's occretry package with exponential backoff, so transaction logic should be idempotent. Deployment uses a script and CloudFormation for Lambda, API Gateway, IAM, and logs; its IP allowlist is not authentication, and the article recommends adding an authorization method for production. The text also notes connection recycling before the 60-minute server limit and low pool sizing for single-request Lambda invocations.

## Source excerpt

Build a fully serverless recipe-sharing REST API in Go on Amazon Aurora DSQL, AWS Lambda, and Amazon API Gateway. Learn UUID primary keys for even write distribution, short-lived IAM token authentication, application-layer referential integrity, and automatic optimistic-concurrency retries, with a one-command CloudFormation deployment.