ReactJS
What you'll know after reading: how React's declarative model replaces imperative DOM manipulation; which hook to use for a task; how to prevent unnecessary re-renders; how concurrent features keep th...
etcd & Raft
This document explains how etcd uses the Raft consensus algorithm to achieve linearizable writes across a cluster. After reading, you should understand the full write path, leader election mechanics,...
Introduction
4 years experience in Fintech, distributed system, workflow automation Led a Rewrite Order Service from .NET to Go, establishing domain boundaries, reduced memory footprint and response latency. Est...
Psycho
Specifies the architecture, module boundaries, data flow, and implementation phases for a local-first psychometric analysis system. After reading, the implementing Go developer will understand the sys...
RAG
Documents flow through a RAG pipeline in eight stages. Six are implemented (ingest, chunk, embed, retrieve, generate, evaluate); test coverage is minimal (unit tests only); monitor is scaffolded but b...
SaaS Template
\[One sentence. What are we building?] \[What we're NOT doing] QPS: \\\\\\ Storage: \_\_\_\_\_\_ / year Latency target: \\\\\\ \[Rules that limit complexity. Prevents over-engineering.]
Syncthing
User Interface Add trusted devices, choose folders to sync, and monitor sync status. Configuration Store the source of truth for who to trust (Device IDs), what to sync (folders), and how to behave (s...
Fundamentals
Core computer science and backend engineering concepts every software engineer should know. - API Design Guidelines — Data integrity, performance, reliability, HTTP semantics, security, versioning, an...
API Design Guidelines
This document defines mandatory API design conventions for all internal services. Every endpoint must conform to these rules unless an exemption is approved. Intended for backend engineers building or...
Computing
Purpose: For software engineers who need a mental model of how CPU, memory, and addressing work — from physical hardware through OS abstractions to the bit level. To interact with RAM, the CPU uses a...
Kafka
You have 50 microservices. Orders need to reach inventory, billing, shipping, and analytics. With point-to-point HTTP, each service needs its own connection to every other service — 200 connections. W...
Networking
For software engineers who want to understand what happens between keystroke and response. Assumes basic programming knowledge but no prior networking experience. Every web request is a journey throug...
Oauth2 & Oidc
For backend engineers implementing OAuth 2.0 and OpenID Connect in server-side web applications. Covers the authorization code flow with PKCE. Assumes familiarity with OAuth roles (client, authorizati...
Software Architecture
Architecture Characteristics: Often referred to as the "-ilities," these are the non-domain design considerations the system must support (e.g., scalability, security). Architecture Decisions: These...
Cache Stampede: Flash Sale Use Case
Also known as: thundering herd problem, dog-piling, cache miss storm. This document explains how to prevent a cache stampede when a hot key expires under high concurrency. After reading, you should un...
Distributed Task Scheduler for Batch Job Processing
A scalable, durable, exactly-once task scheduler that decouples timing from execution for billions of heterogeneous background jobs. Built as a shared, multi-tenant service with operational maturity f...
Event Processing for Order Notifications
Reliably process order status change events (paid, cancelled, refunded) to update the order status and deliver notification emails. The system must decouple the critical order-status write (sub-millis...
System Design
Building and architecting distributed systems at scale. Every concept here is a response to a real failure in production — someone built a system, it broke under load, and the pattern emerged. Handlin...
RabbitMQ
This document describes the core building blocks of our RabbitMQ / AMQP 0-9-1 client library. The implementation offers robust message delivery with automatic recovery, publisher confirms, and efficie...
Golang
No description available.
Goroutine
A goroutine is a lightweight thread managed by the Go runtime. This guide covers how the scheduler works, how goroutines communicate through channels, how to coordinate them with select and sync primi...
Strings
A string in Go is an immutable sequence of bytes, typically used for text. This guide covers how to build strings efficiently, how to slice and search them, and how to navigate Go's UTF-8 model. Using...
Math
Algebra: Solving for x, factoring polynomials, exponents, logarithms, and understanding functions (f(x)). Richard Rusczyk Geometry & Trigonometry: Shapes, spatial logic, the unit circle, and sine/co...
Calculus
Its a way to find the Instantaneous Rate of Change, how fast something is moving at one exact moment, rather than an average over time. Also to do Optimization: find the "peak" or "valley" (the best o...
Linear Algebra
1D Vector: A single value (a scalar). 2D Vector: A coordinate pair [x, y] used to position a pixel on a screen. Ax = b Left Hand Side The Left Hand Side (\mathbf{A}\mathbf{x}) represents the transform...
Sequence, Series, Limit
Sequence Arithmetic math is based on addition. If you graph it, it always forms a perfectly straight line. an = a1 + (n - 1)d Variable Breakdown: * a_n (The Target): The value of the number at positio...
Summary
Trigonometry concepts revolve around: degrees the ability to get what we want to find (x length or y height) in the triangles given values in the triangle whether we want to find what side (sin, co...
Trigonometry
Opposite = height Hypotenuse = diagonal Adjacent = flat line (\theta) = angle degrees \sin(\theta) = \frac{\text{Opposite}}{\text{Hypotenuse}} * What it finds: The Height (Vertical).
Precalculus
Fundamental Real number there is no real number that, when multiplied by itself, results in a negative number. The expression \sqrt{-9} asks the question: What real number, when multiplied by itself...
Summary
These are the universal lenses used to analyze any graph. While every function is checked for these, the results (like "End Behavior") look different depending on the family. * Transformations: Horizo...
Ai Infra
This document captures operational knowledge for deploying large language models (LLMs) on serverless GPU infrastructure — specifically Google's Gemma 4 31B on a single NVIDIA H200 GPU. The system has...
Embeddings & Vector Representations
Before reading: you should understand tensors, the Transformer architecture, and self-supervised learning — all covered in Machine Learning. You search for "fast Python web framework" and get the Flas...
Model Evaluation & Benchmarks
Before reading: you should understand loss functions, train/val/test splits, and basic ML training — all covered in Machine Learning. "Why does my model look great in the playground but fail in produc...
Fine-Tuning Large Language Models
Before reading: understand the training pipeline, transfer learning, VRAM constraints, quantization, and QLoRA — all covered in Machine Learning. You've been prompting GPT-4 to classify customer suppo...
Inference Engines
Why this matters: The inference engine you pick determines your throughput, latency, hardware compatibility, and operational complexity. vLLM is the default for a reason — but it's not always the best...
Machine Learning
Before reading: you should be comfortable with Python (code blocks assume basic literacy), partial derivatives and the chain rule, and basic linear algebra (vectors, matrices, tensors). If any of thes...
Quantization
Why this matters: A 70B-parameter model at FP16 precision needs ~140 GiB of GPU memory — more than any single consumer GPU. Quantize it to 4-bit, and it fits on an RTX 4090 (24 GiB). Quantization is t...
Tool Use & AI Agents
Before reading: you should understand Transformers, prompting, and the LLM era — all covered in Machine Learning. Fine-tuning and RAG are helpful context but not required.
Database
Comprehensive reference on database internals: taxonomy, indexing, storage engines, core algorithms, transaction concurrency, scaling, and deep dives into distributed databases. - taxonomy.md — Databa...
Database Algorithms
MVCC allows concurrent readers and writers without blocking by maintaining multiple versions of each row: Each row has hidden metadata: - xmin: Transaction ID that created this version. - xmax: Transa...
Database Concurrency & Scaling
ACID stands for Atomicity (all-or-nothing execution), Consistency (data always follows rules/constraints), Isolation (concurrent transactions don't interfere with each other), Durability (saved data s...
Indexing
Cardinality refers to the number of unique values in a column relative to the total row count. It is the primary metric the query optimizer uses to decide whether to use an index. - High Cardinality (...
Query Execution & Optimization
Every SQL query passes through these stages: 1. Parser: Converts SQL text to an AST (parse tree). Validates syntax, resolves table/column names, checks permissions. 2. Rewriter: Applies semantic trans...
Specialized Databases
Vector databases are optimized for storing and querying embeddings — dense vector representations of data (text, images, audio). They enable approximate nearest neighbor (ANN) search for AI/ML applica...
DB Storage Engines
The three fundamental storage engine data structures: | Property | B-Tree (PostgreSQL, SQL Server, Oracle) | LSM-Tree (Cassandra, RocksDB, LevelDB) | Heap (PostgreSQL)...
Database Taxonomy
Model: Tables with rows and columns, strict schema, relationships via foreign keys. Data is normalized to reduce redundancy. Query Language: SQL (Structured Query Language) — SELECT, JOIN, GROUP BY, t...
Cassandra — Architecture
For the underlying mechanics of LSM-Trees, Merkle Trees, and Bloom Filters, see Storage Engines and Database Algorithms. Cassandra is the AP wide-column store for write-heavy workloads at planetary sc...
MongoDB — Architecture
For the underlying mechanics of B-Trees, WAL, and related algorithms, see Storage Engines and Database Algorithms. MongoDB is the document database for flexible schemas and horizontal scale — built fo...
MySQL (InnoDB) — Architecture
For the underlying mechanics of B-Trees, WAL, MVCC, and related algorithms, see Storage Engines and Database Algorithms. MySQL with InnoDB is the read-heavy OLTP workhorse — built for simplicity and p...
PostgreSQL — Architecture
For the underlying mechanics of B-Trees, heap storage, WAL, MVCC, and related algorithms, see Storage Engines and Database Algorithms. PostgreSQL is the extensible, standards-compliant relational data...
Redis — Architecture
For the underlying mechanics of B-Trees, LSM-Trees, and WAL, see Storage Engines and Database Algorithms. Redis is the in-memory data structure store — built for operations that need single-digit-mill...
Google Spanner — Architecture
For the underlying mechanics of database algorithms, see Storage Engines and Database Algorithms. Google Spanner is the globally distributed SQL database with external consistency — built for applicat...
SQL Server — Architecture
For the underlying mechanics of B-Trees, heap storage, WAL, and related algorithms, see Storage Engines and Database Algorithms. SQL Server is the enterprise RDBMS from Microsoft — built for organizat...
SQLite — Architecture
For the underlying mechanics of B-Trees, WAL, and related algorithms, see Storage Engines and Database Algorithms. SQLite is the zero-configuration embedded database — no server process, no setup, no...
Economist
Study notes on economics — microeconomics, macroeconomics, global finance, and behavioral economics. Plus a live data dashboard for exchange rates, Fed rates, and reserves. | Area | Topic | Files | |-...
Behavioral Economics
Challenges the rational-agent assumption in standard economics. People aren't Econs (rational, patient, consistent) — they're Humans (emotional, impatient, easily influenced). Pick A or B: - A: Guaran...
Capital Flows & Currency Crises
When the Fed prints money (QE), those dollars flow to emerging markets chasing higher returns. US Treasuries pay ~4–5%, EM bonds pay ~8%+. This is called hot money — portfolio investments (stocks, bon...
Climate Finance & Carbon Markets
The government sets a total cap on emissions and issues permits. Companies must hold one permit per ton of CO₂ emitted. Clean companies sell excess permits to dirty ones. The market discovers the pric...
Digital Currencies & De-Dollarization
Three distinct developments that get lumped together. Not crypto. A central bank digital currency (CBDC) — digital yuan issued by the People's Bank of China. | Property | Detail | |----------|--------...
The Dollar System
This is the physical foundation of the system. For decades, the "Petro-dollar" system has meant that if you want to buy oil, you need U.S. Dollars. This keeps the dollar in high demand globally. Oil p...
Geopolitics of Energy
Energy is the original global supply chain — every country needs it, few have it, and it's priced in dollars. Russia cut gas to Europe after invading Ukraine (2022). Europe had no replacements overnig...
Exchange Rates
- Floating (flexible): the market determines the exchange rate. The central bank does not intervene. Examples: US dollar, euro, yen. - Fixed (pegged): the central bank commits to buy or sell its curre...
Export Controls
Export controls physically block what you can buy or sell — unlike tariffs (which raise the price) and sanctions (which freeze financial assets). The US, Netherlands, and Japan formed a coalition to r...
Financial Crises
Banks transform short-term deposits into long-term loans — maturity transformation. Simplified balance sheet (10% reserve ratio): | Assets | Liabilities | |---|---| | Reserves: \10 | Deposits: \100 |
Shadow Banking
Shadow banking refers to credit intermediation that takes place outside the traditional banking system, without deposit insurance, without access to central bank lending facilities, and with less regu...
Sovereign Debt & IMF Bailouts
Countries issue sovereign bonds — IOUs that pay interest. The US borrows in dollars (it can always print more). Developing countries typically borrow in dollars because their own currency isn't truste...
Supply Chain Advantages
* Scale of Inputs: China is the world's largest importer of raw materials (iron ore, copper, soybeans). By buying in staggering volumes, it secures lower per-unit prices from suppliers like Australia...
Trade & Tariffs
Countries trade because it's cheaper to buy than to make. Even if the US could make everything China makes, it would still benefit from specializing in what it does relatively best (aircraft, chips, s...
Aggregate Demand & Supply
The IS-LM model shows how the goods market and money market jointly determine the interest rate and output in the short run, holding the price level fixed. The IS curve represents equilibrium in the g...
GDP & Cost of Living
Gross Domestic Product (GDP) is the market value of all final goods and services produced within a country in a given period. It can be calculated three ways: - Expenditure approach: GDP = C + I + G +...
Growth & Finance
Chapter 25 focuses on the long-run determinants of a nation's standard of living, centered on the concept of productivity—the amount of goods and services produced by each unit of labor input. Mankiw...
Monetary System & Inflation
Money serves three functions: a medium of exchange, a unit of account, and a store of value. It is distinguished as commodity money (intrinsic value, like gold) or fiat money (established by governmen...
Open Economy
An open economy trades goods, services, and assets across borders. Two key flows define its external position: - Net exports (NX) : exports minus imports — the trade balance - Net capital outflow (NCO...
Inflation & Unemployment
The Phillips curve describes the relationship between inflation and unemployment. In its modern form: \pi = \pi^e - \beta(u - u^n) + v - π: actual inflation - πe: expected inflation
Solow Growth Model
The economy's total output depends on its stock of capital, labor, human capital, natural resources, and the efficiency with which they are combined: Y = A \cdot F(K, L, H, N) - K: physical capital (m...
Unemployment
The unemployment rate (U3) is the official headline measure: the percentage of the labor force that is actively seeking work but unable to find a job. \text{Unemployment Rate (U3)} = \frac{\text{Unemp...
Externalities & Public Goods
An externality arises when a market outcome affects parties other than the buyers and sellers in that market. Negative Externalities: Pollution Positive Externalities: Education Whats the solution f...
Frontiers of Microeconomics
This occurs when one person in a transaction knows more than the other. This leads to two big problems: * Moral Hazard: When a person who is being watched (the "agent") performs a task for someone els...
Game Theory
Two suspects are arrested and held separately. Each can either confess or remain silent. | | Prisoner B confesses | Prisoner B silent | |-|---------------------|------------------| | Prisoner A confes...
Labor Markets & Inequality
In a competitive labor market, a firm hires workers up to the point where the value of the marginal product equals the wage: VMPL = MPL \times P = W The demand for labor is the VMPL curve — it slopes...
Market Intervention
When policymakers believe the market price is "unfair" to buyers or sellers, they implement legal restrictions Price Ceiling is a legal maximum on the price at which a good can be sold. * Price Floo...
Market Structures
A perfectly competitive market has three specific characteristics that distinguish it from other market structures: 1. Many Buyers and Many Sellers: There are so many participants that no single buyer...
Costs of Production
Total Revenue (TR): The amount a firm receives for the sale of its output TR = \text{Price} \times \text{Quantity} Total Cost (TC): The market value of the inputs a firm uses in production. * Profit...
Supply & Demand
The law of demand states that, holding all else equal, the quantity demanded of a good falls when its price rises. This inverse relationship produces a downward-sloping demand curve. Qd = f(P) \quad \...
Welfare & Efficiency
Consumer surplus is the difference between what a buyer is willing to pay and what they actually pay — the area below the demand curve and above the price. Producer surplus is the difference between t...