Advanced guides.
Under the hood: container isolation, cgroups, sandboxing untrusted code, and the architecture behind multi-tenant platforms.
75 posts · page 1 of 3
SBOMs and Signed Images: Software Supply Chain Security With Syft and Cosign
How to know what's in your container images and prove they came from your CI: generating SBOMs with Syft or BuildKit attestations, scanning them for vulnerabilities, signing images keylessly with Cosign and GitHub Actions OIDC, verifying by identity, adding SLSA provenance, and enforcing it at deploy time.
Postgres Transaction ID Wraparound: How It Happens and How to Prevent It
Postgres transaction IDs are 32-bit and wrap around after about two billion transactions; VACUUM freezing is what keeps old rows visible. How wraparound works, the settings that control freezing, the queries to monitor age(datfrozenxid), what blocks freezing (long transactions, replication slots, prepared transactions), and what to do if the database stops accepting writes.
Postgres Replication Slots: Why an Inactive Slot Can Fill Your Disk
Replication slots guarantee a replica or CDC consumer never misses WAL — by keeping it until the consumer confirms it. When the consumer disappears, WAL piles up until the disk is full. How slots work, how to measure retained WAL, max_slot_wal_keep_size and idle timeouts, the xmin side effect, and safe cleanup.
Postgres Index Bloat and REINDEX CONCURRENTLY: Rebuilding Indexes Without Downtime
B-tree indexes in Postgres bloat under heavy updates and deletes, slowing queries and wasting memory. How to measure index bloat with pgstattuple, rebuild indexes online with REINDEX CONCURRENTLY, what it locks, how to clean up invalid _ccnew indexes after a failure, and how to reduce bloat in the first place.
Postgres Logical Replication: Publications, Subscriptions and Near-Zero-Downtime Upgrades
Logical replication streams row-level changes from chosen tables to another Postgres — even a different major version. How publications and subscriptions work, replica identity, the initial copy, what isn't replicated (DDL, sequences), conflicts, monitoring, and a step-by-step major-version upgrade with a short cutover.
nftables vs iptables: The Linux Firewall, Then and Now
nftables is the successor to iptables in the Linux kernel: one tool for IPv4, IPv6 and more, sets and maps, atomic rule updates, and a cleaner syntax. How the two relate (including iptables-nft), a complete server ruleset, translating rules, and the Docker, UFW and firewalld interactions that trip people up.
Linux TCP Backlog, somaxconn and TIME_WAIT: Why Connections Get Dropped Under Load
When a server falls behind under load, new connections queue in the kernel — and when that queue overflows, they're silently dropped. How the SYN and accept queues work, net.core.somaxconn and the listen() backlog, spotting overflows with ss and nstat, and why TIME_WAIT and ephemeral port exhaustion bite services that make lots of outbound connections.
Linux Memory Overcommit: Why malloc Never Fails and the OOM Killer Does
Linux lets processes allocate more memory than exists, betting they won't all use it — that's overcommit. How the three vm.overcommit_memory modes work, CommitLimit and Committed_AS, why fork and copy-on-write depend on it, why Redis wants mode 1 and Postgres prefers mode 2, and how cgroup limits change the picture.
fsync Explained: When Is Data Actually on Disk?
write() returns long before your data is safe — it sits in the page cache, and possibly in the drive's volatile cache. How fsync, fdatasync and O_DIRECT relate to durability, why you must also fsync directories, the atomic write-rename pattern, what Postgres learned from fsyncgate, and how databases trade durability for speed.
CRIU: Checkpoint and Restore Running Linux Processes
CRIU (Checkpoint/Restore In Userspace) freezes a running process tree, saves its complete state to disk, and restores it later — on the same machine or another. How it works, using it with Podman, Docker and Kubernetes, what it can't capture (GPUs, external connections), permissions, and how it compares with VM snapshots for persistent agent workspaces.
What Is eBPF? Safe Programs Inside the Linux Kernel, Explained
eBPF lets you run small, verified programs inside the Linux kernel at hook points — syscalls, network packets, function entry — without kernel modules. How it works (verifier, JIT, maps, hooks), what it powers, bpftrace one-liners, and its limits and security implications.
WebAssembly as a Sandbox: Running Untrusted Code With Wasmtime and WASI
WebAssembly's design makes it a strong in-process sandbox: linear memory, no ambient authority, and capability-based access through WASI. How the isolation works, limiting CPU with fuel and epochs, memory limits, the component model, real uses for plugins and user code, and where it falls short.
vsock Explained: Talking Between a VM and Its Host Without a Network
vsock is a socket family for communication between a virtual machine and its host — no IP addresses, no network interface, no firewall rules. How AF_VSOCK addressing with CIDs and ports works, vhost-vsock in QEMU, Firecracker's Unix-socket bridge, how sandboxes use it for guest agents, and the security model.
V8 Isolates: How Edge Platforms Run Thousands of Tenants in One Process
A V8 isolate is an independent JavaScript heap and execution context inside one process. How isolates make edge runtimes start in milliseconds and pack thousands of tenants together, what isolation they provide, Spectre and the extra layers platforms add, limits, and isolates vs containers vs VMs.
The TLS 1.3 Handshake Explained: What Happens Before the First Byte
What actually happens when a browser connects over HTTPS: ClientHello, key shares, the server's certificate and signature, Finished messages, one round trip instead of two, 0-RTT resumption and its replay risk, SNI and ECH, certificate chain validation, and how to inspect it all with openssl.
runc and OCI Runtimes: What Actually Starts Your Container
Below Docker and containerd sits a small program that creates the namespaces, cgroups and mounts and execs your process: the OCI runtime. The OCI image, runtime and distribution specs, a bundle and config.json, running runc by hand, alternatives (crun, youki, gVisor's runsc, Kata), and runc's notable escapes.
The Postgres Write-Ahead Log (WAL) Explained
Every change in Postgres is written to the write-ahead log before the data files. How WAL gives durability and crash recovery, LSNs and segments, checkpoints and full-page writes, synchronous_commit, wal_level, archiving and replication, and the replication-slot trap that fills disks.
Postgres TOAST: How Large Values Are Stored (and Why It Affects Performance)
Postgres pages are 8 KB, so large values are compressed and moved out of line into a TOAST table. The ~2 KB threshold, storage strategies (PLAIN, MAIN, EXTERNAL, EXTENDED), pglz vs lz4 compression, measuring TOAST size, and the performance traps with SELECT *, big JSONB documents and frequent updates.
Postgres Timeouts: statement_timeout, lock_timeout and Friends
Postgres ships with every timeout disabled, so a stuck query or forgotten transaction can hold locks forever. What statement_timeout, lock_timeout, idle_in_transaction_session_timeout, transaction_timeout and idle_session_timeout do, the lock-queue outage they prevent, safe values, and where to set them.
Postgres Read Replicas: Streaming Replication, Lag, and Read-Your-Writes
How Postgres physical streaming replication works, sync vs async, measuring replication lag, query conflicts and hot_standby_feedback, routing reads in your app without breaking read-your-writes, replication slots that fill disks, and when a replica is the wrong fix.
Postgres Planner Statistics: Why the Query Plan Is Wrong
Postgres picks query plans from statistics about your data. When they're stale or too coarse, row estimates are off by orders of magnitude and the planner chooses a terrible plan. How ANALYZE samples tables, reading pg_stats, default_statistics_target, correlated columns and CREATE STATISTICS, and fixing misestimates.
Postgres MVCC Explained: Tuples, xmin/xmax, Snapshots and Why VACUUM Exists
How PostgreSQL lets readers and writers work without blocking each other: every UPDATE writes a new row version, transactions see a snapshot, and visibility is decided by xmin and xmax. See it with real queries, and how it explains bloat, VACUUM, HOT updates, long transactions and wraparound.
Postgres Memory Tuning: shared_buffers, work_mem and the Rest
Postgres's memory settings are conservative by default and easy to get dangerously wrong. How shared_buffers and the OS page cache work together, why work_mem is per operation not per query, maintenance_work_mem, effective_cache_size, huge pages, and worked settings for 4, 8 and 16 GB servers.
Postgres Index Types: B-tree, GIN, GiST, BRIN, Hash — and When Each Wins
Postgres has more index types than most databases, and choosing well can turn a sequential scan into milliseconds. How B-tree, GIN, GiST, SP-GiST, BRIN and hash indexes work, which operators each supports, partial and expression indexes, covering indexes, and how to verify the planner uses them.