<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dawn Carrillo</title>
    <description>The latest articles on DEV Community by Dawn Carrillo (@dawn_carrillo_4d69570459b).</description>
    <link>https://dev.to/dawn_carrillo_4d69570459b</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4232659%2Fb9b51e04-f83c-4630-b605-4593bb7c33ae.png</url>
      <title>DEV Community: Dawn Carrillo</title>
      <link>https://dev.to/dawn_carrillo_4d69570459b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dawn_carrillo_4d69570459b"/>
    <language>en</language>
    <item>
      <title>Building a Scalable E-commerce Platform: Technical Challenges Meet Business Reality</title>
      <dc:creator>Dawn Carrillo</dc:creator>
      <pubDate>Tue, 10 Nov 2026 19:05:03 +0000</pubDate>
      <link>https://dev.to/dawn_carrillo_4d69570459b/building-a-scalable-e-commerce-platform-technical-challenges-meet-business-reality-44f1</link>
      <guid>https://dev.to/dawn_carrillo_4d69570459b/building-a-scalable-e-commerce-platform-technical-challenges-meet-business-reality-44f1</guid>
      <description>&lt;p&gt;Building an e-commerce platform is much more than creating product pages, adding a shopping cart, and integrating a payment gateway.&lt;/p&gt;

&lt;p&gt;The real challenge is designing a system where business requirements and technical decisions work together seamlessly.&lt;/p&gt;

&lt;p&gt;I've been thinking about some common problems in e-commerce development and how we can approach them from both engineering and business perspectives.&lt;/p&gt;

&lt;p&gt;Here are a few important areas worth discussing.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Inventory Management and Overselling
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The business problem:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine two customers trying to purchase the last available item at exactly the same time. If the system doesn't handle concurrent requests correctly, both customers might receive an order confirmation.&lt;/p&gt;

&lt;p&gt;That's a serious problem for inventory accuracy, customer satisfaction, and operational costs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The technical solution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need to consider database transactions, concurrency control, atomic operations, and inventory reservation strategies.&lt;/p&gt;

&lt;p&gt;For example, with PostgreSQL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;stock_quantity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;stock_quantity&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;101&lt;/span&gt;
&lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;stock_quantity&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;RETURNING&lt;/span&gt; &lt;span class="n"&gt;stock_quantity&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This atomic operation prevents the stock quantity from going below zero.&lt;/p&gt;

&lt;p&gt;For more complex systems, we might introduce temporary inventory reservations with expiration times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business consideration:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How long should we reserve an item during checkout?&lt;/li&gt;
&lt;li&gt;What happens when payment fails?&lt;/li&gt;
&lt;li&gt;Should reserved inventory be available to other customers?&lt;/li&gt;
&lt;li&gt;How do we handle refunds and order cancellations?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important thing is that inventory management isn't just a database problem. It's an operational business decision.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Shopping Cart and Checkout Optimization
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The business problem:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A customer adds several products to their cart but leaves before completing the purchase.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Potential reasons include unexpected shipping costs, complicated checkout forms, limited payment options, or a slow checkout experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The technical solution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We should design a reliable checkout workflow with clear separation between cart management, order creation, payment processing, and inventory updates.&lt;/p&gt;

&lt;p&gt;A typical architecture might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Shopping Cart
     |
     v
Checkout Service
     |
     v
Order Service
     |
     v
Inventory Validation
     |
     v
Payment Gateway
     |
     v
Order Confirmation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We should also consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Session management and persistent carts.&lt;/li&gt;
&lt;li&gt;Guest checkout.&lt;/li&gt;
&lt;li&gt;Idempotency keys to prevent duplicate payments.&lt;/li&gt;
&lt;li&gt;Payment webhooks.&lt;/li&gt;
&lt;li&gt;Order state management.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, an idempotency key can help prevent duplicate order processing when a customer accidentally clicks the payment button multiple times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business consideration:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Checkout conversion rate is one of the most important e-commerce KPIs.&lt;/p&gt;

&lt;p&gt;Even a technically sophisticated platform can underperform if its checkout experience creates unnecessary friction.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Product Search and Recommendation Systems
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The business problem:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As a product catalog grows, customers need to find relevant products quickly.&lt;/p&gt;

