#618 – March 23, 2025
How distributed locks prevent data corruption
Distributed Locking: A Practical Guide
21 minutes by Oskar Dudycz
Oskar dives deep into how distributed locks prevent data corruption when multiple services access shared resources simultaneously. He explores implementation options including Redis, ZooKeeper/etcd, database locks, and Kubernetes single-instance deployments. Each approach offers different trade-offs in terms of complexity, consistency guarantees, and operational overhead. The author advises choosing the simplest solution for your infrastructure, locking only critical sections, planning for failure scenarios, and understanding that no distributed lock can be 100% guaranteed under network partitions.
The intelligent terminal with AI built for Mac, Linux, and now Windows
sponsored by Warp
Never forget a command or struggle with syntax again. Warps Agent Mode allows you to type in natural language to accomplish any task right in the terminal. Store and share resources, from repeatable runbooks to templatized commands with Warp Drive.
Life Altering Postgresql Patterns
13 minutes by Ethan McCue
In this article Ethan outlines 11 best practices for working with PostgreSQL databases that can significantly improve developer experience. These include using UUID primary keys, adding created_at and updated_at timestamps to all tables, using restrict constraints for foreign keys, leveraging schemas for organization, implementing enum tables, naming tables in singular form, properly naming join tables, implementing soft deletes, tracking statuses as logs, marking special rows with system_id, using views sparingly, and utilizing JSON for query results to avoid N+1 problems.
Unspoken git secrets that save you mountains of time as an engineer
6 minutes by Jordan Cutler
Jordan shares advanced git commands that experienced developers use to save time and boost productivity. Key highlights include: using `git checkout -` to quickly switch between branches, leveraging `git bisect` to find the exact commit that introduced a bug through binary search, tracking code changes with `git log -G` and `-S` to find specific modifications, managing merge conflicts with `-X theirs` or `-X ours` options, and several performance-enhancing git configurations like `core.fsmonitor` and `push.autosetupremote`.
How Long Should Functions Be?
3 minutes by Kent Beck
Kent discusses the concept that software is grown rather than made, arguing against prescriptive function length limits. Analyzing JUnit 5 code, Kent found function lengths follow a power law distribution where most functions are short while a few are quite long. This distribution suggests that as projects grow, longer functions naturally emerge, and while we can't escape this power law relationship, practices like Test-Driven Development may help increase the proportion of shorter functions.
No Longer My Favorite Git Commit
10 minutes by Michael Lynch
Michael explains why they no longer view the commit message as a model example despite its engaging storytelling and thoroughness. He identifies key flaws: it buries critical information instead of using an "inverted pyramid" structure, fails to clearly explain the actual problem, and references code without proper links. He concludes with his improved rewrite of the commit message and reflects on the importance of defining one's own software engineering principles.
And the most popular article from the last issue was: