<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Datastar on jeffhui.net</title>
		<link>https://www.jeffhui.net/tags/datastar/</link>
		<description>Recent content in Datastar on jeffhui.net</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Thu, 06 Aug 2026 04:36:51 -0700</lastBuildDate>
		
			<atom:link href="https://www.jeffhui.net/tags/datastar/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Serving Datastar Streams</title>
				<link>https://www.jeffhui.net/writings/2026/serving-datastar-streams/</link>
				<pubDate>Thu, 06 Aug 2026 04:36:51 -0700</pubDate>
				<guid>https://www.jeffhui.net/writings/2026/serving-datastar-streams/</guid>
				<description>&lt;p&gt;&lt;a href=&#34;https://data-star.dev/&#34;&gt;Datastar&lt;/a&gt; leaves the server-side implementation open-ended. Datastar&#xA;provides &lt;a href=&#34;https://data-star.dev/reference/sdks&#34;&gt;SDKs&lt;/a&gt; for various languages, but those SDKs only cover &lt;a href=&#34;https://data-star.dev/reference/sse_events&#34;&gt;the&#xA;protocol on top of SSE&lt;/a&gt; that the Datastar JavaScript client expects. To&#xA;manage Datastar connections from the server, you need two things:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Sending the &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events&#34;&gt;SSE&lt;/a&gt; events Datastar expects.&lt;/li&gt;&#xA;&lt;li&gt;Getting state changes from one of your servers to the others.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The second is the harder one if you haven&amp;rsquo;t worked with streaming&#xA;architectures. The creator of Datastar uses &lt;a href=&#34;https://nats.io/&#34;&gt;NATS&lt;/a&gt;, but any centralized&#xA;store or pub-sub queue where servers can publish and read changes is enough to&#xA;get started. Server languages that handle concurrency poorly will hit limits on&#xA;scaling SSE connections sooner.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
