Skip to main content
Upstash Realtime is designed to be extremely cost-efficient. With minimal Redis commands per operation and smart connection management, you can build real-time features at scale without worrying about costs. Upstash Realtime is built on Redis Streams and Pub/Sub. Every operation translates to one or more Redis commands, detailed below.

Command Overview

Client-Side Operations

When using useRealtime in your React components:
OperationCommandsCount
Initial connectionSUBSCRIBE, XRANGE2
Reconnection every 300 secondsUNSUBSCRIBE, XRANGE, SUBSCRIBE3
Ping to keep connection alive every 60 secondsPUBLISH1

Server-Side Operations

When using the server-side API:
OperationCommandsCount
Emit eventPUBLISH, XADD2
Emit with expireAfterSecsPUBLISH, XADD, EXPIRE3
Read historyXRANGE1

Next Steps