Skip to main content
Configure Upstash Realtime for optimal performance on serverless platforms.
Deploy Upstash Realtime to providers that bill based on active CPU time. Great places to deploy are Vercel with Fluid Compute enabled, Cloudflare, Railway, a personal VPS or any other service that does not bill based on connection duration.

Deploying to Vercel

To deploy Upstash Realtime to Vercel, enable Fluid Compute for your project. For new projects, this is enabled by default. Fluid Compute allows for less cold-starts, has much higher function timeouts compared to serverless functions, and most importantly only bills for active CPU time. That way, you’re only billed for actual message processing time, not connection duration.

Billing Example

Traditional serverless connection billing:
Serverless Billing
Connection duration: 5 minutes
Billing: 5 minutes = $$$
Upstash Realtime with fluid compute:
Fluid Compute Billing
Connection duration: 5 minutes
Active processing: 2 seconds
Billing: 2 seconds x CPU cost = $

Automatic Reconnection

The client automatically reconnects before your function timeout:
page.tsx
"use client"

import { useRealtime } from "@upstash/realtime/client"

export default function Component() {
  // 👇 'connecting' | 'connected' | 'reconnecting' | 'disconnected'
  const { status } = useRealtime<RealtimeEvents>({
    events: {
      notification: {
        alert: (data) => console.log(data),
      },
    },
  })

  return <div>Status: {status}</div>
}

Message Delivery Guarantee

Upstash Realtime is powered by Redis Streams:
1

Client Connects

Establishes connection and subscribes to stream
2

Timeout Approaching

Client disconnects before function timeout
3

Automatic Reconnection

Client reconnects in milliseconds
4

Stream Replay

Redis auto-replays all messages sent during reconnect