<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Backend Development on Birdor Blog</title>
		<link>https://blog.birdor.com/categories/backend-development/</link>
		<description>Recent content in Backend Development on Birdor Blog</description>
		<generator>Hugo</generator>
		<language>en</language>
		
		
		
		
			<lastBuildDate>Tue, 25 Nov 2025 16:27:00 +0800</lastBuildDate>
		
			<atom:link href="https://blog.birdor.com/categories/backend-development/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Building a Tiny HTTP Server from Scratch with net &#43; bufio</title>
				<link>https://blog.birdor.com/tiny-http-server-net-bufio/</link>
				<pubDate>Tue, 25 Nov 2025 16:27:00 +0800</pubDate>
				<guid>https://blog.birdor.com/tiny-http-server-net-bufio/</guid>
				<description>&lt;p&gt;Go’s &lt;code&gt;net/http&lt;/code&gt; package is fantastic—but sometimes you want to &lt;strong&gt;see what’s really happening&lt;/strong&gt; under the hood.&lt;/p&gt;&#xA;&lt;p&gt;In this article, we’ll build a &lt;strong&gt;tiny HTTP/1.1 server from scratch&lt;/strong&gt;, using only:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;net&lt;/code&gt; — for TCP sockets&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;bufio&lt;/code&gt; — for buffered I/O&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;No &lt;code&gt;net/http&lt;/code&gt;, no handler interface, no magic.&lt;/p&gt;&#xA;&lt;p&gt;You’ll learn:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How HTTP/1.1 requests look on the wire&lt;/li&gt;&#xA;&lt;li&gt;How to parse the request line and headers&lt;/li&gt;&#xA;&lt;li&gt;How to build a minimal response (status line, headers, body)&lt;/li&gt;&#xA;&lt;li&gt;How to handle multiple connections with goroutines&lt;/li&gt;&#xA;&lt;li&gt;A tiny router for different paths&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This is not production code—it’s a &lt;strong&gt;learning tool&lt;/strong&gt;. But it’s a great way to deeply understand HTTP.&lt;/p&gt;</description>
			</item>
			<item>
				<title>A Deep Dive into Go’s net/http Internals</title>
				<link>https://blog.birdor.com/go-net-http-internals-deep-dive/</link>
				<pubDate>Tue, 25 Nov 2025 16:23:00 +0800</pubDate>
				<guid>https://blog.birdor.com/go-net-http-internals-deep-dive/</guid>
				<description>&lt;p&gt;Go’s &lt;code&gt;net/http&lt;/code&gt; package is deceptively simple on the surface—just call &lt;code&gt;http.ListenAndServe()&lt;/code&gt; and pass a handler. But beneath its minimal API lies a &lt;strong&gt;highly optimized&lt;/strong&gt;, &lt;strong&gt;battle-tested&lt;/strong&gt;, and &lt;strong&gt;beautifully engineered&lt;/strong&gt; HTTP runtime.&lt;/p&gt;&#xA;&lt;p&gt;This article explores the &lt;strong&gt;internal architecture, concurrency model, lifecycle, request handling flow, connection reuse, transport behaviors, and performance strategies&lt;/strong&gt; that make &lt;code&gt;net/http&lt;/code&gt; one of Go’s most iconic packages.&lt;/p&gt;&#xA;&lt;p&gt;This is a true &lt;em&gt;deep dive&lt;/em&gt;—use it to understand how Go’s HTTP stack really works under the hood.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Designing a High-Performance, Multi-Goroutine Socket Server in Go</title>
				<link>https://blog.birdor.com/go-high-performance-socket-server/</link>
				<pubDate>Tue, 25 Nov 2025 11:57:00 +0800</pubDate>
				<guid>https://blog.birdor.com/go-high-performance-socket-server/</guid>
				<description>&lt;p&gt;High-performance networking is one of Go’s strengths. With lightweight goroutines, a rich &lt;code&gt;net&lt;/code&gt; package, and strong concurrency primitives, Go is a great fit for building custom TCP servers, game backends, proxies, and internal protocols.&lt;/p&gt;&#xA;&lt;p&gt;In this article, we’ll &lt;strong&gt;design and implement a high-performance, multi-goroutine socket server&lt;/strong&gt; in Go, with an architecture you can evolve into a real-world production system.&lt;/p&gt;&#xA;&lt;p&gt;We’ll cover:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Architecture and design goals&lt;/li&gt;&#xA;&lt;li&gt;A baseline TCP server&lt;/li&gt;&#xA;&lt;li&gt;A multi-goroutine concurrency model&lt;/li&gt;&#xA;&lt;li&gt;Connection limits and backpressure&lt;/li&gt;&#xA;&lt;li&gt;Request handling with worker pools&lt;/li&gt;&#xA;&lt;li&gt;Graceful shutdown and observability&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;1-goals-and-design-principles&#34;&gt;1. Goals and Design Principles&lt;/h2&gt;&#xA;&lt;p&gt;We’ll design a server that:&lt;/p&gt;</description>
			</item>
			<item>
				<title>A Deep Dive into Go’s net Package: Networking from First Principles</title>
				<link>https://blog.birdor.com/go-net-deep-dive/</link>
				<pubDate>Tue, 25 Nov 2025 11:46:00 +0800</pubDate>
				<guid>https://blog.birdor.com/go-net-deep-dive/</guid>
				<description>&lt;p&gt;The &lt;code&gt;net&lt;/code&gt; package is the foundation of all network programming in Go.&lt;br&gt;&#xA;Everything — from HTTP servers to gRPC, Redis clients, DNS resolvers, and low-level TCP/UDP tools — ultimately relies on &lt;strong&gt;Go’s networking stack&lt;/strong&gt; built around the &lt;code&gt;net&lt;/code&gt; package.&lt;/p&gt;&#xA;&lt;p&gt;This article provides a &lt;strong&gt;deep, practical, and complete&lt;/strong&gt; exploration of &lt;code&gt;net&lt;/code&gt; with clear explanations and runnable examples.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h1 id=&#34;1-why-the-net-package-matters&#34;&gt;1. Why the &lt;code&gt;net&lt;/code&gt; Package Matters&lt;/h1&gt;&#xA;&lt;p&gt;Go’s networking model is:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Simple&lt;/strong&gt; – Uses familiar Unix-style sockets and file descriptors.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Cross-platform&lt;/strong&gt; – Same code works on Linux, macOS, Windows.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Concurrent by design&lt;/strong&gt; – Each connection can be handled by a goroutine.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Powerful&lt;/strong&gt; – TCP, UDP, Unix domain sockets, DNS, interfaces, IPs, CIDR tools, etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Higher-level packages rely on it:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Understanding Go’s context Package: A Deep Dive</title>
				<link>https://blog.birdor.com/go-context-deep-dive/</link>
				<pubDate>Mon, 24 Nov 2025 19:20:00 +0800</pubDate>
				<guid>https://blog.birdor.com/go-context-deep-dive/</guid>
				<description>&lt;p&gt;Go’s &lt;code&gt;context&lt;/code&gt; package is one of the most important tools for building &lt;strong&gt;robust, cancellable, timeout-aware, concurrent&lt;/strong&gt; programs. Whether you are writing HTTP servers, gRPC services, background workers, or database operations, you will almost always use &lt;code&gt;context.Context&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This article provides a &lt;strong&gt;deep, practical, and complete&lt;/strong&gt; analysis of the &lt;code&gt;context&lt;/code&gt; package using clear code examples.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;1-why-context-exists&#34;&gt;1. Why &lt;code&gt;context&lt;/code&gt; Exists&lt;/h2&gt;&#xA;&lt;p&gt;Modern Go programs are highly concurrent. You might start goroutines for:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;database queries&lt;/li&gt;&#xA;&lt;li&gt;API calls&lt;/li&gt;&#xA;&lt;li&gt;background tasks&lt;/li&gt;&#xA;&lt;li&gt;streaming events&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;But how do you &lt;strong&gt;cancel&lt;/strong&gt; a goroutine?&lt;br&gt;&#xA;How do you &lt;strong&gt;propagate deadlines&lt;/strong&gt; across function calls?&lt;br&gt;&#xA;How do you &lt;strong&gt;attach request-scoped values&lt;/strong&gt; safely?&lt;/p&gt;</description>
			</item>
			<item>
				<title>Getting Started with Go: A Practical Beginner’s Guide</title>
				<link>https://blog.birdor.com/go-getting-started/</link>
				<pubDate>Mon, 24 Nov 2025 19:00:00 +0800</pubDate>
				<guid>https://blog.birdor.com/go-getting-started/</guid>
				<description>&lt;p&gt;Go (often called &lt;strong&gt;Golang&lt;/strong&gt;) is a modern programming language designed at Google. It focuses on &lt;strong&gt;simplicity&lt;/strong&gt;, &lt;strong&gt;performance&lt;/strong&gt;, and &lt;strong&gt;built-in concurrency&lt;/strong&gt;. If you want to build fast web services, CLIs, tools, or backend systems, Go is a great choice.&lt;/p&gt;&#xA;&lt;p&gt;This article will walk you through Go from zero to a small, working example, with plenty of code you can copy, paste, and run.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;1-what-is-go-and-why-use-it&#34;&gt;1. What is Go and Why Use It?&lt;/h2&gt;&#xA;&lt;p&gt;Go is:&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
