Prisma Pulse is a real-time database change stream API that lets you react to database changes instantly. No polling, no webhooks, no complex CDC setup — just subscribe to changes and get notified.
Why Prisma Pulse Changes Everything
A developer building a collaborative document editor was polling their database every 500ms to check for changes. Their server was handling 120 requests/second just for polling. With Prisma Pulse, they replaced all of that with a single subscription.
Key Features:
- Real-time Change Streams — Subscribe to INSERT, UPDATE, DELETE events
- Type-safe — Full TypeScript support with Prisma's type system
- Filtered Subscriptions — Only receive changes matching your criteria
- Resumable Streams — Pick up where you left off after disconnection
- Works with Any Database — PostgreSQL support with more coming
Quick Start
npm install @prisma/extension-pulse
import { PrismaClient } from "@prisma/client"
import { withPulse } from "@prisma/extension-pulse"
const prisma = new PrismaClient().$extends(withPulse({ apiKey: process.env.PULSE_API_KEY }))
// Subscribe to all new users
const subscription = await prisma.user.subscribe({
create: {}
})
for await (const event of subscription) {
console.log("New user created:", event.created)
}
Filtered Subscriptions
// Only get notified about high-value orders
const subscription = await prisma.order.subscribe({
create: {
after: {
amount: { gt: 1000 }
}
}
})
for await (const event of subscription) {
await sendSlackAlert(`High-value order: \$${event.created.amount}`)
}
Real-World Use Cases
- Live dashboards — Update metrics in real-time
- Notifications — Trigger alerts on specific database changes
- Cache invalidation — Automatically clear cache when data changes
- Audit logs — Track every change to critical data
- Sync systems — Keep multiple services in sync
Getting Started
Visit Prisma Pulse docs to set up your first real-time subscription.
Need real-time data from the web? Check out my Apify actors for production-ready web scraping tools, or email spinov001@gmail.com for custom data extraction solutions.
Top comments (0)