AI Books
AI-generated mini-series and books on various topics, built with writing-agent.
Event Sourcing and CQRS in Practice
Why Event Sourcing !CRUD vs Event Sourcing comparison CRUD systems store only the current state. Every UPDATE destroys the previous value. Event sourcing stores the sequence of state transitions,...
Fast by Design
The Measurement Discipline: Benchmarks, Profilers, and Why Your Intuition Is Wrong You have been wrong about your bottleneck. Not always. Not on every system. But on the last production performance...
Resilience Patterns in Production
How Distributed Systems Fail Your service does not fail because of bugs. Not usually. It fails because another service changed its behavior in a way you did not anticipate, and your service had no...
Spring Internals
ApplicationContext Lifecycle is where every Spring Boot application begins. One static method call. What happens between that call and the moment your first HTTP request is served involves over...
Unbound: MongoDB at Scale
The Measurement Discipline Before you add an index, tune a connection pool, or restructure a schema, you need a number. Not a guess. Not a hunch from the last incident. A number that describes...
Search at Depth
The Inverted Index Every search result your users see begins with a data structure built during indexing, not during query time. The inverted index maps terms to the documents that contain them. When...
Ship it and Sleep
What Modern CI/CD Actually Means Your pipeline runs on push. It builds a Docker image, runs some tests, pushes the image to a registry, and updates a deployment manifest. On a good day, new code...
The Auth Layer
How Authentication Actually Works Every authentication system hides state. The question is where. A session cookie hides state on the server. A JWT hides state on the client. A refresh token hides...
Data Systems from the Ground Up
The Simplest Database: A File, an Append, and a Linear Scan Every database you have ever used is a file on disk with a strategy for writing to it and a strategy for reading from it. PostgreSQL,...
Surviving the Spike
Measuring Before Optimizing Before you tune a connection pool, add a cache, or split a monolith, you need a number. Not a guess. Not a feeling. A number that describes exactly how your system behaves...
The Lies Your ORM Tells You
The N+1 You Didn't Write The Lie Hibernate tells you that lazy loading is an optimization. Load the parent entity, and the children will be fetched only when you actually need them. Sounds...
AWS in the Trenches: Advanced Cloud Engineering for Senior Developers
IAM: The Real Security Model Every AWS API call passes through the same gate: IAM's policy evaluation engine. You've written and hundreds of times, but do you actually know what happens when an...
Digital Payment Systems: Cryptography, Banking Protocols, and Blockchain Internals
Cryptographic Foundations of Payment Security Every time a payment moves through a system — whether it's a chip card tapping a terminal, a wire transfer crossing SWIFT, or a Bitcoin transaction...
Kotlin in Depth: Advanced Patterns for Java Engineers
Kotlin's Type System Unmasked Java's type system has a fracture running through its core. On one side: eight primitive types (, , , ...) that don't participate in the object hierarchy, can't be null,...
Mastering CKAD: Certified Kubernetes Application Developer
This chapter introduces the Certified Kubernetes Application Developer (CKAD) exam, covering its practical, performance-based format, the 2-hour time constraint across 15-20 scenario-based tasks, the 66% passing threshold, and the strategic mindset required to pass. It sets expectations for who this book serves and what separates candidates who pass from those who don't.
Pragmatic Data Science with Python
This chapter confronts the uncomfortable gap between a data scientist's local notebook and a production system that runs reliably at 3 AM without human intervention. We examine the four pillars of production readiness — dependency management, type safety, repository structure, and data version control — and build a modern Python toolchain that prevents the most common deployment failures before they happen.
The Invisible Layer: How Abstraction is Making Software Engineers Dumber
Opens with a senior engineer unable to diagnose a production outage caused by TCP keepalive misconfiguration and DNS TTL caching, then broadens into the book's central thesis: that we have systematically traded understanding for convenience, and the bill is coming due. Concludes with a roadmap of the five parts and eighteen chapters.
Building Large Language Models from Scratch: A Beginner's Guide with Python and PyTorch
This chapter introduces Large Language Models through accessible analogies, outlines the complete book roadmap across 11 chapters, and walks the reader through setting up a Python virtual environment with PyTorch. By the end, readers have a verified development environment and understand the journey ahead — from tensors and tokenization to training a working language model.
Cracking the Tech Interview: System Design and Algorithms in Java 25
A structured approach to system design interviews: requirements gathering, capacity estimation, high-level design, deep dives, and bottleneck analysis.
Adaptive Distributed Systems: Intent-Based Dynamic Consistency in Java 21
Intents provide flexibility and abstraction by specifying desired outcomes, allowing systems to determine optimal execution paths.
Architecting Resilient Distributed Systems: High-Scale Engineering and Failure Mode Mitigation
Distributed systems face trade-offs between consistency, availability, and latency, with protocols like Paxos and Raft ensuring consensus and Byzantine Fault Tolerance handling malicious data.
Data Systems Mechanics: Invariants in Distributed Architectures
This section establishes the fundamental constraints of disk-based storage, focusing on the trade-offs between read and write amplification. It introduces two core data structures: mutable B-Trees, which perform in-place updates and offer low read amplification but can have high write amplification for random writes; and immutable LSM-Trees (Log-Structured Merge-Trees), which perform out-of-place updates, batching writes in memory and flushing them as sorted string tables (SSTables). LSM-Trees optimize for write throughput by converting random writes to sequential disk writes, but incur higher read amplification due to multi-level lookups and write amplification during compaction. The section defines three key amplification metrics: read amplification (I/O ops per logical read), write amplification (physical writes per logical write), and storage amplification (physical storage per logical data). It presents comparative tables and code examples illustrating a B-Tree node structure and LSM-Tree operations (flush and compaction). The core narrative is that the choice between B-Trees and LSM-Trees represents a fundamental trade-off: B-Trees favor read-heavy workloads, while LSM-Trees favor write-heavy workloads, with amplification factors as critical design considerations.
Echoes of the Shattered Pantheons: Mercenary Bonds and Arcane Rot
In Oakhaven, a merc group called 'The Convergence' forms around the 'Shattered Aegis' contract to contain the Arcane Rot's source.
Imperial Morocco: Political Transitions from Medieval Dynasties to the French Protectorate
The Almoravid and Almohad dynasties marked significant turning points in Moroccan history, achieving consolidation and hegemony through distinct tribal origins and economic bases.
Java Interview Engineering: First Principles to System Design
This chapter establishes Java 21+ features as critical tools for technical interviews, focusing on Records, sealed classes, pattern matching, and virtual threads. Records provide immutable data carriers that reduce boilerplate by up to 90% compared to POJOs, with examples like the Person record. Sealed classes enable type-safe hierarchies, combined with pattern matching in switch expressions for exhaustive handling, demonstrated via the Shape interface with Circle and Rectangle records. Virtual threads offer high-throughput concurrency for I/O-bound tasks, using a JVM-scheduled model that supports millions of concurrent tasks with low memory overhead, shown through a virtual thread executor. Complexity analysis is framed with Big-O notation, supported by a table of time complexities for arrays, linked lists, and hash tables, aiding data structure selection based on operation requirements. A structured interview problem-solving template integrates these elements: understand the problem, select data structures, design algorithms with complexity analysis, implement in Java 21+, and test edge cases. Trade-offs are explicitly stated: Records provide immutability and conciseness at the cost of mutable state flexibility, while virtual threads scale better for I/O-bound tasks but may require platform threads for CPU-bound scenarios. Failure modes such as unhandled null inputs and incorrect complexity analysis are highlighted, ensuring candidates address common pitfalls. Key terminology includes Java Record, Sealed Class, Pattern Matching, Virtual Thread, and Big-O Notation, all reinforced through runnable code examples and practical applications.
Modern Python Mastery: Technical Interview Patterns for Production Code
Python 3.12+ introduces advanced type system features: structural typing with typing.Protocol enables interface definition via duck typing without inheritance, contrasted with abstract base classes. Generic programming uses typing.Generic and TypeVar for type-safe container classes like Stack and Queue, with O(1) push/pop and O(n) space complexity. Structural pattern matching with match/case statements implements state machines using enum states, guard clauses, and multi-pattern matching for efficient O(1) transitions. Data modeling compares dataclasses (O(1) initialization, manual validation) and Pydantic models (O(k) validation for k validators, built-in serialization). Type narrowing refines types through isinstance or pattern matching. The __match_args__ attribute customizes pattern matching for custom classes. Debugging with typing.reveal_type ensures mypy strict mode compliance. Best practices include avoiding mutable defaults, using type hints, and preferring abstract types from collections.abc. Key anti-patterns and production gotchas are highlighted for robust code.
Pragmatic Clean Code: Minimizing Cognitive Load in Production Java
Software's primary cost is maintenance. Engineers spend most time reading code, establishing a 10:1 read-to-write ratio. Clarity reduces cognitive load and technical debt, improving signal-to-noise and lowering total cost of ownership. This makes clean, low-cognitive-load code economically essential.
Python Database Internals: Building a Persistent Engine from Scratch
This section introduces the high-level architecture of a database management system, organized as a layered structure: REPL for user interaction, Parser for SQL interpretation, Virtual Machine for bytecode execution, B-Tree for indexing, Pager for page-based storage management, and OS Interface for system abstraction. It emphasizes modularity and data flow between layers. The project skeleton is set up using Python 3.12+ with type hints, defining a Constants module with PAGE_SIZE=4096 bytes, HEADER_LIMIT=100, and PAGE_HEADER_FORMAT='<I I' for binary headers. A stub Pager class uses struct and memoryview for low-level binary manipulation. Key design trade-offs are discussed, comparing page sizes (4KB, 8KB, 2KB) in terms of I/O performance, memory usage, and overhead. This foundation enables further development with a focus on efficiency and scalability.
Reactive Microservices Architecture: Transactional Outbox and Event Sourcing with Java 21
Reactive systems leverage Java 21 for immutable data and resilient transactions
Spring Boot: The Mechanics of Magic
This section demystifies the Spring Boot startup process, moving from the `SpringApplication.run()` entry point to the complete initialization of the ApplicationContext. It introduces the core container interface (ApplicationContext) and details the synchronized refresh() cycle, which includes preparing the environment, loading bean definitions, invoking BeanFactoryPostProcessors and BeanPostProcessors, and finally instantiating all non-lazy singleton beans. A critical distinction is made between bean definitions (recipes) and bean instances (created objects). The role of proxies (JDK Dynamic and CGLIB) in managing bean scope is explained. The Environment abstraction is presented as a layered system for property resolution. The explanation is grounded in the LogisticsCore warehouse application baseline, a monolithic Java 21+ app, using examples like Warehouse records. The refresh cycle concludes with the publication of a ContextRefreshedEvent, signaling the container is operational.
The Negotiated Now: Engineering the Illusion of Time
This section establishes the fundamental challenge of timekeeping: the incommensurate nature of astronomical cycles. It contrasts the sidereal day (Earth's rotation relative to stars) with the solar day (rotation relative to Sun), using a metronome analogy to illustrate the annual accumulation of their difference. It details the tropical year and synodic month, demonstrating via a 'rubber bands on a shelf' analogy that no integer number of lunar months fits a solar year. The narrative traces the consequences through history: the Julian calendar's approximation (365.25 days/year) led to an accumulated error of ~10 days by 1582, corrected by Pope Gregory XIII's deletion of those days. The Gregorian reform introduced a more precise leap year rule, but still yields an error of ~1 day per 3,300 years. The core argument concludes that 'natural time' is a myth; calendars are pragmatic, approximate constructs born from a continuous negotiation with a chaotic universe.
Vertical Stratum: The Architecture of Forgotten Truths
Protagonist navigates sub-duct maintenance tier, uncovering anomalies in air filtration systems, amidst rigid caste system.