&lt;p&gt;A basic SQL search might work initially, but it can become insufficient when we introduce thousands of products, filters, synonyms, typo tolerance, and personalized recommendations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The technical solution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can combine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PostgreSQL full-text search.&lt;/li&gt;
&lt;li&gt;Elasticsearch or OpenSearch.&lt;/li&gt;
&lt;li&gt;Redis for caching frequently accessed results.&lt;/li&gt;
&lt;li&gt;Recommendation algorithms.&lt;/li&gt;
&lt;li&gt;Behavioral analytics.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example using PostgreSQL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nf"&gt;to_tsvector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'english'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="nd"&gt;@@&lt;/span&gt; &lt;span class="nf"&gt;plainto_tsquery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'english'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'wireless headphones'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="k"&gt;ASC&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more advanced recommendations, we could analyze browsing history, purchase history, product categories, and customer preferences.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business consideration:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Search quality directly affects product discovery, customer engagement, and revenue.&lt;/p&gt;

&lt;p&gt;However, recommendations should also consider product availability, profit margins, customer relevance, and business priorities.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Payment Integration and Order Consistency
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The business problem:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What happens when a payment provider successfully charges a customer, but our application fails before updating the order status?&lt;/p&gt;

&lt;p&gt;We could end up with a customer who has paid but sees an unsuccessful order.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The technical solution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Payment processing should be designed around asynchronous events, reliable webhooks, idempotency, and explicit order states.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handlePaymentSuccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;payment&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;object&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;findOrderByPaymentId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"paid"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;updateOrderStatus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"paid"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In production, we would also need signature verification, transactional updates, retry handling, and proper event deduplication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business consideration:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Payment failures, chargebacks, refunds, and reconciliation all have financial consequences.&lt;/p&gt;

&lt;p&gt;The payment integration must support the actual business workflow, not simply return a success response.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Scalability, Performance, and Infrastructure Costs
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The business problem:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A platform might perform perfectly with 100 daily customers but struggle during a promotional campaign that attracts 50,000 visitors.&lt;/p&gt;

&lt;p&gt;Scaling infrastructure without understanding actual bottlenecks can also become unnecessarily expensive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The technical solution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A practical architecture could include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React or Next.js for the frontend.&lt;/li&gt;
&lt;li&gt;Node.js with NestJS for backend services.&lt;/li&gt;
&lt;li&gt;PostgreSQL for transactional data.&lt;/li&gt;
&lt;li&gt;Redis for caching.&lt;/li&gt;
&lt;li&gt;AWS or Google Cloud for infrastructure.&lt;/li&gt;
&lt;li&gt;Docker for containerization.&lt;/li&gt;
&lt;li&gt;CI/CD pipelines for automated deployments.&lt;/li&gt;
&lt;li&gt;Monitoring and observability tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We should also consider database indexing, connection pooling, load balancing, horizontal scaling, and asynchronous background jobs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business consideration:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Technical scalability should support business growth while maintaining reasonable infrastructure costs.&lt;/p&gt;

&lt;p&gt;The objective isn't to build the most complicated architecture possible. It's to build an architecture that can evolve as the business grows.&lt;/p&gt;




&lt;h3&gt;
  
  
  My Takeaway
&lt;/h3&gt;

&lt;p&gt;One thing I've learned from thinking about e-commerce architecture is that technical excellence and business understanding cannot be separated.&lt;/p&gt;

&lt;p&gt;A good software engineer doesn't just ask:&lt;/p&gt;

&lt;p&gt;"How can I implement this feature?"&lt;/p&gt;

&lt;p&gt;They also ask:&lt;/p&gt;

&lt;p&gt;"Why does the business need this feature?"&lt;/p&gt;

&lt;p&gt;"What problem are we solving for customers?"&lt;/p&gt;

&lt;p&gt;"How will we measure whether this solution actually works?"&lt;/p&gt;

&lt;p&gt;"Will this implementation remain maintainable as the business scales?"&lt;/p&gt;

&lt;p&gt;These questions help us move beyond simply delivering features and start building products that create real business value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I'd be interested in hearing other developers' perspectives:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What's the most challenging problem you've encountered when building an e-commerce platform?&lt;/p&gt;

&lt;p&gt;Was it inventory consistency, payment processing, checkout conversion, search performance, or something completely different?&lt;/p&gt;

