Server-Sent Events (SSE)

Most commonly on the web, HTTP involves the client repeatedly sending requests, and for each, the server sends back responses. This works for most applications but is not performant enough for real-time applications. The most performance-sensitive applications (like multi-player real-time games) use WebSocket sessions instead of normal stateless HTTP connections. This boosts performance but at the cost of complexity — now the server needs to manage both HTTP and WebSocket sessions. Plus, the WebSocket sessions are stateful and inherently more complex than HTTP sessions.

There’s a third option — Server-Sent Events (SSE), which is a middle ground between these two. SSE still uses HTTP machinery (so there’s less complexity), but like WebSockets, they are stateful. They are less performant than WebSockets but still fast enough for real-time applications like chat notifications. Unlike WebSockets, SSE is one-way (server → client), but this is sufficient for many applications.

So there’s a complexity vs. performance tradeoff, from the simplest to the most complex and performant:

  • Normal HTTP → HTTP Server-Sent Events → WebSockets.
Read More

Blood, Sweat and Pixels (Book Review)

A while ago, I came across the book Blood, Sweat and Pixels, which is a fascinating glimpse inside the world of video game development. I am not a video game player, but I am a Software Engineer, so I could relate to many of the development aspects & difficulties. Especially the grind and unrealistic deadlines were relatable for me, as I have also sometimes had to work with tight deadlines, though thankfully much less than was portrayed in this book about the development of video games.

Read More