<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Cortlet]]></title><description><![CDATA[Cortlet]]></description><link>https://blog.cortlet.com</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Nov 2026 10:06:51 GMT</lastBuildDate><atom:link href="https://blog.cortlet.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Why WebSocket Infrastructure Gets Cloud-Specific Fast]]></title><description><![CDATA[Why serverless WebSocket infrastructure becomes cloud-specific, and how provider APIs can create vendor lock-in and migration complexity.]]></description><link>https://blog.cortlet.com/why-websocket-infrastructure-gets-cloud-specific-fast</link><guid isPermaLink="true">https://blog.cortlet.com/why-websocket-infrastructure-gets-cloud-specific-fast</guid><category><![CDATA[websockets]]></category><category><![CDATA[serverless]]></category><category><![CDATA[Cloud]]></category><category><![CDATA[backend]]></category><category><![CDATA[infrastructure]]></category><category><![CDATA[vendor lock-in]]></category><category><![CDATA[realtime]]></category><category><![CDATA[devtools]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Cloud Computing]]></category><dc:creator><![CDATA[Cortlet Support]]></dc:creator><pubDate>Wed, 09 Sep 2026 09:59:47 GMT</pubDate><content:encoded><![CDATA[<p>Serverless is often sold around flexibility.</p>
<p>You write a function, deploy it, and let the platform handle the infrastructure.</p>
<p>But once WebSockets enter the picture, things can become surprisingly provider-specific.</p>
<p>The application may still be written in familiar JavaScript, Python, Go, or another language.</p>
<p>The realtime infrastructure around it often is not.</p>
<h2>WebSockets need more than compute</h2>
<p>A normal serverless HTTP endpoint can usually stay fairly portable.</p>
<p>Conceptually, the application receives:</p>
<p><code>HTTP Request → Function → HTTP Response</code></p>
<p>Move that function from one provider to another and the surrounding code may need changes, but the basic programming model is still familiar.</p>
<p>WebSockets introduce another layer.</p>
<p>Something has to:</p>
<ul>
<li><p>keep connections alive</p>
</li>
<li><p>assign connection identities</p>
</li>
<li><p>route incoming messages</p>
</li>
<li><p>track connection lifecycle events</p>
</li>
<li><p>send outbound messages back to active clients</p>
</li>
<li><p>handle authentication and permissions</p>
</li>
</ul>
<p>Cloud providers solve those problems differently.</p>
<p>That is where portability starts to disappear.</p>
<h2>The gateway becomes part of the application architecture</h2>
<p>Imagine a backend running on a serverless platform.</p>
<p>To add WebSockets, the developer may introduce a managed gateway.</p>
<p>Now the application no longer talks directly to a socket.</p>
<p>Instead, it talks through provider-specific concepts such as:</p>
<ul>
<li><p>connection IDs</p>
</li>
<li><p>route keys</p>
</li>
<li><p>gateway management APIs</p>
</li>
<li><p>IAM permissions</p>
</li>
<li><p>provider-specific event payloads</p>
</li>
<li><p>deployment configuration</p>
</li>
<li><p>infrastructure templates</p>
</li>
</ul>
<p>Those concepts can slowly spread into application code.</p>
<p>The realtime layer stops being just infrastructure.</p>
<p>It becomes part of how the application itself is designed.</p>
<h2>Sending a message back can become provider-specific</h2>
<p>A traditional WebSocket server owns the connection directly.</p>
<p>The application can conceptually do:</p>
<p><code>socket.send(message)</code></p>
<p>With a managed serverless gateway, the backend may instead need to call a provider-specific API.</p>
<p>The application now needs to know:</p>
<ul>
<li><p>which connection ID to target</p>
</li>
<li><p>which gateway endpoint to call</p>
</li>
<li><p>which SDK or HTTP API to use</p>
</li>
<li><p>which credentials are required</p>
</li>
<li><p>how that provider represents disconnected clients</p>
</li>
</ul>
<p>That is manageable when the application stays on one platform.</p>
<p>But it makes migration harder.</p>
<h2>Moving clouds can mean redesigning realtime</h2>
<p>Suppose an application begins on one cloud provider.</p>
<p>Later, the team wants to move some workloads elsewhere.</p>
<p>The HTTP business logic may be relatively portable.</p>
<p>The WebSocket layer can be much harder.</p>
<p>A realtime architecture designed around one provider’s gateway, permissions, connection store, routing system, and callback API may not have a direct equivalent somewhere else.</p>
<p>So migration can become more than:</p>
<blockquote>
<p>“Deploy the functions somewhere new.”</p>
</blockquote>
<p>It can become:</p>
<blockquote>
<p>“Redesign how realtime communication works.”</p>
</blockquote>
<p>That is a much larger decision.</p>
<h2>Third-party platforms can introduce a different kind of lock-in</h2>
<p>Cloud providers are not the only source of platform-specific architecture.</p>
<p>Realtime services can simplify WebSockets significantly, but they may introduce their own SDKs, channel models, presence systems, event formats, and client libraries.</p>
<p>Those abstractions are often useful.</p>
<p>But the more application code depends on them, the more expensive it becomes to leave later.</p>
<p>A developer may start with:</p>
<blockquote>
<p>“We just need realtime.”</p>
</blockquote>
<p>and eventually have application logic tightly coupled to one realtime provider.</p>
<h2>What would a more neutral layer look like?</h2>
<p>One alternative is to keep the interface between the realtime layer and the application extremely ordinary.</p>
<p>For example:</p>
<p><code>Client → WebSocket Gateway → HTTP Webhook → Backend</code></p>
<p>The client speaks standard WebSocket.</p>
<p>The backend speaks standard HTTP.</p>
<p>The gateway handles the translation.</p>
<p>That reduces the amount of provider-specific logic that has to leak into the application.</p>
<p>The backend does not need to know whether the persistent connection layer is running on AWS, Azure, another cloud, or dedicated infrastructure.</p>
<p>It only needs an HTTP endpoint.</p>
<h2>HTTP is a useful boundary</h2>
<p>HTTP is not exciting.</p>
<p>That is part of why it works so well as an interface.</p>
<p>Almost every backend platform understands it.</p>
<p>Almost every serverless provider supports it.</p>
<p>Local development tools understand it.</p>
<p>Testing tools understand it.</p>
<p>If the WebSocket layer can communicate with the application through ordinary HTTP, then the boundary between the two becomes much easier to move.</p>
<p>The application depends on a protocol instead of a cloud-specific architecture.</p>
<h2>This is part of what we are exploring with Cortlet</h2>
<p>With <strong>Cortlet</strong>, we are exploring a WebSocket gateway whose job is deliberately narrow.</p>
<p>The client uses a normal WebSocket connection.</p>
<p>Cortlet owns the persistent connection.</p>
<p>The application receives normal HTTP webhooks.</p>
<p>The goal is to avoid forcing the application itself to understand the infrastructure that keeps those connections alive.</p>
<p>That could make it easier to keep the realtime layer separate from the rest of the backend.</p>
<h2>Portability is really about boundaries</h2>
<p>No infrastructure is completely vendor-independent.</p>
<p>Something always has to run somewhere.</p>
<p>But applications become easier to move when the boundaries between systems use familiar, open interfaces.</p>
<p>For serverless WebSockets, the important question may not be:</p>
<p><strong>Which cloud has the best WebSocket product?</strong></p>
<p>It may be:</p>
<p><strong>How much cloud-specific WebSocket infrastructure should application code need to know about at all?</strong></p>
]]></content:encoded></item><item><title><![CDATA[Why Sending a WebSocket Reply From Serverless Feels Weird]]></title><description><![CDATA[Why replying over WebSockets gets complicated on serverless backends, and how callback APIs add extra infrastructure and code.]]></description><link>https://blog.cortlet.com/why-sending-a-websocket-reply-from-serverless-feels-weird</link><guid isPermaLink="true">https://blog.cortlet.com/why-sending-a-websocket-reply-from-serverless-feels-weird</guid><category><![CDATA[websockets]]></category><category><![CDATA[serverless]]></category><category><![CDATA[backend]]></category><category><![CDATA[realtime]]></category><category><![CDATA[api]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Cloud]]></category><category><![CDATA[infrastructure]]></category><category><![CDATA[devtools]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Cortlet Support]]></dc:creator><pubDate>Tue, 08 Sep 2026 09:05:36 GMT</pubDate><content:encoded><![CDATA[<p>With a normal HTTP API, the response path is obvious.</p>
<p>A client sends a request.</p>
<p>The server processes it.</p>
<p>The server returns a response.</p>
<p>That mental model is so familiar that developers barely think about it.</p>
<p>WebSockets on serverless infrastructure can feel very different.</p>
<p>A client sends a message over a WebSocket, the gateway triggers a serverless function, and then the developer discovers something strange:</p>
<p><strong>Returning JSON from the function does not always mean that JSON goes back to the WebSocket client.</strong></p>
<p>That is where the architecture starts feeling less intuitive.</p>
<h2>HTTP has a natural request-response flow</h2>
<p>A normal HTTP interaction looks like this:</p>
<p><code>Client → HTTP Request → Serverless Function → HTTP Response → Client</code></p>
<p>The response already knows where it needs to go.</p>
<p>The function returns data, the platform sends it back to the caller, and the interaction is finished.</p>
<p>WebSockets are different because the connection often lives somewhere outside the serverless function itself.</p>
<p>A simplified architecture might look like:</p>
<p><code>Client → WebSocket Gateway → Serverless Function</code></p>
<p>The gateway owns the persistent socket.</p>
<p>The function only receives an event.</p>
<p>That means the function does not necessarily own the response channel.</p>
<h2>The return value may not be the socket response</h2>
<p>Imagine a client sends:</p>
<p><code>{"action":"ping"}</code></p>
<p>The gateway forwards that event to a serverless function.</p>
<p>The function processes it and returns:</p>
<p><code>{"message":"pong"}</code></p>
<p>It would be reasonable to expect that response to travel back to the same client.</p>
<p>But in many serverless WebSocket setups, that is not the default behavior.</p>
<p>The function return value may simply indicate that the backend invocation completed successfully.</p>
<p>To actually send data back over the WebSocket, the backend may need to make a separate call to the gateway.</p>
<p>Conceptually, the flow becomes:</p>
<p><code>Client → WebSocket Gateway → Function</code></p>
<p>and then:</p>
<p><code>Function → Gateway Management API → Client</code></p>
<p>That is very different from ordinary HTTP.</p>
<h2>Now the backend needs to know the connection</h2>
<p>To send that second request, the backend usually needs some form of connection identifier.</p>
<p>That means the function may need to know:</p>
<ul>
<li><p>which connection sent the original message</p>
</li>
<li><p>whether that connection is still active</p>
</li>
<li><p>which gateway endpoint should receive the callback</p>
</li>
<li><p>how to authenticate the callback request</p>
</li>
<li><p>what to do if the connection disappeared before the response arrives</p>
</li>
</ul>
<p>The response path has now become its own piece of infrastructure.</p>
<p>A simple:</p>
<blockquote>
<p>receive message → process → return response</p>
</blockquote>
<p>can turn into:</p>
<blockquote>
<p>receive event → extract connection ID → process event → initialize gateway client → send callback → handle stale connection</p>
</blockquote>
<p>None of those steps are impossible.</p>
<p>They are just additional machinery.</p>
<h2>Why serverless makes this more noticeable</h2>
<p>On a traditional WebSocket server, the active socket object is often already available in memory.</p>
<p>Conceptually, the application can do something like:</p>
<p><code>socket.send(response)</code></p>
<p>The same process that received the message still owns the connection.</p>
<p>With serverless, that assumption disappears.</p>
<p>The function processing the event may have no direct access to the underlying WebSocket at all.</p>
<p>The connection belongs to another layer.</p>
<p>That separation is useful for scaling, but it changes the developer experience.</p>
<h2>Async workloads make it even more complicated</h2>
<p>The response path becomes even more important when the work cannot finish immediately.</p>
<p>Suppose a WebSocket message starts a longer-running job.</p>
<p>The initial function might place the work onto a queue and exit.</p>
<p>Later, another worker finishes the job.</p>
<p>Now that worker needs to send the result back to the original client.</p>
<p>The architecture might become:</p>
<p><code>Client → WebSocket Gateway → Function → Queue → Worker</code></p>
<p>followed by:</p>
<p><code>Worker → Gateway API → WebSocket Client</code></p>
<p>At that point, the application needs some way to preserve the relationship between the original connection and the eventual result.</p>
<p>Again, the application starts managing transport infrastructure alongside its actual business logic.</p>
<h2>What if the webhook response could become the socket response?</h2>
<p>There is another possible model.</p>
<p>Imagine this:</p>
<p><code>Client → WebSocket → Gateway → HTTP Webhook</code></p>
<p>The backend receives an ordinary HTTP request.</p>
<p>Then it simply returns:</p>
<p><code>200 OK</code></p>
<p>with:</p>
<p><code>{"message":"pong"}</code></p>
<p>The gateway takes that HTTP response and automatically sends it back over the originating WebSocket connection.</p>
<p>The developer gets a familiar programming model:</p>
<p><code>WebSocket message → HTTP request → HTTP response → WebSocket message</code></p>
<p>The persistent connection still exists.</p>
<p>But the backend does not need a special SDK or a second callback request for a basic response.</p>
<h2>This is one of the ideas behind Cortlet</h2>
<p>With <strong>Cortlet</strong>, we are exploring whether WebSocket infrastructure can feel more like ordinary HTTP infrastructure.</p>
<p>The gateway would own the persistent connection.</p>
<p>The backend would receive standard HTTP webhooks.</p>
<p>For simple request-response interactions, the HTTP response could potentially become the WebSocket response automatically.</p>
<p>More complex asynchronous flows could still use explicit outbound APIs when needed.</p>
<p>The goal is not to hide how WebSockets work.</p>
<p>It is to remove infrastructure steps that the application should not need to repeat for every message.</p>
<h2>Familiar interfaces matter</h2>
<p>Developers already understand HTTP extremely well.</p>
<p>Requests come in.</p>
<p>Responses go out.</p>
<p>Serverless platforms are designed around that model.</p>
<p>If a WebSocket gateway can translate persistent connections into that familiar request-response flow, realtime applications may require less WebSocket-specific backend code.</p>
<p>And that leads to a useful question:</p>
<p><strong>If the backend already knows how to return an HTTP response, why should sending a basic WebSocket reply require an entirely separate code path?</strong></p>
]]></content:encoded></item><item><title><![CDATA[Why Serverless WebSockets Need a Connection Database]]></title><description><![CDATA[Why serverless WebSockets often need a database for connection state, and how that adds complexity to realtime backend infrastructure.]]></description><link>https://blog.cortlet.com/why-serverless-websockets-need-a-connection-database</link><guid isPermaLink="true">https://blog.cortlet.com/why-serverless-websockets-need-a-connection-database</guid><category><![CDATA[websockets]]></category><category><![CDATA[serverless]]></category><category><![CDATA[backend]]></category><category><![CDATA[Databases]]></category><category><![CDATA[infrastructure]]></category><category><![CDATA[AWS]]></category><category><![CDATA[realtime]]></category><category><![CDATA[Cloud]]></category><category><![CDATA[distributed systems]]></category><category><![CDATA[devtools]]></category><dc:creator><![CDATA[Cortlet Support]]></dc:creator><pubDate>Sat, 05 Sep 2026 15:33:12 GMT</pubDate><content:encoded><![CDATA[<p>WebSockets sound simple at first.</p>
<p>A client connects.</p>
<p>It sends messages.</p>
<p>The server sends messages back.</p>
<p>But once you combine WebSockets with serverless infrastructure, one question appears almost immediately:</p>
<p><strong>Where do you store the active connections?</strong></p>
<p>That is where a lot of the complexity starts.</p>
<h2>A traditional server can remember connections</h2>
<p>With a long-running WebSocket server, active connections can often live in memory.</p>
<p>Conceptually, the server can keep something like:</p>
<p><code>user_123 → connection_abc</code></p>
<p>As long as that server process stays alive, it knows which connection belongs to which user.</p>
<p>If the backend wants to send a message to <code>user_123</code>, it already knows where to send it.</p>
<p>Serverless changes that.</p>
<h2>Serverless functions do not stay around</h2>
<p>A serverless function is usually created to handle an event, run some code, return a result, and disappear.</p>
<p>The next event may run on a completely different instance.</p>
<p>That means a function cannot safely rely on in-memory connection state.</p>
<p>If one function handles a WebSocket connection event and another function later needs to send data back to that client, the second function needs some way to know:</p>
<ul>
<li><p>which connection belongs to that user</p>
</li>
<li><p>whether the connection is still active</p>
</li>
<li><p>where that connection is hosted</p>
</li>
<li><p>whether it has already disconnected</p>
</li>
</ul>
<p>The connection state has to live somewhere else.</p>
<h2>This is where a database enters the picture</h2>
<p>A common serverless WebSocket setup looks roughly like this:</p>
<p><code>Client → WebSocket Gateway → Serverless Function → Connection Database</code></p>
<p>When a client connects, the backend stores the connection ID.</p>
<p>When the client disconnects, the backend removes it.</p>
<p>When the backend wants to send data later, it first looks up the connection ID and then sends the message through the WebSocket gateway.</p>
<p>So a simple realtime feature can become:</p>
<ol>
<li><p>accept the connection</p>
</li>
<li><p>generate or receive a connection ID</p>
</li>
<li><p>store the connection ID</p>
</li>
<li><p>map it to a user or session</p>
</li>
<li><p>look it up later</p>
</li>
<li><p>send the message</p>
</li>
<li><p>clean it up on disconnect</p>
</li>
<li><p>handle stale entries when disconnect events fail</p>
</li>
</ol>
<p>The database is not storing application data.</p>
<p>It is storing infrastructure state.</p>
<h2>Why this feels strange</h2>
<p>Databases are usually introduced because the application needs durable data.</p>
<p>Users.</p>
<p>Orders.</p>
<p>Messages.</p>
<p>Sessions.</p>
<p>But in a serverless WebSocket architecture, developers may end up adding a database table simply to answer:</p>
<p><strong>“Which socket is this user connected to?”</strong></p>
<p>That creates extra code, extra reads and writes, extra failure cases, and extra infrastructure.</p>
<p>The realtime feature may be small.</p>
<p>The connection-management layer is not.</p>
<h2>Disconnects make it harder</h2>
<p>Connection tracking also depends on knowing when a client is gone.</p>
<p>That sounds straightforward, but WebSocket disconnects are not always clean.</p>
<p>A browser may close suddenly.</p>
<p>A laptop may lose Wi-Fi.</p>
<p>A mobile device may switch networks.</p>
<p>A process may crash.</p>
<p>If the disconnect event is delayed or never arrives, the database can still contain a connection that no longer exists.</p>
<p>Now the application needs cleanup logic.</p>
<p>It may need retries, TTLs, heartbeat checks, or stale-connection detection.</p>
<p>The problem grows beyond simply storing an ID.</p>
<h2>The backend starts managing transport state</h2>
<p>This is the part that matters.</p>
<p>The application backend is no longer only handling business logic.</p>
<p>It is now managing the state of the transport layer.</p>
<p>That means developers start writing code for things like:</p>
<ul>
<li><p>connection registration</p>
</li>
<li><p>connection lookup</p>
</li>
<li><p>disconnect cleanup</p>
</li>
<li><p>stale connection detection</p>
</li>
<li><p>retry logic</p>
</li>
<li><p>connection-to-user mappings</p>
</li>
</ul>
<p>That is infrastructure work created by the mismatch between persistent WebSockets and stateless compute.</p>
<h2>What if the gateway owned the connection state?</h2>
<p>Another model is to move this responsibility into the WebSocket layer itself.</p>
<p>For example:</p>
<p><code>Client → WebSocket Gateway → HTTP Webhook → Serverless Backend</code></p>
<p>The gateway already owns the persistent connection.</p>
<p>So it could also own the connection identity and lifecycle.</p>
<p>The backend would receive ordinary HTTP events containing the information it needs, without having to build a separate connection-tracking system first.</p>
<p>That is one of the ideas behind <strong>Cortlet</strong>.</p>
<p>Instead of asking every serverless application to rebuild the same connection-management layer, the gateway could handle that state once.</p>
<h2>The bigger problem is not the database</h2>
<p>A connection database is not inherently bad.</p>
<p>For many applications, it is completely reasonable.</p>
<p>The issue is that developers often need one because their compute layer cannot retain connection state itself.</p>
<p>That means every realtime feature inherits an additional architectural responsibility.</p>
<p>The real question is:</p>
<p><strong>Should every serverless developer have to manage WebSocket connection state themselves?</strong></p>
<p>That is the part we think is worth rethinking.</p>
]]></content:encoded></item><item><title><![CDATA[Why WebSockets and Serverless Don’t Fit Naturally]]></title><description><![CDATA[Learn why WebSockets clash with serverless architecture, and how separating persistent connections can simplify realtime backend infrastructure.]]></description><link>https://blog.cortlet.com/why-websockets-and-serverless-don-t-fit-naturally</link><guid isPermaLink="true">https://blog.cortlet.com/why-websockets-and-serverless-don-t-fit-naturally</guid><category><![CDATA[websockets]]></category><category><![CDATA[serverless]]></category><category><![CDATA[realtime]]></category><category><![CDATA[Cloud]]></category><category><![CDATA[backend]]></category><category><![CDATA[infrastructure]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[distributed systems]]></category><category><![CDATA[devtools]]></category><dc:creator><![CDATA[Cortlet Support]]></dc:creator><pubDate>Fri, 04 Sep 2026 09:21:48 GMT</pubDate><content:encoded><![CDATA[<h2>WebSockets Are Stateful. Serverless Isn’t.</h2>
<p>Serverless platforms are built around a simple model:</p>
<p>A request comes in, a function runs, a response goes out, and the compute can disappear.</p>
<p>That works extremely well for ordinary HTTP APIs.</p>
<p>WebSockets behave differently.</p>
<p>A WebSocket connection can stay open for minutes or hours. The client expects that connection to remain available so data can move in either direction whenever needed.</p>
<p>That creates a fundamental mismatch:</p>
<p><strong>WebSockets are stateful. Serverless functions are not.</strong></p>
<h2>HTTP fits serverless naturally</h2>
<p>A normal API request looks something like this:</p>
<p><code>Client → HTTP Request → Serverless Function → Response</code></p>
<p>The function does not need to remember the client after the request ends.</p>
<p>The next request may run on a completely different instance.</p>
<p>That is fine because each request is independent.</p>
<h2>WebSockets expect something to stay alive</h2>
<p>A WebSocket looks more like this:</p>
<p><code>Client ↔ Persistent Connection ↔ Server</code></p>
<p>Something has to keep that connection open.</p>
<p>It also has to know things like:</p>
<ul>
<li><p>which client owns the connection</p>
</li>
<li><p>whether the connection is still alive</p>
</li>
<li><p>where to send data later</p>
</li>
<li><p>what happens when the client disconnects</p>
</li>
<li><p>how to reconnect after a network interruption</p>
</li>
</ul>
<p>The connection itself becomes state.</p>
<p>A traditional long-running server can keep that state in memory.</p>
<p>A serverless function usually cannot.</p>
<h2>So where does the connection live?</h2>
<p>WebSockets are not impossible in a serverless architecture.</p>
<p>Instead, another layer usually has to maintain the connection.</p>
<p>A common architecture looks like:</p>
<p><code>Client → WebSocket Gateway → Serverless Function</code></p>
<p>The gateway keeps the socket alive.</p>
<p>When the client sends a message, the gateway triggers the serverless backend.</p>
<p>The function handles the event and exits normally.</p>
<p>The stateful connection layer and the stateless compute layer are separated.</p>
<p>That solves the basic architectural problem.</p>
<p>But it can introduce a new one.</p>
<h2>The infrastructure starts growing</h2>
<p>Once the WebSocket connection exists outside the backend, developers may also need to think about:</p>
<ul>
<li><p>connection IDs</p>
</li>
<li><p>routing responses back to the correct client</p>
</li>
<li><p>connect and disconnect events</p>
</li>
<li><p>authentication</p>
</li>
<li><p>stale connections</p>
</li>
<li><p>reconnect behavior</p>
</li>
<li><p>connection tracking</p>
</li>
<li><p>provider-specific APIs</p>
</li>
</ul>
<p>A feature that started as:</p>
<blockquote>
<p>“We just need realtime updates.”</p>
</blockquote>
<p>can quickly become:</p>
<blockquote>
<p>“We now have an entire infrastructure layer just to keep connections alive.”</p>
</blockquote>
<p>That is where the simplicity of serverless can start to disappear.</p>
<h2>What if the backend stayed HTTP-only?</h2>
<p>One possible architecture is to keep the persistent connection completely outside the application backend.</p>
<p>For example:</p>
<p><code>Client → WebSocket Gateway → HTTP Webhook → Serverless Backend</code></p>
<p>The gateway handles the long-lived connection.</p>
<p>The backend receives ordinary HTTP requests.</p>
<p>A WebSocket event becomes a webhook.</p>
<p>The backend can process it like any other request and remain stateless.</p>
<p>This is the architecture we are exploring with <strong>Cortlet</strong>.</p>
<p>The idea is simple:</p>
<p><strong>Let one layer deal with persistent connections, while the application backend continues doing what serverless does best: handling short-lived requests.</strong></p>
<h2>Separation is the key</h2>
<p>The issue is not that WebSockets and serverless cannot work together.</p>
<p>The issue is that they make very different assumptions.</p>
<p>Serverless assumes compute can appear, process something, and disappear.</p>
<p>WebSockets assume something stays around.</p>
<p>Once those responsibilities are separated, the architecture becomes much easier to reason about.</p>
<p>The interesting question is no longer:</p>
<p><strong>Can WebSockets work with serverless?</strong></p>
<p>They can.</p>
<p>The more useful question is:</p>
<p><strong>How little WebSocket infrastructure should a developer have to manage themselves?</strong></p>
]]></content:encoded></item></channel></rss>