AI summaryThe author, who recently left Stainless to run River (a job queue for Go and Postgres) as a business, addresses skepticism about selling software in the age of LLMs by arguing that building internal replacements with AI is cheaper than before but still not free. Using cost math with examples like a $400/mo Jira subscription (not worth rebuilding) versus $25k/mo of Salesforce seats (worth building), he proposes a 'zone of viability' where software with enough novelty and reasonable pricing remains cheaper to buy than to build. He hopes River, with its advanced Pro features and sublinear team-based pricing starting at $125/mo, sits above the 'minimum viable unit of saleable software' and remains a sustainable business.
AI summaryThe article recounts the 'first wave' of open APIs in the early 2010s, exemplified by Facebook, Twitter, and GitHub, followed by an 'API winter' when companies restricted access due to monetization pressures, abuse, and competitive risks. The author predicts a 'second wave' driven by powerful LLM agents acting on users' behalf, which will make APIs a key competitive factor across services like banks, retailers, and social platforms. Unlike the first wave, these APIs will mirror first-party product capabilities for individual users' agents, with simpler security models and stricter rate limiting rather than enabling third-party apps.
AI summaryThe article explains the N+1 query problem, in which rendering a collection of records triggers an extra database query per record due to lazy loading of associations, and it surveys mitigation strategies such as ActiveRecord eager loading, Rails 6.1's strict loading, and Stripe's creative use of Ruby fibers to batch database intents. It then describes how the author adopted a two-phase load-and-render pattern in Go at their current company, which loads all required data in batched queries before rendering and has eliminated N+1s for two years. The pattern works well despite Go's inherent verbosity and lack of a good ORM.
AI summaryThe article introduces the 'notifier pattern' for applications using Postgres LISTEN/NOTIFY, in which a single Postgres connection per process manages all topic subscriptions and distributes received notifications to the various components that want them, conserving Postgres's limited connections compared to the naive one-connection-per-topic approach. Key implementation details include buffered channels with non-blocking sends so slow components can't stall the system, reusing a single LISTEN per topic for multiple subscribers, an 'established' channel to confirm subscriptions for testing, interruptible notification waits so new subscriptions can be processed promptly, and crash-and-restart handling for unhealthy connections. The pattern remains compatible with PgBouncer since only this one dedicated connection needs session pooling while the rest of the application can use transaction or statement pooling.
AI summaryThe article explains how Go's DisallowUnknownFields JSON decoder option improves developer experience for web APIs by returning an error when a request contains fields that don't exist in the target struct, catching mistakes like sending "expires" instead of "expires_in". It also covers practical caveats, such as safely enabling the check on existing APIs through logging probes and grandfathering known bad fields, deprecating old fields carefully, and providing escape hatches for endpoints like webhook receivers. Finally, it notes the pattern is portable to other languages and can be enhanced with Levenshtein distance suggestions, e.g., telling users who send "expires" that they probably meant "expires_in".
AI summaryThe author introduces River, a new open-source job queue for Go built on Postgres and the pgx driver, now available in beta. He explains why transactional, database-backed job queues avoid a host of distributed systems problems, and argues that past troubles with Postgres queues (like those at Heroku) are now mitigated by modern advances such as Go generics and goroutine concurrency, Postgres features like SKIP LOCKED and index optimizations, and a minimized single-dependency stack. River offers strongly-typed jobs, batch insertion, unique and periodic jobs, and solid performance, processing around 10,000 trivial jobs per second on a laptop.
AI summaryThe article examines Go's `t.Parallel()`, which lets tests within a package run concurrently and cut the runtime of the author's large API test suite by 30-40%, though it notes the practice isn't broadly conventional—only about 1/10 of Go's own test suite uses it. It details several 'sharp edges' of parallel testing: sharing a test database safely via test transactions, resolving Postgres upsert deadlocks by switching to fixture seeding, and collating interleaved logs using `t.Logf` through a logging library shim. The author concludes that while Go's default package-level parallelism is often sufficient, adopting `t.Parallel()` early is worthwhile since retrofitting it later is harder than building it in from the start.
AI summaryThe article argues that soft deletion—marking rows with a deleted_at timestamp instead of hard-deleting them—causes significant problems: deletion logic leaks into every query, foreign key referential integrity is effectively lost, pruning old data for regulations like GDPR becomes painfully complex, and undeletion rarely works in practice since deletions usually have side effects in other systems that can't be reversed. The author proposes an alternative: moving deleted rows into a dedicated deleted_record table with a flexible jsonb column, which keeps normal queries clean, preserves foreign key guarantees, and makes hard deletion trivial while still retaining data for occasional inspection.
AI summaryAlthough common Postgres wisdom says unbounded text is preferable to varchar(n) since length constraints offer no performance benefit, the author recounts how at Stripe the lack of length checks on API text fields let legitimate users send enormous payloads that couldn't later be restricted without breaking backwards compatibility (a manifestation of Hyrum's law). He now recommends using varchar columns with liberal, standardized length tiers (e.g., 200, 2000, and 20000 characters) as a database-level backstop against wildly invalid data, while still validating lengths in application code with proper error handling. He also notes that Postgres can relax varchar constraints without an expensive table rewrite, and suggests encoding these tiers as SQL domains for consistency.
AI summaryThe article describes how the authors evaluated Go's database ecosystem—including database/sql, pgx, go-pg, and gorm—and concluded that sqlc paired with pgx is the best solution for using Postgres in Go applications. sqlc generates type-safe Go code from annotated SQL files, eliminating string-based query fragility and ORM boilerplate while providing compile-time validation through Postgres's real query parser. Although it has some limitations like fixed parameter counts and pre-structured updates, workarounds exist, and recent pgx driver support allowed the team to adopt it incrementally alongside their existing codebase.
AI summaryThe author discovered that web analytics tools like Google Analytics and Goatcounter are widely blocked by adblockers, causing severe undercounting—during a Hacker News traffic spike, actual traffic was roughly 2.5x higher than analytics reported, suggesting about 60% of readers use adblockers. As a more accurate and privacy-friendly alternative, the author describes analyzing raw CloudFront access logs using GoAccess for terminal/HTML visualization and AWS Athena for running ad-hoc SQL queries at low cost.
AI summaryThe article describes how large databases tend to lose important features over time—such as ACID transactions, referential integrity, non-nullable columns, efficient indexing, and expressive SQL access—due to technological limitations, stability concerns, cost, and convenience, often reducing sophisticated systems to glorified key/value stores. The author argues this degradation isn't inevitable, citing systems like Citus, Spanner, and CockroachDB that restore difficult features like cross-shard transactions, and proposes operations-friendly improvements such as pauseable index builds, easier NOT NULL migrations, a strict SQL dialect, query efficiency signaling, and built-in migration frameworks.
AI summaryThe article describes a recently committed Postgres patch that adds SortSupport to the inet and cidr network address types, roughly doubling their sorting speed by generating abbreviated keys that fit into a pointer-sized datum. It explains the structure and sorting rules of network types—including IP family, network bits, netmask size, and subnet—and how the abbreviated key design packs these components into the available bits while preserving correct comparison semantics. Finally, it walks through the C implementation, using bitwise operations such as bitmasking to efficiently encode each part of the key.
AI summaryThe author laments the web's growing centralization into walled-garden platforms like Facebook and Medium, arguing that renewed decentralization depends on people continuing to create content that lives outside them. In that spirit of old-internet experimentation, they've launched Sequences, a self-hosted project in Berlin publishing one photo per day with a few words of text, distributed via RSS feed and announced on Twitter. It's framed as an independent, old-school alternative to Instagram, with no likes, comments, or reactions—just content published openly to the web.
AI summaryThe author describes implementing live reloading for a custom Go-based static site generator, using fsnotify to watch for file changes (with special handling for editor artifacts like Vim's backup files and the mysterious 4913 file) and coordinating watch/build goroutines so changes arriving during a build trigger a follow-up rebuild. Build completion is broadcast to browsers over WebSockets via Gorilla's library using a condition variable, prompting a tiny client-side JavaScript snippet to reload the page. The article also covers keeping connections alive with automatic reconnection and reflects on how well-abstracted foundational libraries made the implementation surprisingly simple.
AI summaryThe article explains SortSupport, a Postgres optimization that speeds up sorting by storing abbreviated keys—compact digests of larger pass-by-reference values—directly in sort tuples, avoiding slower references back to the heap; this made UUID sorting roughly twice as fast and string-based operations like CREATE INDEX about three times faster. It walks through the implementation using UUIDs as an example, covering how abbreviated keys are built, byteswapped for little-endian architectures, and compared as integers, with full-value 'authoritative comparisons' used as a fallback when abbreviated keys tie. Finally, it describes a safety mechanism that uses HyperLogLog to estimate cardinality and abort abbreviation on low-cardinality data sets where the optimization would actually hurt performance.
AI summaryThe article explains why Postgres enforces strict connection limits (defaulting to 100, with cloud providers capping even large databases at 500): because of its process-based architecture and shared-memory bottlenecks, performance degrades reliably as the number of active connections grows. It then presents techniques for using connections more efficiently, including node-local connection pools, holding connections only for the minimum span of core application logic, releasing them during slow foreign API calls, and using PgBouncer as a global pool across nodes. The author concludes that developers should treat database connections as a scarce resource and understand connection management directly rather than relying on framework abstractions.
AI summaryPostgres 11 makes ALTER TABLE ... ADD COLUMN with a non-null DEFAULT fast by eliminating the full table rewrite and ACCESS EXCLUSIVE lock that previously blocked all operations on large tables. Under the hood, new pg_attribute fields (atthasmissing and attmissingval) supply missing default values to existing rows on the fly, while new rows are populated as they're inserted. This change means operators can now maintain strong data integrity through non-null constraints without risking long lock-induced outages in production.
AI summaryThe article describes the 10,000 Year Clock ('Clock of the Long Now') being built inside a Texas mountain by the Long Now Foundation to encourage long-term thinking, and how it inspired the author to create 'Perpetual,' a simple program that posts ten tweets at exponentially increasing intervals, with the final one scheduled 10,000 years from now. The program is engineered for maximum longevity—running serverlessly on AWS Lambda, written in Go with no persistent state—yet the author acknowledges it faces many existential threats, such as API changes and platform retirements, and will likely fail long before reaching its goal, probably due to changes in Twitter's API. Ultimately, the piece argues that the clock's design principles—longevity, maintainability, transparency, evolvability, and scalability—can be adapted as valuable guidelines for building longer-lasting software.
AI summaryThis article, originally written in 2018 with a 2025 update, makes the case that GraphQL improves on REST through explicit field contracts, automatic introspection, typed schemas, built-in batch operations, and graph-based modeling, enabling APIs to evolve gradually as 'living' systems rather than ossifying around rigid versions. The author acknowledges, however, that GraphQL is 'better but not better enough'—REST's low bar is adequate for most purposes, and its momentum explains why major providers like Amazon, Google, and Stripe have not adopted GraphQL. The 2025 update tempers the original enthusiasm, suggesting that alternatives like HTTP/3 combined with SDK-driven design may ultimately be a better compromise.