&lt;p&gt;Let's discuss both the engineering decisions and the business implications.&lt;/p&gt;

</description>
      <category>ecommerce</category>
      <category>webdev</category>
      <category>fullstack</category>
      <category>ai</category>
    </item>
    <item>
      <title>WebTransport: Is WebSocket's Dominance Coming to an End?</title>
      <dc:creator>Dawn Carrillo</dc:creator>
      <pubDate>Mon, 09 Nov 2026 00:14:46 +0000</pubDate>
      <link>https://dev.to/dawn_carrillo_4d69570459b/webtransport-is-websockets-dominance-coming-to-an-end-o8g</link>
      <guid>https://dev.to/dawn_carrillo_4d69570459b/webtransport-is-websockets-dominance-coming-to-an-end-o8g</guid>
      <description>&lt;p&gt;For years, WebSockets have been one of the foundations of real-time web communication.&lt;/p&gt;

&lt;p&gt;From messaging applications and live dashboards to collaborative tools and multiplayer games, WebSockets have made it possible for browsers and servers to exchange data continuously without repeatedly establishing HTTP requests.&lt;/p&gt;

&lt;p&gt;But web applications are evolving.&lt;/p&gt;

&lt;p&gt;We're building applications that require lower latency, more concurrent communication, real-time interactions, and increasingly sophisticated data exchange.&lt;/p&gt;

&lt;p&gt;And this raises an interesting question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Are WebSockets still enough for the next generation of web applications?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enter WebTransport.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The limitations of traditional real-time communication
&lt;/h2&gt;

&lt;p&gt;WebSockets solved an important problem: traditional HTTP request-response communication wasn't designed for continuous, bidirectional data exchange.&lt;/p&gt;

&lt;p&gt;However, WebSockets operate over a single reliable, ordered connection.&lt;/p&gt;

&lt;p&gt;Consider a multiplayer game where a server continuously sends information about player positions, movements, and game events.&lt;/p&gt;

&lt;p&gt;What happens when one message gets delayed?&lt;/p&gt;

&lt;p&gt;Because WebSocket messages are delivered reliably and in order, subsequent messages on that connection cannot simply bypass the delayed data.&lt;/p&gt;

&lt;p&gt;For applications where every millisecond matters, receiving an outdated update can sometimes be less useful than receiving the latest update immediately.&lt;/p&gt;

&lt;p&gt;This is where alternative transport mechanisms become interesting.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. What exactly is WebTransport?
&lt;/h2&gt;

&lt;p&gt;WebTransport is a browser API that enables bidirectional communication between clients and servers using HTTP/3 and QUIC.&lt;/p&gt;

&lt;p&gt;Unlike WebSockets, it provides multiple communication mechanisms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bidirectional streams:&lt;/strong&gt; Reliable communication in both directions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unidirectional streams:&lt;/strong&gt; Reliable communication in one direction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Datagrams:&lt;/strong&gt; Unreliable communication where delivery and ordering aren't guaranteed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The interesting part is that applications can choose the communication mechanism that makes sense for each type of data.&lt;/p&gt;

&lt;p&gt;For example, a multiplayer game might use reliable streams for important game events while using datagrams for frequently updated player positions.&lt;/p&gt;

&lt;p&gt;If an older position update arrives late, there's often no reason to wait for it. The next update is more valuable.&lt;/p&gt;

&lt;p&gt;That is a fundamentally different approach to real-time communication.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Why QUIC changes the equation
&lt;/h2&gt;

&lt;p&gt;One of the most interesting aspects of WebTransport is its underlying transport protocol: QUIC.&lt;/p&gt;

&lt;p&gt;QUIC runs over UDP and provides encryption, congestion control, and independent streams.&lt;/p&gt;

&lt;p&gt;Traditional WebSockets generally operate over TCP, where packet loss can delay delivery of subsequent data.&lt;/p&gt;

&lt;p&gt;QUIC handles independent streams differently.&lt;/p&gt;

&lt;p&gt;If one stream experiences packet loss, other independent streams can continue delivering data without waiting for that particular stream to recover.&lt;/p&gt;

&lt;p&gt;This reduces cross-stream head-of-line blocking.&lt;/p&gt;

