Rainer Stropek
Leveraging Server-Sent Events (SSE) for Efficient Data Streaming in UI Development
#1about 6 minutes
The core problem of long-running HTTP requests
A simple demo illustrates poor user experience when a backend operation takes several seconds to complete, leaving the UI unresponsive.
#2about 6 minutes
Manually streaming data with HTTP chunks
Learn how to send partial responses from a Node.js server using `response.write` and process them on the client with `ReadableStream` and `TextDecoder`.
#3about 7 minutes
Introducing the Server-Sent Events protocol
The SSE protocol simplifies streaming by using a `data:` prefix and the browser's built-in `EventSource` API, which also handles automatic retries.
#4about 4 minutes
Using named events for structured messages
The SSE protocol supports sending named events using the `event:` key, allowing for more structured communication handled by specific event listeners on the client.
#5about 5 minutes
Ensuring reliable delivery with message IDs
Implement robust streaming by using the `id:` field in SSE messages, which enables the client to automatically send a `Last-Event-ID` header upon reconnecting.
#6about 7 minutes
Why SSE is relevant again because of OpenAI
OpenAI's streaming API uses Server-Sent Events extensively, leading to a resurgence of the technology for building real-time AI applications.
#7about 6 minutes
Building a streaming client for the OpenAI API
A practical demo shows how to use the OpenAI SDK, which abstracts SSE into a `for await` loop, and then stream the results from your server to the client using SSE.
#8about 12 minutes
Q&A on SSE implementation and best practices
Discussion covers topics like connection timeouts, keep-alive messages, server scalability for many connections, and use cases beyond text streaming.
Related jobs
Jobs that call for the skills explored in this talk.
Matching moments
25:37 MIN
Streaming data to web clients with SSE
Development of reactive applications with Quarkus
04:14 MIN
Comparing SSE, WebSockets, and polling for real-time data
Streaming AI Responses in Real-Time with SSE in Next.js & NestJS
28:30 MIN
Understanding SSE limitations and its key benefits
Streaming AI Responses in Real-Time with SSE in Next.js & NestJS
10:26 MIN
Implementing an SSE endpoint in NestJS for AI streaming
Streaming AI Responses in Real-Time with SSE in Next.js & NestJS
06:28 MIN
A full-stack architecture for streaming AI responses
Streaming AI Responses in Real-Time with SSE in Next.js & NestJS
12:42 MIN
Consuming SSE streams in Next.js with EventSource
Streaming AI Responses in Real-Time with SSE in Next.js & NestJS
21:27 MIN
Scaling SSE applications for thousands of concurrent users
Streaming AI Responses in Real-Time with SSE in Next.js & NestJS
14:57 MIN
Using SSE for notifications and real-time file sharing
Streaming AI Responses in Real-Time with SSE in Next.js & NestJS
Featured Partners
Related Videos
Streaming AI Responses in Real-Time with SSE in Next.js & NestJS
Ahmed Megahd
Snappy UI needs no Single-Page Application
Clemens Helm
Catching up on the basics you don't really need that much code
Chris Heilmann
Exploring the Latest Features of .NET and C# by Building a Game
Rainer Stropek
The Eventloop in JavaScript - How does it work?
Christian Woerz
Build UIs that learn - Discover the powerful combination of UI and AI
Eliran Natan
The Fundamentals of Online Video
Phil Cluff
The Lean Web
Chris Ferdinandi
From learning to earning
Jobs that call for the skills explored in this talk.


Senior Backend Engineer – AI Integration (m/w/x)
chatlyn GmbH
Vienna, Austria
Senior
JavaScript
AI-assisted coding tools
![Senior Software Engineer [TypeScript] (Prisma Postgres)](https://wearedevelopers.imgix.net/company/283ba9dbbab3649de02b9b49e6284fd9/cover/oKWz2s90Z218LE8pFthP.png?w=400&ar=3.55&fit=crop&crop=entropy&auto=compress,format)

Senior Software Engineer [TypeScript] (Prisma Postgres)
Prisma
Remote
Senior
Node.js
TypeScript
PostgreSQL


Full Stack Engineer JavaScript
Client Server
Charing Cross, United Kingdom
Remote
€50K
React
Node.js
JavaScript
+2
Full Stack Engineer | .NET & React | London
SGI
Charing Cross, United Kingdom
€81K
Intermediate
CSS
.NET
gRPC
Scrum
+7
Software Engineer Full Stack C# .Net React
Client Server
Cambridge, United Kingdom
Remote
€60-70K
Azure
React
Python
+2
Software Engineer Full Stack C# .Net React
Client Server
Charing Cross, United Kingdom
Remote
€60-70K
Azure
React
Python
+2
Software Developer Backend Elixir AI
Client Server
Charing Cross, United Kingdom
Remote
€90-130K
C++
Java
Elixir
+1


