Serverless distributed NoSQL
Build at the speed of an idea with AWS Databases. Create a new database in seconds and add features on-demand as your application grows. Focus on coding, not infrastructure management—our serverless, fully managed PostgreSQL and NoSQL databases automatically scale with your workload while you only pay for what you use. Whether you're prototyping your next big idea or powering production AI and data-driven applications, AWS Databases deliver the security, reliability, and price performance you need without the operational overhead.
Get started for free with $100 in credits towards any of these databases.
This guide demonstrates how to build a simple Hello World Next.js web application. You can also alternatively use our sample template to get started with a Vercel project and Amazon DynamoDB database.
The application, hosted on Vercel, establishes secure database connections without hardcoded access credentials by leveraging Vercel's OIDC Federation and DynamoDB IAM authentication.
Connecting your project links the relevant environment variables. To use these variables in your local development environment, run:
vercel env pullAurora Serverless is fully postgresql compatible. In this guide, we use the node-postgres but you use any next.js and postgreSQL compatible driver of your choice.
npm install @aws-sdk/client-dynamodb @aws-sdk/lib-dynamodb @vercel/functionsCreate the database handler functions:
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";import { awsCredentialsProvider } from "@vercel/functions/oidc";
const client = new DynamoDBClient({ region: process.env.AWS_REGION, credentials: awsCredentialsProvider({ roleArn: process.env.AWS_ROLE_ARN, clientConfig: { region: process.env.AWS_REGION }, }),});
export const docClient = DynamoDBDocumentClient.from(client);You can update the page.tsx file in your starter project in the following manner to display the comment from the database.
import { docClient } from '@/lib/db';import { ScanCommand } from "@aws-sdk/lib-dynamodb";
export default async function Page() { const response = await docClient.send(new ScanCommand({ TableName: process.env.DYNAMODB_TABLE_NAME })); const comments = response.Items ?? [];
return ( <main className="main"> <h1 className="title">Next.js + DynamoDB</h1>
<div className="container"> {comments.map(comment => ( <div> <p>{comment.comment}</p> <div className="metadata">{comment.id}</div> </div> ))} </div> </main> );}You're now ready to start your app locally:
npm run devNavigate to https://localhost:3000
Once ready, you can deploy your application to Vercel.
Select your preferred product and proceed to install. New to AWS? Create a new AWS account with $100 in credit - no credit card required (under free plan). Your credits remain available even after upgrading to a paid account later.
Under the free plan, new AWS customers get $100 in free credits to explore all eligible AWS services—valid for 6 months, no strings attached. As your needs grow, simply upgrade to a paid plan and scale beyond free tier limits. All billing is handled directly through AWS.