&lt;p&gt;It also offers benefits such as faster connection establishment and improved handling of network changes.&lt;/p&gt;

&lt;p&gt;However, this doesn't mean every WebTransport application will automatically be faster. Actual performance depends on network conditions, application architecture, and implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Let's look at the code: Establishing a connection
&lt;/h2&gt;

&lt;p&gt;Theory is useful, but the real difference becomes clearer when we look at the implementation.&lt;/p&gt;

&lt;p&gt;Unlike WebSockets, WebTransport uses an HTTPS URL and requires an HTTP/3-compatible server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;transport&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;WebTransport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://example.com:4999/webtransport&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;WebTransport connection established!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also handle connection closure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;closed&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Connection closed gracefully&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Connection failed:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important thing to understand is that establishing a connection is only the beginning.&lt;/p&gt;

&lt;p&gt;WebTransport gives applications access to multiple communication mechanisms over that connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Reliable bidirectional communication
&lt;/h2&gt;

&lt;p&gt;For data that must arrive reliably, WebTransport supports bidirectional streams.&lt;/p&gt;

&lt;p&gt;A bidirectional stream allows both the browser and server to send data independently.&lt;/p&gt;

&lt;p&gt;Here's a simplified example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sendMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createBidirectionalStream&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;writer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;writable&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getWriter&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readable&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getReader&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;encoder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TextEncoder&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decoder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TextDecoder&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="c1"&gt;// Send data to the server&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;encoder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="c1"&gt;// Receive the server response&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;done&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Server response:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;decoder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;releaseLock&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;releaseLock&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example assumes that the server accepts the stream, reads the message, and sends a response.&lt;/p&gt;

&lt;p&gt;Unlike a simple WebSocket message exchange, this approach gives developers explicit control over individual streams.&lt;/p&gt;

&lt;p&gt;It becomes particularly useful when an application needs multiple independent communication channels.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. The interesting part: Unreliable datagrams
&lt;/h2&gt;

&lt;p&gt;This is arguably one of the most interesting features of WebTransport.&lt;/p&gt;

&lt;p&gt;Imagine a multiplayer game sending player-position updates 30 times per second.&lt;/p&gt;

&lt;p&gt;You don't necessarily need every update to arrive. The newest position is usually more valuable than an outdated one.&lt;/p&gt;

&lt;p&gt;Instead of waiting for reliable delivery, we can send datagrams.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sendPlayerPosition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;writer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;datagrams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;writable&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getWriter&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;position&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TextEncoder&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;position&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;releaseLock&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the receiving side, we can process incoming datagrams:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;receiveDatagrams&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;datagrams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readable&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getReader&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decoder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TextDecoder&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;done&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;position&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nx"&gt;decoder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;);&lt;/span&gt;

      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Player position:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;position&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;releaseLock&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Datagrams are not guaranteed to arrive, and they are not guaranteed to arrive in order.&lt;/p&gt;

&lt;p&gt;That means developers must design their applications to handle missing or outdated updates.&lt;/p&gt;

&lt;p&gt;For some applications, this is a worthwhile trade-off.&lt;/p&gt;

&lt;p&gt;The ability to prioritize freshness over guaranteed delivery opens up interesting architectural possibilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. WebSockets vs. WebTransport: A practical comparison
&lt;/h2&gt;

&lt;p&gt;Let's compare the two approaches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WebSockets:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;socket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;WebSocket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;wss://example.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onopen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello server!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onmessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Received:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;WebTransport:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;transport&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;WebTransport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://example.com:4999/webtransport&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;writer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;datagrams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;writable&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getWriter&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TextEncoder&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello server!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;releaseLock&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The difference is not simply the number of lines of code.&lt;/p&gt;

&lt;p&gt;WebSockets provide a straightforward message-based API, whereas WebTransport exposes different communication primitives.&lt;/p&gt;

&lt;p&gt;Here's a broader comparison:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Capability&lt;/th&gt;
&lt;th&gt;WebSockets&lt;/th&gt;
&lt;th&gt;WebTransport&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Bidirectional communication&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reliable delivery&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes, through streams&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unreliable datagrams&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multiple independent streams&lt;/td&gt;
&lt;td&gt;No native stream multiplexing&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP/3 and QUIC&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ecosystem maturity&lt;/td&gt;
&lt;td&gt;Very mature&lt;/td&gt;
&lt;td&gt;Newer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API complexity&lt;/td&gt;
&lt;td&gt;Relatively simple&lt;/td&gt;
&lt;td&gt;More complex&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The biggest difference is flexibility.&lt;/p&gt;

