Shorts: August 2026
9 Shorts posted in August 2026, each with a short summary. The same summaries in Japanese follow below.
-
How DNS Works
When you type a URL, DNS runs first, translating a name into the IP address the connection needs, much like a phone book for the internet. With over 350 million registered domains, it is distributed around the world. This Short follows a lookup through the browser and OS caches, a resolver, the root servers, the TLD servers and finally the authoritative server. It also explains caching and TTL, and why lowering the TTL before a change is standard practice.
Watch on YouTube -
How SSH Works
SSH replaced Telnet, which sent passwords and commands in plain text, by encrypting everything. This Short explains how both sides compute the same one-time session key while exchanging only public keys, then switch to faster symmetric encryption. It shows public key authentication with authorized_keys and a challenge signed with the private key, so no password is sent, and notes that EC2 .pem files and GitHub pushes rely on the same mechanism. Port forwarding through a bastion host is also covered.
Watch on YouTube -
Containers vs. Virtual Machines
To share a 32-core, 512 GB server among eight people, a hypervisor can split the hardware into virtual machines, each running its own OS. But every OS consumes memory and disk. Containers instead share a single OS and carve out an isolated space for each app using namespaces, which isolate how processes and networks are seen, and cgroups, which set CPU and memory shares. Without their own OS, containers start in seconds and weigh tens of megabytes.
Watch on YouTube -
How Database Transactions Work
Using a $200 bank transfer as an example, this Short explains why two updates must be grouped into one transaction with BEGIN, COMMIT and ROLLBACK. It walks through ACID, including how PostgreSQL and MySQL hide uncommitted changes and how write-ahead logging provides durability. It then covers the four isolation levels and the dirty, non-repeatable and phantom reads that weaker levels allow. For concurrent writes, MySQL locks rows, while PostgreSQL avoids waiting and aborts one transaction when it detects a conflict.
Watch on YouTube -
How API Authentication Works
Anyone who knows a URL can call an API, so authentication checks identity at the entrance. This Short compares four methods: Basic authentication, whose Base64 encoding is not encryption; API keys, which ease rate limits and usage-based billing but must be revoked if leaked; JWTs, signed tokens that free servers from sessions; and OAuth, which delegates login to providers like Google. It contrasts authentication with authorization and suggests API keys for simplicity, JWT for scale and OAuth for external integrations.
Watch on YouTube -
How WebP Makes Images Smaller
WebP can make the same photo about 26% smaller than PNG. This Short opens its RIFF container, where a VP8 chunk means lossy and VP8L means lossless. In lossless mode, Huffman coding is the only required step, and the rest is preprocessing that helps it work: subtract green, a predictor that stores only differences, a color cache, and distance-and-length references for repeats. Lossy VP8 follows the same idea, discarding fine detail and varying compression strength by segment.
Watch on YouTube -
How PNG Compression Works
PNG compresses images without losing a single pixel of quality. Huffman coding gives frequent values shorter codes, run-length encoding fails on alternating colors, and LZSS references earlier data by distance and length within a 32 KB window. For gradients, five filters, including Paeth, record differences from neighboring pixels, and each row gets the filter with the smallest sum of absolute values. Together this is Deflate, also used for HTTP compression, at the cost of encoding speed.
Watch on YouTube -
How the OSI Model Works
Network communication is divided into seven layers. Using a request to example.com, this Short walks down the stack: the browser builds an HTTP request, TLS encrypts it, a session ID is attached, TCP adds ports and sequence numbers, IP adds addresses and routing, the data link layer adds MAC addresses, and the physical layer sends signals. Routers read layer 3 and switches layer 2, the server unwraps the layers in reverse order, and each layer can be replaced independently.
Watch on YouTube -
How grep Searches So Fast
grep finds strings in huge files almost instantly. This Short compares search algorithms: the naive method rereads the same text after each mismatch, Knuth-Morris-Pratt never moves backward because it reuses what has already matched, and Boyer-Moore, which grep uses, compares from the end of the pattern and skips ahead when a character does not appear in the pattern, so most of the text is never read. For regular expressions, grep runs an automaton in a single pass instead.
Watch on YouTube
2026年8月のショート動画
2026年8月に投稿したショート動画 9 本の要約です。
-
DNSの仕組み
ブラウザーにURLを打つと最初に動くのがDNSで、インターネットの電話帳のように、名前を接続に必要なIPアドレスに変えます。登録されたドメインは3億5000万件以上あるため、DNSは世界中に分散した仕組みになっています。ブラウザーとOSのキャッシュ、リゾルバー、ルートサーバー、TLDのサーバー、そして権威サーバーへと問い合わせが進む流れをたどります。キャッシュとTTLの仕組み、切り替えの前にTTLを短くしておくのが定石である理由も解説します。
-
SSHの仕組み
SSHは、パスワードもコマンドも平文で流していたTelnetに代わり、通信をすべて暗号化します。公開鍵だけを交換して両者が同じ使い捨てのセッション鍵を計算し、その後はより速い共通鍵方式で暗号化する流れを解説します。authorized_keysに置いた公開鍵と、サーバーが送るチャレンジへの秘密鍵による署名で認証するのでパスワードが流れないこと、EC2の.pemファイルやGitHubへのプッシュも同じ仕組みで動いていることも紹介します。踏み台を経由するポートフォワーディングも取り上げます。
-
コンテナとVMの仕組み
32コア・512GBのサーバーを8人で分けるとき、ハイパーバイザーはハードウェアを仮想マシンに分け、それぞれが自分専用のOSを丸ごと動かします。弱点は、OSの数だけメモリとディスクを消費することです。コンテナは1つのOSを共有し、その中にアプリごとの隔離された空間を切り出します。プロセスやネットワークの見え方を隔離する名前空間と、CPUやメモリの取り分を決めるcgroupsを使います。OSを積まないので、起動は数秒、サイズも数十MBで済みます。
-
トランザクションの仕組み
200ドルの送金を例に、2つの更新をBEGIN、COMMIT、ROLLBACKで1つのトランザクションにまとめる必要がある理由を解説します。ACIDの4つの性質を順に取り上げ、PostgreSQLやMySQLがコミット前の変更を他から見えなくする方法や、WALが永続性を支えることも説明します。さらに4つの分離レベルと、弱いレベルで起きるダーティーリード、反復不能読み取り、ファントムリードを紹介します。同じ行への同時書き込みでは、MySQLは行ロックで順番待ちさせ、PostgreSQLは待たせずに矛盾を見つけたら片方を止めます。
-
API認証の仕組み
URLさえ知っていれば誰でもAPIを呼べてしまうため、入り口で身分を確認するのが認証です。4つの代表的な方式を比べます。Base64は暗号化ではないため誰でも元に戻せるベーシック認証、アクセス回数の制限や従量課金がしやすい一方で漏れたら失効させるしかないAPIキー、署名付きトークンによってサーバーがセッションを持たずに済むJWT、そしてGoogleなどに認証を任せるOAuthです。認証と認可の違いを説明し、手軽さならAPIキー、規模ならJWT、外部連携ならOAuthと整理します。
-
WebPの仕組み
WebPは同じ写真をPNGより約26%小さくできます。中身のRIFFコンテナを開くと、VP8のチャンクなら非可逆、VP8Lなら可逆です。可逆モードで必須の工程はハフマン符号化だけで、残りはそれを効かせるための前処理です。赤と青から緑を引くサブトラクトグリーン、予測との差分だけを記録するプレディクター、カラーキャッシュ、繰り返しを距離と長さで表す参照を紹介します。非可逆のVP8も考え方は同じで、細かい成分を捨て、セグメントごとに圧縮の強さを変えます。
-
PNGの仕組み
PNGは画質を一切落とさない可逆圧縮です。ハフマン符号化はよく出る値ほど短い符号にし、ランレングス符号化は2色が交互に並ぶと縮まず、LZSSは32KBの窓の中で前に出た並びを距離と長さで参照します。グラデーションには、Paethを含む5種類のフィルターで隣のピクセルとの差を記録し、行ごとに絶対値の合計が最小になるフィルターを選びます。これらを合わせたものがHTTP圧縮でも使われるDeflateで、代わりにエンコードの速度が犠牲になります。
-
OSI参照モデルの仕組み
ネットワーク通信は7つの層に分かれています。example.comへのリクエストを例に、層を上から順にたどります。ブラウザーがHTTPリクエストを作り、TLSで暗号化し、セッションIDをつけ、TCPがポート番号とシーケンス番号を、IPがアドレスと経路を、データリンク層がMACアドレスを加え、物理層が信号として送り出します。ルーターはレイヤー3を、スイッチはレイヤー2を読み、サーバーでは逆の順番で包みを外します。層で分けているので、それぞれを独立して差し替えられます。
-
grep検索の仕組み
grepは巨大なファイルでも文字列を一瞬で見つけます。文字列検索のアルゴリズムを比べ、不一致のたびに同じところを読み直す素朴な方法、一致した部分の情報を使ってテキストを一度も戻らないKMP法、そしてgrepが使うボイヤー・ムーア法を紹介します。ボイヤー・ムーア法はパターンの後ろから比べ、パターンにない文字があれば丸ごと飛ばすので、テキストの大半を見ずに済みます。正規表現の場合は、オートマトンでテキストを1回なぞって判定します。