# An API for my app

> I need a backend API that reads and writes a database. Nicolas Dao's picks for this job (Cloudless Labs, Sydney), in order of preference, what he would avoid, and what to use instead.

- Use case 1 of 21 in The Stack, last reviewed 21 October 2026
- Web page: https://cloudlesslabs.com/stack/use-cases/api/

Picks, in order of preference:

1. **[Lambda function URLs](https://cloudlesslabs.com/stack/aws-lambda-function-urls/index.md)** (My default): Start here. Free front door, one function per concern.
2. **[Neon (serverless Postgres)](https://cloudlesslabs.com/stack/neon/index.md)** (My default): Postgres over HTTP, no VPC or proxy needed.
3. **[Lambda Web Functions](https://cloudlesslabs.com/stack/aws-lambda-web-functions/index.md)** (Watching): Once it's in your region, move HTTP logic to one Express app with a shared connection pool.
4. **[Cloudflare Workers](https://cloudlesslabs.com/stack/cloudflare-workers/index.md)** (My default): In front, if users are global or traffic is huge (auth, rate limits, caching).

Don't:

- ~~GraphQL and AppSync~~: GraphQL turns your schema into a second product to maintain, and almost no app benefits from it. Plain HTTP endpoints on function URLs do the same job with nothing extra to keep in sync. Instead: [Lambda function URLs](https://cloudlesslabs.com/stack/aws-lambda-function-urls/index.md).
- ~~API Gateway~~: Useful, just not on day one. A function URL already gives you HTTPS, IAM auth, CORS and streaming with nothing else to configure. API Gateway adds routes, stages, deployments and integrations to keep in sync with your code, and a 29–30 second request timeout by default (a function URL allows 15 minutes). Add it when you need what only it does: per-customer API keys and usage plans, request validation, WAF on the endpoint, or writing straight into SQS. Function URLs use the same event format as HTTP APIs, so adding it later changes no code. Instead: [Lambda function URLs](https://cloudlesslabs.com/stack/aws-lambda-function-urls/index.md).

Worked example: [Lambda, Web Functions or Workers?](https://cloudlesslabs.com/stack/guides/compute-choice/index.md)

## The picks in brief

- [Lambda function URLs](https://cloudlesslabs.com/stack/aws-lambda-function-urls/index.md): My default. My favourite way to put Lambda on the internet. Every MVP starts here. Pricing: Free. You pay only for the Lambda invocation.
- [Neon (serverless Postgres)](https://cloudlesslabs.com/stack/neon/index.md): My default. My go-to Postgres. Scales to zero, branches like git, and talks HTTP so Lambda needs no VPC or proxy. Pricing: Launch plan $0.106 per compute-unit hour, Scale $0.222; storage $0.35/GB-month; no minimum. Available in Sydney.
- [Lambda Web Functions](https://cloudlesslabs.com/stack/aws-lambda-web-functions/index.md): Watching. A real Node.js web server on Lambda, billed on CPU used, 64 to 128 requests per environment. The future of HTTP business logic on AWS. Not in Sydney yet. Pricing: $0.30 per million requests + $0.0000279955 per active vCPU-second + $0.0000037065 per GB-second of memory consumed while the environment lives (Sydney price-list rates; not launched there yet). Free tier: not stated.
- [Cloudflare Workers](https://cloudlesslabs.com/stack/cloudflare-workers/index.md): My default. The edge primitive. It sits between your users and your real backend, and it's very, very good at that. Pricing: $5 a month per account, including 10M requests and 30M CPU-ms. Then $0.30 per million requests and $0.02 per million CPU-ms. Billed on CPU time only: waiting is free. No egress charges.

## Related

- [Lambda, Web Functions or Workers?](https://cloudlesslabs.com/stack/guides/compute-choice/index.md): the worked example for this job, with costs
- [Edge](https://cloudlesslabs.com/stack/layers/edge/index.md): every tool in this layer
- [Compute](https://cloudlesslabs.com/stack/layers/compute/index.md): every tool in this layer
- [APIs, queues and events](https://cloudlesslabs.com/stack/layers/api-events/index.md): every tool in this layer
- [Data](https://cloudlesslabs.com/stack/layers/data/index.md): every tool in this layer
- [Every use case and tool in one file](https://cloudlesslabs.com/stack/brief.md)
- [Map of every Markdown file on cloudlesslabs.com, with what each one answers](https://ask.cloudlesslabs.com)