&lt;p&gt;WebSockets provide a straightforward communication model. WebTransport gives developers more control over how data travels between clients and servers.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Where could WebTransport make a difference?
&lt;/h2&gt;

&lt;p&gt;I think several application categories could benefit significantly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multiplayer gaming&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Frequent position and movement updates don't always need reliable delivery. Unreliable datagrams can be useful when the newest state matters more than an older update.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-time collaboration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Applications such as collaborative editors, design tools, and interactive workspaces can benefit from multiple independent communication streams.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live streaming and interactive media&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Applications requiring low-latency data delivery may benefit from combining reliable streams with datagrams.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI-powered applications&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As AI applications become more interactive, communication patterns are becoming more sophisticated.&lt;/p&gt;

&lt;p&gt;WebTransport could be useful for applications that need multiple concurrent data channels, although it doesn't replace application-level streaming protocols or solve AI inference latency by itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Is WebTransport ready for production?
&lt;/h2&gt;

&lt;p&gt;This is where things become interesting.&lt;/p&gt;

&lt;p&gt;WebTransport is no longer just an experimental concept. Its browser support has matured considerably, and it is available across modern browser implementations.&lt;/p&gt;

&lt;p&gt;However, there are still practical considerations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your server needs compatible HTTP/3 and WebTransport support.&lt;/li&gt;
&lt;li&gt;Your infrastructure must properly handle QUIC traffic.&lt;/li&gt;
&lt;li&gt;You need to consider older browser compatibility.&lt;/li&gt;
&lt;li&gt;Your application must handle connection failures and reconnections.&lt;/li&gt;
&lt;li&gt;Your team needs to understand stream management and datagram reliability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The WebSocket ecosystem is still considerably more mature.&lt;/p&gt;

&lt;p&gt;For ordinary chat applications, notifications, and dashboards, WebSockets may remain the more practical choice.&lt;/p&gt;

&lt;p&gt;There is no reason to replace a reliable solution simply because a newer technology exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. My perspective: The future isn't necessarily about replacing WebSockets
&lt;/h2&gt;

&lt;p&gt;I don't think WebTransport will make WebSockets obsolete overnight.&lt;/p&gt;

&lt;p&gt;Instead, I think we're moving toward a more flexible communication architecture.&lt;/p&gt;

&lt;p&gt;Different applications have different communication requirements.&lt;/p&gt;

&lt;p&gt;Some need guaranteed delivery. Others prioritize latency. Some need multiple independent streams, while others only need simple bidirectional messaging.&lt;/p&gt;

&lt;p&gt;Why should all these applications be forced into the same communication model?&lt;/p&gt;

&lt;p&gt;WebTransport gives developers more freedom to make that decision.&lt;/p&gt;

&lt;p&gt;And perhaps that's the most important development here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The next evolution of real-time web communication might not be about making one protocol faster. It might be about choosing the right transport mechanism for every kind of interaction.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'm particularly interested in how developers will combine these technologies in future application architectures.&lt;/p&gt;

&lt;p&gt;What do you think?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Will WebTransport eventually become the preferred choice for real-time web applications?&lt;/li&gt;
&lt;li&gt;Will WebSockets remain dominant because of their simplicity and mature ecosystem?&lt;/li&gt;
&lt;li&gt;Or will both technologies coexist, serving different communication requirements?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd love to hear your thoughts and real-world experiences.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>backend</category>
      <category>module</category>
    </item>
    <item>
      <title>I Used Unsloth to Fine-Tune an LLM for a Real-World AI Application</title>
      <dc:creator>Dawn Carrillo</dc:creator>
      <pubDate>Sun, 08 Nov 2026 19:10:24 +0000</pubDate>
      <link>https://dev.to/dawn_carrillo_4d69570459b/i-used-unsloth-to-fine-tune-an-llm-for-a-real-world-ai-application-2pb5</link>
      <guid>https://dev.to/dawn_carrillo_4d69570459b/i-used-unsloth-to-fine-tune-an-llm-for-a-real-world-ai-application-2pb5</guid>
      <description>&lt;p&gt;I've been experimenting with different approaches to building AI-powered applications, and recently I've been particularly interested in one problem: how can we make an open-source language model understand a specific business domain without having to train an entire model from scratch?&lt;/p&gt;

