Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 10 min read Announcement mediumAdept

Neon now has realtime

Neon Realtime, now in free public beta, turns any read-only deterministic SQL query (joins, aggregates, window functions, subqueries) into a live query whose result stays updated as data changes, running inside Postgres rather than as a separate realtime service. A TypeScript SDK lets backends define queries via raw SQL, Drizzle or Kysely and "seal" them so browsers or agents can subscribe safely, with React's useLiveQuery, optimistic writes confirmed via awaitTxId, SSR and TanStack DB support. Clients connect to Neon's ingress layer so subscriptions don't block scale-to-zero, incremental maintenance runs on a replica without consuming connections, and Realtime is enabled per branch. Beta limits include no row-level security, no published benchmarks, a changing protocol and four regions.

Related posts

  • TanStack DB with Sync – the future of real-time UI

    Neon mediumAdept

    Pairing TanStack DB with the ElectricSQL sync engine gives web apps end-to-end real-time updates and optimistic mutations, with Postgres as the source of truth. ElectricSQL uses Postgres logical replication and HTTP long-polling to push changes to clients and handles reads only, so writes still go through normal server actions or APIs. TanStack DB collections map to tables, apply optimistic inserts, updates and deletes through callbacks that roll back on failure, and support live queries with SQL-like filters and joins. A Next.js and Neon contacts demo shows the collection setup, the live queries, and a proxy endpoint that enforces auth and adds per-user row filters before forwarding requests to Electric.

  • @neondatabase/serverless hits 1.0.0

    Neon mediumAdept

    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. Tagged-template queries are now composable, because placeholder numbering is deferred until execution. A breaking change makes calling sql(...) as a plain function an error, since that form used ordinary string interpolation and invited SQL injection. New sql.query and sql.unsafe helpers cover the parameterized and trusted-raw-SQL cases. Binary inserts over HTTP now hex-encode roughly 10x faster, though WebSockets remain the recommended path for large blobs.

  • Neon Functions: backend logic next to your data

    Neon mediumAdept

    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.

  • Realtime: Broadcast from Database

    Supabase mediumAdept

    Supabase Realtime's Broadcast from Database sends database change events to clients through Postgres triggers that write to a `realtime.messages` table. Realtime reads that table via a replication slot on its WAL publication and broadcasts each new row to the target channel immediately. Compared with polling-based Postgres Changes it needs more setup (RLS policies, a trigger function using `realtime.broadcast_changes` or `realtime.send`, and private channels on the client). In return it can target specific operations, send only chosen columns, route messages to channels with SQL, and scale to tens of thousands of concurrent subscribers. `realtime.send` catches exceptions and reports errors via `pg_notify`, so a failed send does not break the trigger.

  • Sub-10ms Postgres queries for Vercel Edge Functions

    Neon mediumAdept

    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.

The quest for software engineering knowledge.

Look:
Layout: