---
title: "Sub-10ms Postgres queries for Vercel Edge Functions"
description: "Neon's serverless Postgres driver now supports SQL-over-HTTP via fetch, and Neon's proxy adds opt-in experimental connection caching (`fetchConnectionCache`)."
url: "https://swe.quest/articles/sub-10ms-postgres-queries-for-vercel-edge-functions-6bc9caef6fab65ca"
canonical: "https://neon.com/blog/sub-10ms-postgres-queries-for-vercel-edge-functions"
source: "Neon"
published: "2023-07-10"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 3
tags: ["postgres","serverless","cdn-edge","performance","typescript"]
---

# Sub-10ms Postgres queries for Vercel Edge Functions

A post on [Neon](https://swe.quest/sources/neon.md), published 2023-07-10, 3 min read, Announcement. Original: [https://neon.com/blog/sub-10ms-postgres-queries-for-vercel-edge-functions](https://neon.com/blog/sub-10ms-postgres-queries-for-vercel-edge-functions)

## Summary

Neon's serverless Postgres driver now supports SQL-over-HTTP via fetch, and Neon's proxy adds opt-in experimental connection caching (\`fetchConnectionCache\`). Together they cut query latency from Vercel Serverless and Edge Functions by about 40%, bringing same-region one-shot queries to single-digit milliseconds. Use the \`neon\` HTTP function for a single query per invocation and \`Pool\` when a function runs multiple queries. Drizzle-ORM also supports the driver for type-safe queries.

Written by swe.quest, not by the author.

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

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)
- [CDN & edge](https://swe.quest/tags/cdn-edge.md) (Infrastructure)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)

## 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))

## Keywords

Neon, Vercel Edge Functions, @neondatabase/serverless, Drizzle-ORM, SQL-over-HTTP

## Related posts

- [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.
- [HTTP vs. WebSockets: Which protocol for your Postgres queries at the Edge](https://swe.quest/articles/http-vs-websockets-which-protocol-for-your-postgres-queries-at-the-edge-25a9317092665f21.md): Neon · 2023-07-11 · Medium · 5 min read · PostgreSQL, Serverless, Performance engineering, CDN & edge, Networking
  Neon's serverless Postgres driver now supports SQL-over-HTTP alongside WebSockets, and benchmarks from Vercel Edge and Serverless functions (iad1 to us-east-1) show each wins in different cases.
- [@neondatabase/serverless hits 1.0.0](https://swe.quest/articles/neondatabase-serverless-hits-1-0-0-d5430675bc92b751.md): Neon · 2025-03-25 · Medium · 5 min read · PostgreSQL, Serverless, TypeScript, Application security, JavaScript
  Neon's JavaScript/TypeScript serverless driver, which carries Postgres queries over HTTP and WebSockets for environments without raw TCP such as V8 isolates and browsers, reaches 1.0.0 after a refactor that adds auto-generated types via api-extractor and CI tests across Node, Bun, Deno, browsers, Cloudflare Workers, Vercel and the Prisma/Drizzle adapters.
- [Edge-compatible Serverless Driver for Postgres](https://swe.quest/articles/edge-compatible-serverless-driver-for-postgres-9b0d09c6c7a067d0.md): Neon · 2022-12-08 · Medium · 9 min read · PostgreSQL, Serverless, Networking, Cryptography, WebAssembly
  Neon's @neondatabase/serverless driver lets V8-isolate platforms like Cloudflare Workers, which lack TCP, speak the real Postgres wire protocol by tunnelling it over a WebSocket to an open-source Go proxy that relays to TCP.
- [Quicker serverless Postgres connections](https://swe.quest/articles/quicker-serverless-postgres-connections-7a37a1071edd4362.md): Neon · 2023-03-28 · Medium · 8 min read · PostgreSQL, Networking, Serverless, Performance engineering, Cryptography
  Neon cut the network round-trips needed to get a first query result from its WebSocket-based serverless Postgres driver from nine to four.

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)