&lt;p&gt;That's what led me to explore &lt;strong&gt;Unsloth&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For this project, I wanted to build an intelligent customer support assistant that could understand incoming support requests, identify user intent, recognize relevant technical issues, and generate responses that actually made sense in the context of the business.&lt;/p&gt;

&lt;p&gt;I didn't want another chatbot that simply wrapped an API around an existing LLM. I wanted to experiment with adapting a model to a specific domain.&lt;/p&gt;

&lt;p&gt;Here's how I approached it.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The architecture: Start with a foundation model
&lt;/h3&gt;

&lt;p&gt;Instead of training a language model from scratch, I started with an existing open-source instruction-tuned model.&lt;/p&gt;

&lt;p&gt;The idea was to adapt its behavior using domain-specific examples.&lt;/p&gt;

&lt;p&gt;The architecture consisted of several components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A pretrained language model as the foundation.&lt;/li&gt;
&lt;li&gt;A curated dataset containing customer questions, technical issues, and expected responses.&lt;/li&gt;
&lt;li&gt;Unsloth for parameter-efficient fine-tuning.&lt;/li&gt;
&lt;li&gt;LoRA adapters for learning domain-specific behavior.&lt;/li&gt;
&lt;li&gt;A Python inference service exposing the model through an API.&lt;/li&gt;
&lt;li&gt;A frontend application for interacting with the assistant.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The interesting part was that I didn't need to update every parameter in the original model.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Fine-tuning with Unsloth and QLoRA
&lt;/h3&gt;

&lt;p&gt;One of the biggest challenges when working with LLMs is GPU memory consumption.&lt;/p&gt;

&lt;p&gt;Full fine-tuning can become expensive, particularly when working with models containing billions of parameters.&lt;/p&gt;

&lt;p&gt;I used the QLoRA approach to address this.&lt;/p&gt;

&lt;p&gt;The general idea is straightforward:&lt;/p&gt;

&lt;p&gt;Instead of keeping the entire model in full precision and updating all its weights, we load quantized model weights and train a much smaller set of additional parameters.&lt;/p&gt;

&lt;p&gt;Unsloth helps optimize this process through custom kernels and memory-efficient implementations.&lt;/p&gt;

&lt;p&gt;A simplified implementation looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;unsloth&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastLanguageModel&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tokenizer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FastLanguageModel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_pretrained&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;unsloth/Llama-3.1-8B-Instruct&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_seq_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2048&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;dtype&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;load_in_4bit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FastLanguageModel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_peft_model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;target_modules&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;q_proj&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;k_proj&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;v_proj&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;o_proj&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gate_proj&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;up_proj&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;down_proj&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;lora_alpha&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;lora_dropout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;bias&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;none&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;use_gradient_checkpointing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;unsloth&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are a few important decisions here.&lt;/p&gt;

&lt;p&gt;First, 4-bit quantization reduces the memory required to load the base model.&lt;/p&gt;

&lt;p&gt;Second, LoRA introduces trainable low-rank matrices into selected model layers.&lt;/p&gt;

&lt;p&gt;Finally, gradient checkpointing helps reduce activation memory during training.&lt;/p&gt;

&lt;p&gt;These optimizations make experimentation considerably more accessible on limited GPU hardware.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Dataset engineering matters more than people think
&lt;/h3&gt;

&lt;p&gt;One thing I learned from this approach is that fine-tuning isn't just about choosing a better model.&lt;/p&gt;

&lt;p&gt;The quality of the training data has a huge influence on the outcome.&lt;/p&gt;

&lt;p&gt;I structured the dataset around realistic support interactions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer questions.&lt;/li&gt;
&lt;li&gt;Technical error descriptions.&lt;/li&gt;
&lt;li&gt;Relevant troubleshooting steps.&lt;/li&gt;
&lt;li&gt;Expected responses.&lt;/li&gt;
&lt;li&gt;Contextual information.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also paid attention to inconsistent responses, duplicated examples, and poorly structured conversations.&lt;/p&gt;

&lt;p&gt;For supervised fine-tuning, I converted the examples into a consistent conversational format so the model could learn the expected interaction patterns.&lt;/p&gt;

&lt;p&gt;I kept separate training and evaluation datasets to avoid measuring performance on examples the model had already seen.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Training and evaluation
&lt;/h3&gt;

&lt;p&gt;After preparing the dataset, I configured the training process using Hugging Face's training ecosystem.&lt;/p&gt;

&lt;p&gt;The important parameters included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learning rate.&lt;/li&gt;
&lt;li&gt;Batch size.&lt;/li&gt;
&lt;li&gt;Gradient accumulation.&lt;/li&gt;
&lt;li&gt;Number of training epochs.&lt;/li&gt;
&lt;li&gt;Maximum sequence length.&lt;/li&gt;
&lt;li&gt;LoRA rank.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I didn't want to judge the model simply by whether its responses sounded convincing.&lt;/p&gt;

&lt;p&gt;I evaluated it against actual requirements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Does it correctly identify the customer's intent?&lt;/li&gt;
&lt;li&gt;Can it distinguish between similar technical issues?&lt;/li&gt;
&lt;li&gt;Does it follow the expected response format?&lt;/li&gt;
&lt;li&gt;Does it generate unsupported information?&lt;/li&gt;
&lt;li&gt;Does fine-tuning actually improve performance compared with the original model?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That last point is particularly important. Fine-tuning doesn't automatically make a model better. It makes the model more adapted to the patterns represented in its training data.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Integrating the model into a production-oriented application
&lt;/h3&gt;

&lt;p&gt;The next challenge was connecting the model to an actual application.&lt;/p&gt;

&lt;p&gt;I separated the inference layer from the main application backend.&lt;/p&gt;

&lt;p&gt;The Python service was responsible for model loading, inference, and response generation.&lt;/p&gt;

&lt;p&gt;The application backend handled authentication, request validation, business logic, and communication with the inference service.&lt;/p&gt;

&lt;p&gt;This separation made the architecture easier to maintain and allowed the model-serving component to scale independently.&lt;/p&gt;

&lt;p&gt;I also considered several production concerns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model loading and initialization.&lt;/li&gt;
&lt;li&gt;GPU memory management.&lt;/li&gt;
&lt;li&gt;Request batching.&lt;/li&gt;
&lt;li&gt;Concurrent inference requests.&lt;/li&gt;
&lt;li&gt;Response streaming.&lt;/li&gt;
&lt;li&gt;Request timeouts.&lt;/li&gt;
&lt;li&gt;Logging and observability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For deployment, I would consider vLLM or llama.cpp depending on the hardware and model format.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. What I found interesting
&lt;/h3&gt;

&lt;p&gt;What I find particularly interesting about Unsloth is that it changes the economics of experimenting with open-source models.&lt;/p&gt;

&lt;p&gt;Previously, fine-tuning larger models could require considerable hardware resources and infrastructure.&lt;/p&gt;

&lt;p&gt;With optimized training, quantization, and parameter-efficient techniques, developers have more opportunities to experiment without building an expensive training infrastructure from day one.&lt;/p&gt;

&lt;p&gt;However, there's an important distinction: faster training doesn't necessarily mean better model quality. Dataset quality, evaluation methodology, and deployment architecture still matter.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final thoughts
&lt;/h3&gt;

&lt;p&gt;I think the next interesting challenge for full-stack developers isn't simply integrating an LLM API into an application.&lt;/p&gt;

&lt;p&gt;It's understanding how models are adapted, evaluated, served, and integrated into real software systems.&lt;/p&gt;

&lt;p&gt;Tools like Unsloth make the model-training side more accessible, but the real engineering challenge is building everything around the model.&lt;/p&gt;

&lt;p&gt;That's where I think a lot of interesting opportunities are emerging.&lt;/p&gt;

