Newsletter #83
Enjoy Newsletter #83.
How Uber Scaled Data Replication to Move Petabytes Every Day
Uber shares how its engineering team scaled HiveSync—its cross-region data replication service built on Apache Hadoop DistCp—to keep pace with a data lake exceeding 350 PB. In Q3 2022 alone, daily replicated data volume jumped from 250 TB to 1 PB, the number of datasets managed by HiveSync grew from 30,000 to 144,000, and daily replication jobs surged from 10,000 to 374,000. This growth was driven by an active-passive architecture that concentrated ~90% of writes in the primary region, onboarding all Hive datasets into HiveSync, and an upcoming cloud migration. Under that load, replication latency SLAs (P100 under 4 hours, P99.9 under 20 minutes) were slipping.
To fix this, Uber made four targeted improvements to DistCp. First, they offloaded two resource-intensive phases—Copy Listing and Input Splitting—from the central HiveSync server to the YARN Application Master, cutting job submission latency by 90%. Second, they parallelized Copy Listing across a thread pool making concurrent namenode RPCs, reducing p99 latency by 60% and max latency by 75%. Third, they parallelized file concatenation inside the Copy Committer, slashing merge time by 97.29%. Finally, they enabled “Uber jobs” to run single-mapper replication tasks (which accounted for 52% of all jobs) directly inside the Application Master JVM, eliminating roughly 268,000 YARN container launches per day. Together, these optimizations increased incremental replication throughput 5x within a year and enabled Uber to migrate over 306 PB of data to the cloud.
How to write a good spec for AI agents
Addy Osmani lays out a practical framework for writing specifications for AI coding agents, addressing a classic tension: a spec needs enough detail to steer the agent accurately without bloating the prompt and overwhelming the context window. Principle one is to start with a high-level vision—provide a concise objective and let the agent expand it into a detailed plan that you review and refine. Principle two is to structure the spec like a Product Requirements Document (PRD) covering six essential areas: executable commands, testing conventions, project structure, code style examples, Git workflow, and explicit boundaries. An analysis by GitHub of over 2,500 agent configuration files found that vague, high-level instructions were the single most common failure mode.
Principle three is to break work into modular prompts or sub-agent tasks rather than one massive monolith, since the “curse of instructions” causes model adherence to drop sharply when too many rules compete at once. Principle four is building in quality gates: a three-tier boundary system (“Always do,” “Ask first,” and “Never do”) paired with self-verification hooks. Finally, treat the spec as a living document that gets tested and updated as the codebase evolves. The article also warns against common pitfalls like vague prompts (“build something cool”), dumping raw context without summarization, skipping human code review, and moving faster than your ability to verify.
Unconventional PostgreSQL Optimizations
Haki Benita walks through three unconventional PostgreSQL optimization techniques. First is enabling constraint_exclusion = on so the query planner uses table CHECK constraints to skip full table scans altogether. When a user accidentally queries a value that violates a check constraint—for example, WHERE plan = 'Pro' when the constraint only allows lowercase 'free' or 'pro'—PostgreSQL’s default partition setting still scans the entire table (taking ~7.4 ms in the benchmark), whereas turning constraint_exclusion on lets the planner prove the query cannot match any rows and return instantaneously. Because checking constraints adds planning overhead, PostgreSQL defaults to only checking them on inherited partitions and UNION ALL queries, making on best suited for analytics or reporting databases where users write ad-hoc queries.
The second technique is indexing a lower-cardinality expression: instead of building a B-Tree index on a raw timestamptz column (214 MB), indexing the truncated date via date_trunc('day', ...) shrinks the index to 66 MB—over 3x smaller—and speeds up queries through page-level deduplication. Because expression indexes only kick in when queries write the exact same expression, he suggests pairing them with PostgreSQL 18’s virtual generated columns for ergonomics. The third technique enforces uniqueness on large text values like URLs using a hash index: PostgreSQL doesn’t support UNIQUE hash indexes directly, but you can create an EXCLUDE USING hash (url WITH =) exclusion constraint, shrinking the index from 154 MB (B-Tree) down to 32 MB—nearly 5x smaller. The trade-offs are that exclusion constraints cannot be referenced by foreign keys and do not support ON CONFLICT (url) DO UPDATE.
Software engineering when machine writes the code
Shayon Mukherjee reflects on what happens to software engineering when machines write the bulk of the code. He isn’t anti-AI, but worries that in chasing raw velocity we are trading away deep system comprehension. By Jevons paradox, making a resource more efficient increases total consumption; similarly, AI won’t lead us to write less software—it will lead us to build sprawling, complex systems faster than humans can mentally absorb them. He contrasts writing code by hand—where you build a rich mental model through hundreds of micro-decisions—with reviewing AI-generated PRs, where you try to reconstruct understanding after the fact. Accepting working code without truly understanding why it works creates dangerous blind spots during 3 a.m. incidents and long-term maintenance.
He is especially concerned for junior engineers: if they skip the formative struggle of implementing things from scratch, making mistakes, and debugging for hours, they may never develop the pattern recognition and architectural intuition that only come from friction. His suggested remedy is using AI as a Socratic tutor to explain concepts and trade-offs while still writing the implementation yourself. He also proposes a zoned approach to codebases: core domain logic demands deep human ownership with minimal AI generation, standard application code can lean on AI with thorough review, and pure boilerplate can be delegated almost entirely to AI.
A Guide to Effective Prompt Engineering
ByteByteGo presents a practical guide to prompt engineering—crafting instructions that reliably elicit the right output from large language models. Anyone can type a prompt, but getting consistent, high-quality results is a distinct engineering skill. A well-structured prompt typically combines four elements: task description, background context, illustrative examples, and specific output constraints. Modern LLM APIs also split instructions into a system prompt (defining role, tone, and guardrails) and a user prompt (the actual task). Clarity is paramount: state exactly what you want, define the output format explicitly, and never assume the model can read your mind; supplying sufficient context also dramatically reduces hallucinations. The post notes how models use in-context learning from examples in the prompt, and points out the “lost in the middle” effect where models pay closer attention to instructions at the very beginning and end of a long prompt.
Five core prompting techniques are covered: zero-shot prompting (direct instructions with no examples, suited for simple tasks); few-shot prompting (providing two to five input–output examples to demonstrate the exact pattern and format); chain-of-thought prompting (asking the model to reason step by step before answering complex logic or math problems); role prompting (assigning a persona to anchor perspective and depth); and prompt chaining (breaking a complex workflow into a sequence of focused prompts). On best practices, iterate systematically, version-control your prompts, and test against diverse inputs and edge cases while avoiding vague phrasing, bloated walls of text, and unspecified output formats.
This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.
Comments