---
title: "Neon Functions: backend logic next to your data"
description: "Neon Functions are long-running Node.js 24 compute deployed onto a Neon branch, in the same region and on the same infrastructure as its Lakebase Postgres database, with DATABASE_URL and other Neon backend credentials injected automatically."
url: "https://swe.quest/articles/neon-functions-backend-logic-next-to-your-data-fe00336dce0040ff"
canonical: "https://neon.com/blog/neon-functions-backend-logic-next-to-your-data"
source: "Neon"
published: "2026-08-12"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 5
tags: ["serverless","postgres","realtime"]
---

# Neon Functions: backend logic next to your data

A post on [Neon](https://swe.quest/sources/neon.md), published 2026-08-12, 5 min read, Announcement. Original: [https://neon.com/blog/neon-functions-backend-logic-next-to-your-data](https://neon.com/blog/neon-functions-backend-logic-next-to-your-data)

## Summary

Neon Functions are long-running Node.js 24 compute deployed onto a Neon branch, in the same region and on the same infrastructure as its Lakebase Postgres database, with DATABASE\_URL and other Neon backend credentials injected automatically. Running next to the data removes the cross-network hop per query and lets a function keep a pg Pool open across requests, so agents can stream for minutes and WebSockets or SSE can fan out via Postgres LISTEN/NOTIFY. Functions branch with the database: each child branch gets its own function copy and URL, and deleting the branch deletes it. They are declared in neon.ts, Hono is the recommended framework, and the pg Pool is recommended over the serverless driver; functions are not for frontend hosting or background jobs, and cron and event triggers are planned.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Real-time systems](https://swe.quest/tags/realtime.md) (Backend & APIs)

## Prerequisites

- Postgres basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- serverless functions ([easy posts on Serverless](https://swe.quest/tags/serverless.md?difficulty=easy))
- Node.js ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))

## Keywords

Neon Functions, Lakebase Postgres, Hono, neon.ts, LISTEN/NOTIFY, Node.js, AI Gateway

## Related posts

- [Simplify Serverless in AWS: How to Use Neon and Ephemeral Environments](https://swe.quest/articles/simplify-serverless-in-aws-how-to-use-neon-and-ephemeral-environments-81cd9c7a09760341.md): Neon · 2025-05-05 · Medium · 10 min read · PostgreSQL, Serverless, CI/CD, Testing, JavaScript
  Neon's serverless Postgres pairs well with ephemeral environments on AWS Lambda because each environment can get its own instant copy-on-write database branch without paying for extra RDS uptime.
- [Understanding Neon’s object hierarchy](https://swe.quest/articles/understanding-neon-s-object-hierarchy-93be958b09bed77b.md): Neon · 2023-06-07 · Easy · 4 min read · PostgreSQL, Serverless, Databases
  Neon organizes serverless Postgres into projects, branches and compute endpoints, built on a separation of storage and compute that avoids sizing a database upfront.
- [SELECT ’Hello, World’](https://swe.quest/articles/select-hello-world-151ac208b5f708c9.md): Neon · 2022-06-15 · Easy · 5 min read · PostgreSQL, Storage engines, Serverless, Cloud platforms, Multi-tenancy
  Neon is a serverless Postgres service built on separated storage and compute, launching behind a waitlist.
- [Web-based AI SQL Playground and connecting to Postgres from the browser](https://swe.quest/articles/web-based-ai-sql-playground-and-connecting-to-postgres-from-the-browser-fa7f4eccd9643a37.md): Neon · 2023-05-19 · Medium · 5 min read · PostgreSQL, LLMs, Serverless, JavaScript
  Neon's Postgres AI Playground connects to a Postgres database directly from the browser and uses OpenAI's gpt-3.5-turbo to turn natural-language prompts into SQL.
- [How to use Postgres at the Edge](https://swe.quest/articles/how-to-use-postgres-at-the-edge-9d5045c1101b2176.md): Neon · 2023-09-19 · Medium · 4 min read · PostgreSQL, Serverless, CDN & edge, JavaScript
  Standard Postgres can't be reached from V8-isolate edge runtimes like Vercel Edge Functions because they don't support raw TCP.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