&lt;p&gt;I'd be interested to hear how other developers are approaching this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Are you still relying primarily on hosted LLM APIs, or have you started experimenting with fine-tuning and self-hosting open-source models?&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Go + AI Infrastructure: Building AI Systems That Actually Scale</title>
      <dc:creator>Dawn Carrillo</dc:creator>
      <pubDate>Sun, 08 Nov 2026 00:46:44 +0000</pubDate>
      <link>https://dev.to/dawn_carrillo_4d69570459b/go-ai-infrastructure-building-ai-systems-that-actually-scale-ph9</link>
      <guid>https://dev.to/dawn_carrillo_4d69570459b/go-ai-infrastructure-building-ai-systems-that-actually-scale-ph9</guid>
      <description>&lt;p&gt;Over the past few years, I've become increasingly interested in the intersection of Go and AI infrastructure.&lt;/p&gt;

&lt;p&gt;One thing I've learned from backend engineering is that building an AI-powered application is not just about connecting an LLM API and sending prompts. The real engineering challenges begin when you need to make the system reliable, scalable, observable, and cost-efficient in production.&lt;/p&gt;

&lt;p&gt;This is where Go becomes particularly interesting.&lt;/p&gt;

&lt;p&gt;In a recent AI infrastructure architecture, I'd approach the system with Go as the backbone for orchestration and service communication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's how I'd structure it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Go for AI Service Orchestration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I use Go to build the API layer responsible for handling concurrent requests, managing workloads, routing requests to different LLM providers, and coordinating background tasks.&lt;/p&gt;

&lt;p&gt;Goroutines and channels make it particularly useful when dealing with multiple independent AI operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. LLM Integration and Streaming&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Integrating providers such as OpenAI or Anthropic requires more than making HTTP requests.&lt;/p&gt;

&lt;p&gt;I'd implement:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Streaming responses using Server-Sent Events (SSE).&lt;/li&gt;
&lt;li&gt;Request timeouts and cancellation.&lt;/li&gt;
&lt;li&gt;Retry mechanisms with exponential backoff.&lt;/li&gt;
&lt;li&gt;Rate limiting and provider fallback.&lt;/li&gt;
&lt;li&gt;Token usage and cost tracking.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is to make AI interactions responsive without sacrificing system stability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. RAG Pipelines and Vector Search&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For applications that need domain-specific knowledge, I'd combine Go services with PostgreSQL and pgvector.&lt;/p&gt;

&lt;p&gt;A typical retrieval pipeline looks like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Receive a user query.&lt;/li&gt;
&lt;li&gt;Generate an embedding.&lt;/li&gt;
&lt;li&gt;Retrieve relevant documents using vector similarity.&lt;/li&gt;
&lt;li&gt;Apply metadata filtering and ranking.&lt;/li&gt;
&lt;li&gt;Send the retrieved context to an LLM.&lt;/li&gt;
&lt;li&gt;Stream the generated response back to the client.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Distributed Processing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI workloads can be unpredictable. Some requests finish in milliseconds, while others require lengthy document processing or multiple model calls.&lt;/p&gt;

&lt;p&gt;I'd use Kafka or NATS for asynchronous processing, Redis for caching, and worker pools in Go to control concurrency and prevent resource exhaustion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Production Observability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the most overlooked aspects of AI infrastructure is observability.&lt;/p&gt;

&lt;p&gt;I'd integrate OpenTelemetry, Prometheus, and Grafana to monitor:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LLM latency and time-to-first-token.&lt;/li&gt;
&lt;li&gt;Token consumption and inference costs.&lt;/li&gt;
&lt;li&gt;Queue depth and worker utilization.&lt;/li&gt;
&lt;li&gt;Error rates and provider availability.&lt;/li&gt;
&lt;li&gt;Retrieval quality and application performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These metrics help identify bottlenecks that traditional backend monitoring often misses.&lt;/p&gt;

&lt;h3&gt;
  
  
  The bigger picture
&lt;/h3&gt;

&lt;p&gt;I don't see Go replacing Python in AI development. Python remains essential for model training, experimentation, and much of the machine learning ecosystem.&lt;/p&gt;

&lt;p&gt;Instead, I see Go playing a valuable role in the production infrastructure surrounding AI systems.&lt;/p&gt;

&lt;p&gt;The interesting engineering challenge isn't simply making an LLM call. It's building the infrastructure that allows thousands of concurrent users to interact with AI reliably, securely, and efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That's where Go + AI Infrastructure becomes a powerful combination.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
