Skip to main content

AI Books

AI-generated mini-series and books on various topics, built with writing-agent.

Event Sourcing and CQRS in Practice
Principal-Engineer-Who-Rebuilt-Billing-With-Event-Sourcing

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,...

17 chapter s 3h 20m read
Event Sourcing CQRS Java
Fast by Design
Principal-Performance-Engineer

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...

30 chapter s 15h 5m read
Performance Java JVM
Resilience Patterns in Production
Principal-Engineer-War-Room-Veteran

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...

19 chapter s 3h 6m read
Analytical Practical Performance
Spring Internals
Principal-Spring-Engineer

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...

26 chapter s 8h 57m read
Spring Java Spring Boot
Unbound: MongoDB at Scale
Principal-MongoDB-Performance-Engineer

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...

24 chapter s 4h 6m read
Performance MongoDB Database
Search at Depth
Principal-Search-Engineer

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...

20 chapter s 4h 18m read
Search OpenSearch Relevance
Ship it and Sleep
Battle-Scarred-Platform-Engineer

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...

22 chapter s 4h 56m read
CI/CD Kubernetes GitOps
The Auth Layer
Senior-Security-Engineer-On-Java-Product-Team

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...

15 chapter s 3h 43m read
Authentication Authorization OAuth2
Data Systems from the Ground Up
Mechanical-Principal-Engineer

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,...

12 chapter s 3h 1m read
Storage Databases Distributed Systems
Surviving the Spike
War-Room-Principal-Engineer

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...

22 chapter s 8h 42m read
Performance Scalability Infrastructure
The Lies Your ORM Tells You
Scarred-Production-Engineer

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...

10 chapter s 2h 12m read
Analytical Practical Performance
AWS in the Trenches: Advanced Cloud Engineering for Senior Developers
Battle-Tested-Practitioner

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...

7 chapter s 1h 56m read
Analytical Practical Comparative
Digital Payment Systems: Cryptography, Banking Protocols, and Blockchain Internals
Systems-Engineering

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...

7 chapter s 3h 1m read
Analytical Definitional Comparative
Kotlin in Depth: Advanced Patterns for Java Engineers
Pragmatic-Technical

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,...

7 chapter s 2h 49m read
Analytical Definitional Comparative
Mastering CKAD: Certified Kubernetes Application Developer
Practical-Instructional

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.

29 chapter s 9h 44m read
Analytical Definitional Practical
Pragmatic Data Science with Python
Pragmatic-Practitioner

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.

11 chapter s 5h 25m read
Analytical Definitional Argumentative
The Invisible Layer: How Abstraction is Making Software Engineers Dumber
Provocative-Analytical

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.

20 chapter s 9h 11m read
Analytical Argumentative Narrative
Building Large Language Models from Scratch: A Beginner's Guide with Python and PyTorch
Conversational-Technical

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.

11 chapter s 5h 34m read
Analytical Definitional Narrative
Cracking the Tech Interview: System Design and Algorithms in Java 25
Mentor-Practitioner

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.

13 chapter s 12h 31m read
Technical Analytical
Adaptive Distributed Systems: Intent-Based Dynamic Consistency in Java 21
Rigorous-Prescriptive

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.

8 chapter s 1h 5m read
Argumentative Analytical
Architecting Resilient Distributed Systems: High-Scale Engineering and Failure Mode Mitigation
Technical: Rigorous-Prescriptive

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.

5 chapter s 32 min read
Analytical Definitional
Data Systems Mechanics: Invariants in Distributed Architectures
Rigorous-Prescriptive

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.

7 chapter s 2h 48m read
Analytical
Echoes of the Shattered Pantheons: Mercenary Bonds and Arcane Rot
Narrative-Visceral

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.

5 chapter s 30 min read
Narrative Analytical
Imperial Morocco: Political Transitions from Medieval Dynasties to the French Protectorate
Analytical-Narrative

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.

4 chapter s 22 min read
Analytical Narrative
Java Interview Engineering: First Principles to System Design
Rigorous-Prescriptive

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.

8 chapter s 4h 8m read
Argumentative Definitional Analytical
Modern Python Mastery: Technical Interview Patterns for Production Code
Rigorous-Prescriptive with Pragmatic Edge

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.

7 chapter s 4h 29m read
Analytical Argumentative Definitional
Pragmatic Clean Code: Minimizing Cognitive Load in Production Java
Pragmatic-Authoritative

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.

7 chapter s 1h 10m read
Argumentative Definitional Analytical
Python Database Internals: Building a Persistent Engine from Scratch
Rigorous-Prescriptive

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.

7 chapter s 1h 44m read
Analytical Definitional Argumentative
Reactive Microservices Architecture: Transactional Outbox and Event Sourcing with Java 21
Technical: Rigorous-Prescriptive

Reactive Microservices Architecture: Transactional Outbox and Event Sourcing with Java 21

Reactive systems leverage Java 21 for immutable data and resilient transactions

5 chapter s 26 min read
Analytical Argumentative Definitional
Spring Boot: The Mechanics of Magic
Rigorous-Prescriptive

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.

6 chapter s 2h 20m read
Analytical Narrative Definitional
The Negotiated Now: Engineering the Illusion of Time
Philosophical-Technical

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.

5 chapter s 1h 10m read
Narrative Analytical Definitional
Vertical Stratum: The Architecture of Forgotten Truths
Atmospheric-Introspective

Vertical Stratum: The Architecture of Forgotten Truths

Protagonist navigates sub-duct maintenance tier, uncovering anomalies in air filtration systems, amidst rigid caste system.

7 chapter s 1h 0m read
Narrative Analytical