Appendix D

Glossary

Coding 3 terms — Big-O, structures, servers, databases, agents

Appendix D — Glossary

Look it up. Then go back to the reps.

This glossary is a fast reference, not a study guide. Each entry gets one to three sentences and a chapter pointer. If a term confuses you here, the chapter is where you actually learn it — the glossary is the index card; the chapter is the gym.

Two parts:

  1. Alphabetical — A–Z, technical terms only. Use it when you remember the word but not where it lives.
  2. By Chapter — terms grouped by the chapter that introduces them. Use it when you remember roughly when a concept showed up but not its name.

Part 1 — Alphabetical

ACID — The four guarantees a transactional database makes: Atomicity (a transaction happens all-or-nothing), Consistency (it leaves the data in a valid state), Isolation (concurrent transactions don’t corrupt each other), and Durability (committed data survives a crash). Postgres provides full ACID; SQLite does too; MongoDB provides ACID per-document and, since 4.0, across multi-document transactions. (Ch 12)

ADT (abstract data type) — A data structure defined by its behavior — the operations it supports and their costs — independent of how it’s implemented. “A stack is push/pop/peek in LIFO order” is the ADT; an array-backed vs linked-list-backed stack are two implementations of it. (Ch 4)

adjacency list — A graph representation storing, for each vertex, a list of the vertices it connects to. Space is O(V + E); efficient for sparse graphs and for “who are this node’s neighbors?” The usual default. (Ch 7)

adjacency matrix — A graph representation as a V×V grid where cell (i, j) marks whether an edge exists from vertex i to j. O(1) edge lookup but O(V²) space — wasteful for sparse graphs, fine for dense ones. (Ch 7)

amortized cost — The average cost per operation across a long sequence, even when individual operations occasionally spike. A dynamic array’s append is amortized O(1): most appends are O(1), the rare resize is O(n), but spread across all appends the average stays constant. (Ch 2)

API (application programming interface) — The defined set of operations one piece of software exposes for another to call. In this course, usually a web API: a set of HTTP endpoints with documented inputs and outputs. The contract, not the implementation. (Ch 10)

ASGI (Asynchronous Server Gateway Interface) — The Python standard interface between an async web framework (like FastAPI) and the server that runs it. The async successor to WSGI; it’s why FastAPI can handle many concurrent requests on an event loop. (Ch 10)

asymptotic complexity — How an algorithm’s cost grows as input size grows toward infinity, expressed with Big-O. It ignores constant factors and small inputs, which is its power and its trap — at real-world scale, constants and cache effects can make the “slower” asymptotic choice win. (Ch 1)

balanced tree — A tree kept shallow so its height stays O(log n), guaranteeing fast operations. Self-balancing variants (AVL, red-black) rotate on insert/delete to prevent the degenerate-to-a-list case that ruins an unbalanced BST. (Ch 6)

BFS (breadth-first search) — A graph traversal that explores all neighbors at the current distance before going deeper, using a queue. Finds the shortest path in an unweighted graph. (Ch 7)

Big-O — Notation for an upper bound on how cost grows with input size: O(1) constant, O(log n) logarithmic, O(n) linear, O(n log n), O(n²) quadratic, and so on. The vocabulary for comparing algorithms’ scaling. (Ch 1)

binary search tree (BST) — A tree where every node’s left subtree holds smaller keys and right subtree holds larger keys, giving O(log n) search/insert/delete when balanced — and O(n) when it degenerates into a list. (Ch 6)

BSON — Binary JSON, MongoDB’s on-disk and on-the-wire document format. A binary-encoded superset of JSON that adds types JSON lacks (dates, 64-bit ints, binary blobs, ObjectId). (Ch 13)

cache locality — The performance benefit you get when the data you access next is physically near the data you just accessed, because the CPU loads memory in chunks (cache lines). Contiguous structures (arrays) have great locality; pointer-chasing structures (linked lists) often don’t — which is why an array can beat a linked list even when Big-O says otherwise. (Ch 3)

client — The program that initiates a request to a server. Your browser is a client; so is a Python script calling an API; so is psql connecting to Postgres. (Ch 9)

collection (MongoDB) — A group of documents in MongoDB, roughly the document-store analog of a SQL table — but with no enforced schema, so documents in one collection may have different shapes. (Ch 13)

collision — When a hash function maps two different keys to the same bucket. Unavoidable in general (more possible keys than buckets), so every hash table needs a collision-resolution strategy. (Ch 5)

concurrency — Structuring a program so multiple tasks are in progress at overlapping times — making progress by interleaving. It does not require multiple cores; a single core switching between tasks is concurrent. Contrast with parallelism. (Ch 8)

connection pool — A cache of open database connections that an application reuses instead of opening a fresh (expensive) connection per request. The standard way a server talks to Postgres efficiently under load. (Ch 12)

contiguous memory — Memory laid out as one unbroken block, so element i sits at a fixed offset from the start. The basis of arrays’ O(1) random access and excellent cache locality. (Ch 2)

CORS (Cross-Origin Resource Sharing) — The browser security mechanism that controls whether a web page from one origin (scheme+host+port) may call an API on a different origin. Your API must send the right CORS headers or the browser blocks the front end’s fetch. (Ch 14)

CRUD — The four basic persistence operations: Create, Read, Update, Delete. They map roughly onto SQL INSERT/SELECT/UPDATE/DELETE and onto HTTP POST/GET/PUT/DELETE. (Ch 11)

database — An organized, persistent store of data plus the engine that manages access to it. This course uses three kinds: relational (SQLite, PostgreSQL) and document (MongoDB). (Ch 11)

deadlock — A standstill where two or more threads each hold a lock the other needs, so none can proceed. Classically caused by acquiring multiple locks in inconsistent orders. (Ch 8)

denormalization — Deliberately duplicating data (or embedding it together) to avoid expensive joins and speed reads, at the cost of update complexity and potential inconsistency. The natural style of document stores; the deliberate exception in relational ones. (Ch 13)

deque — A double-ended queue: an ADT supporting O(1) insertion and removal at both ends. Python’s collections.deque is the standard implementation. (Ch 4)

DFS (depth-first search) — A graph traversal that goes as deep as possible along one path before backtracking, using a stack (or recursion). Used for cycle detection, topological sort, and exploring connectivity. (Ch 7)

Dijkstra’s algorithm — The classic algorithm for shortest paths from a source vertex in a graph with non-negative edge weights, using a priority queue to always expand the closest-known vertex next. (Ch 7)

document store — A database whose unit of storage is a self-describing document (JSON/BSON) rather than a row in a fixed-schema table. MongoDB is the example in this course; it favors nesting and flexible shapes over relational joins. (Ch 13)

DOM (Document Object Model) — The browser’s in-memory tree representation of an HTML page. JavaScript reads and mutates the DOM to change what the user sees without reloading. (Ch 14)

dynamic array — A resizable array that stores elements contiguously and grows by allocating a larger block and copying when it fills, giving O(1) indexing and amortized O(1) append. Python’s list is one; so are C++‘s std::vector and Java’s ArrayList. (Ch 2)

edge — A connection between two vertices in a graph. May be directed (one-way) or undirected, and may carry a weight (a cost/distance). (Ch 7)

embedding vs referencing — The core MongoDB modeling choice: embed related data inside a parent document (fast reads, data lives together) or reference it by id in another document (no duplication, but a second lookup). The document-store echo of the normalize/denormalize decision. (Ch 13)

endpoint — A single addressable operation of a web API: a path plus method, e.g. GET /users/42. An API is a set of endpoints. (Ch 10)

event loop — A single-threaded loop that runs ready tasks and, when one waits on I/O, sets it aside and runs another — achieving high concurrency without threads. Node.js is built on one; Python’s asyncio (under FastAPI/uvicorn) is too. (Ch 8, Ch 9)

FastAPI — A modern Python web framework for building APIs, built on Starlette (ASGI) and Pydantic. It gives you async request handling, automatic request validation, and auto-generated API docs from type hints. (Ch 10)

fetch — The browser’s built-in JavaScript function for making HTTP requests from a web page, returning a promise. The front end’s way of calling your API. (Ch 14)

foreign key — A column whose values must match a primary key in another table, enforcing a relationship (and referential integrity) between rows. The mechanism behind relational JOINs. (Ch 11)

GET — The HTTP method for reading a resource without changing it. Should be safe (no side effects) and idempotent. (Ch 9)

GIL (Global Interpreter Lock) — CPython’s lock that allows only one thread to execute Python bytecode at a time. The practical consequence: CPU-bound Python threads do not run in parallel (use processes for that), but I/O-bound threads do gain real concurrency, because a thread releases the GIL while waiting on I/O. (Ch 8)

graph — A data structure of vertices (nodes) connected by edges, modeling relationships and networks. Generalizes trees (a tree is a connected acyclic graph). (Ch 7)

hash flooding — A denial-of-service attack that deliberately feeds a hash table keys that all collide, degrading it to O(n) per operation and stalling the program. Defended against with randomized/keyed hashing. (Ch 5)

hash function — A function mapping a key to an integer bucket index, ideally spreading keys uniformly and computing fast. Quality of the hash function determines whether a hash table is O(1) or a disaster. (Ch 5)

hash table — A structure giving average O(1) insert/lookup/delete by using a hash function to compute where each key lives in a backing array, with a strategy for collisions. Python’s dict and set are hash tables (CPython uses open addressing). (Ch 5)

HTTP — The request/response protocol of the web. A client sends a request (method, path, headers, optional body); a server returns a response (status code, headers, optional body). Stateless by design. (Ch 9)

index (B-tree) — A database-side data structure (usually a B-tree) that lets the engine find rows by a column’s value without scanning the whole table — trading extra storage space and slower writes for much faster reads. An index speeds up the queries it covers and nothing else. (Ch 11, Ch 12)

JOIN — A SQL operation that combines rows from two or more tables on a related column (typically a foreign-key match), letting you query across the relationships a normalized schema spreads data into. (Ch 11)

JSON (JavaScript Object Notation) — A lightweight, human-readable text format of objects (key/value), arrays, strings, numbers, booleans, and null. The lingua franca of web APIs. (Ch 10)

linked list — A structure where each node holds a value and a pointer to the next node (the last points to nothing). O(1) insert/delete given the node, but O(n) lookup and poor cache locality from pointer-chasing. (Ch 3)

load factor — A hash table’s ratio of stored entries to buckets (n / capacity). As it rises, collisions and probe lengths grow; crossing a threshold (often ~0.7) triggers a rehash to keep operations near O(1). (Ch 5)

localhost — The hostname for “this same machine,” resolving to the loopback address 127.0.0.1. A server bound to localhost is reachable only from your own computer — exactly what you want during development. (Ch 9)

lock / mutex — A synchronization primitive that ensures only one thread enters a protected (critical) section at a time, preventing race conditions on shared data. “Mutex” = mutual exclusion. Holding locks carelessly invites deadlock. (Ch 8)

method (HTTP) — The verb of an HTTP request declaring intent: GET (read), POST (create), PUT (replace/update), DELETE (remove), among others. (Ch 9)

migration — A versioned, scripted change to a database’s schema (add a column, create a table, backfill data), kept in source control so every environment can reach the same schema state reproducibly. (Ch 12)

MongoDB — A document-store database that holds BSON documents in collections, with a flexible (schema-optional) model and horizontal-scaling features. The Phase 2 example of “when a relational table is the wrong shape.” (Ch 13)

MVP (minimum viable product) — The smallest version of a system that actually delivers value and can be shipped and tested. A recurring architect’s discipline: build the MVP first, then decide what’s worth adding. (Ch 14, Ch 15)

node (data structure) — A single element of a linked structure, holding a value plus one or more pointers/references to other nodes (the next in a list, left/right in a tree). (Ch 3)

Node.js — A runtime that executes JavaScript outside the browser, built on a single-threaded event loop with non-blocking I/O. The course’s first server runtime. (Ch 9)

open addressing / linear probing — A collision strategy that stores all entries directly in the bucket array: on collision, probe to the next slot (linear probing) until an empty one is found. CPython’s dict uses open addressing. Contrast with separate chaining. (Ch 5)

parallelism — Multiple tasks executing literally at the same instant on multiple CPU cores. Requires hardware parallelism; distinct from concurrency, which is about structure. In CPython, true CPU parallelism needs processes, not threads (see GIL). (Ch 8)

parameterized query — A SQL query where values are passed as separate parameters (placeholders) rather than concatenated into the query string, so the database treats them strictly as data. The correct, mandatory defense against SQL injection. (Ch 11)

port — A numbered endpoint (0–65535) on a machine that lets multiple network services share one IP address. Postgres listens on 5432, Mongo on 27017, a dev web server often on 3000 or 8000. (Ch 9)

PostgreSQL — A mature, full-featured client/server relational database with strong typing, full ACID transactions via MVCC, indexes, and rich SQL. The course’s “real relational engine that bears weight.” (Ch 12)

primary key — The column (or set of columns) that uniquely identifies each row in a table. Enforced unique and not-null; the target a foreign key points at. (Ch 11)

process — An independent program in execution with its own memory space. Processes don’t share memory by default (so no data races between them) but cost more to create and communicate. In CPython, the way to get true CPU parallelism. (Ch 8)

producer/consumer — A concurrency pattern where producer tasks put work onto a shared, thread-safe queue and consumer tasks take work off it, decoupling the two and smoothing bursty load. (Ch 8)

Pydantic — A Python library for data validation using type annotations; you declare a model as a typed class and it validates/parses/serializes incoming data. FastAPI uses it to validate request bodies and shape responses. (Ch 10)

queue — A FIFO (first-in, first-out) ADT: you add at the back and remove from the front. The structure behind BFS, producer/consumer buffers, and “wait your turn.” (Ch 4)

race condition — A bug where the result depends on the unpredictable timing/interleaving of concurrent threads accessing shared mutable state — e.g. two threads reading-then-writing the same counter and losing an update. Prevented with locks or by not sharing mutable state. (Ch 8)

rehash — Rebuilding a hash table into a larger backing array (and re-placing every entry) when the load factor gets too high. An O(n) operation that keeps average operations O(1); the source of a dynamic-array-style amortized cost. (Ch 5)

REST — An architectural style for web APIs built around resources addressed by URLs and manipulated with standard HTTP methods, typically exchanging JSON, and stateless between requests. A convention, not a strict protocol. (Ch 10)

reference — A handle to an object/value stored elsewhere rather than the value inline. In Python everything is a reference to an object; in the linked structures here, a node’s next is a reference to another node. (Compare the C++/Java notions you learned earlier.) (Ch 3)

request / response — The two halves of an HTTP exchange: the client’s request (method, path, headers, optional body) and the server’s response (status code, headers, optional body). (Ch 9)

ring / circular buffer — A fixed-size buffer treated as a loop: when the end is reached, writing wraps to the front, overwriting the oldest data. O(1) push/pop with no allocation; ideal for streaming and bounded queues. (Ch 4)

schema — The defined structure of a database’s data: the tables, columns, types, and constraints (relational), or the expected document shapes (document store). Relational schemas are enforced; MongoDB’s are optional/by-convention. (Ch 11)

separate chaining — A collision strategy where each bucket holds a list (chain) of all entries that hashed there; lookups scan the short chain. Simpler than open addressing but with extra pointers/allocations. (Ch 5)

server — A program that waits for and responds to client requests — a web server, a database server. In this course usually a process listening on a port for HTTP requests. (Ch 9)

SQL (Structured Query Language) — The declarative language for relational databases: you state what data you want (SELECT ... WHERE ...) and the engine decides how to get it. Used by SQLite and PostgreSQL. (Ch 11)

SQL injection — An attack where attacker-supplied input is concatenated into a SQL string and executed as code, letting it read or destroy data. Prevented entirely by using parameterized queries — never build SQL by string concatenation. (Ch 11)

SQLite — A serverless, single-file relational database: the engine is a library and the whole database is one file, with no separate server process. The right tool for embedded, single-writer, and many small-to-medium workloads; the easiest of the three to run. (Ch 11)

stack — A LIFO (last-in, first-out) ADT: push and pop at the same end. Behind function-call frames, DFS, undo, and expression evaluation. (Ch 4)

status code — The three-digit number in an HTTP response signaling outcome: 2xx success (200 OK, 201 Created), 3xx redirect, 4xx client error (400 Bad Request, 404 Not Found), 5xx server error (500). (Ch 9)

table / row / column — The relational data layout: a table is a named set of records; a row is one record; a column is one typed field shared by every row. (Ch 11)

thread — A unit of execution within a process that shares the process’s memory with sibling threads. Cheap to create and communicate (shared memory), but that sharing is exactly what invites race conditions. (Ch 8)

transaction — A group of database operations executed as a single all-or-nothing unit, committed together or rolled back together. The mechanism behind the A and I of ACID. (Ch 12)

traversal — Visiting every node of a tree in a defined order. In-order (left, node, right — yields a BST’s keys sorted), pre-order (node, left, right), post-order (left, right, node), and level-order (breadth-first, by depth, using a queue). (Ch 6)

tree — A hierarchical structure of nodes with one root and no cycles, each node having children. Models hierarchy (file systems, org charts, parse trees); a binary tree limits each node to two children. (Ch 6)

uvicorn — A fast ASGI server that runs Python async web apps; the standard way to serve a FastAPI application (uvicorn main:app). (Ch 10)

vertex — A node in a graph — an entity, with edges representing its relationships to other vertices. (Ch 7)

agentic AI — AI that doesn’t just answer but acts: it reads and edits files, runs commands and tests, and iterates across many steps toward a goal. Far more powerful and more dangerous than chat pairing; governed in Phase 2 by the human-in-the-loop rules. (Ch 9, Appendix C)

human-in-the-loop — The discipline that the human owns every decision requiring judgment — architecture, tool choice, data model, security and correctness calls — reads everything the agent produces, and verifies rather than trusts. The non-negotiable rule of Phase 2. (Ch 9, Appendix C)


Part 2 — By Chapter

Terms in roughly the order they’re introduced. Definitions live in Part 1.

Chapter 1 — The Architect’s Question

  • Big-O
  • asymptotic complexity

Chapter 2 — Arrays and the Memory You Can Feel

  • contiguous memory
  • dynamic array
  • amortized cost

Chapter 3 — Linked Lists and the Cost of Pointers

  • linked list
  • node (data structure)
  • reference
  • cache locality

Chapter 4 — Stacks, Queues, and Deques

  • ADT (abstract data type)
  • stack
  • queue
  • deque
  • ring / circular buffer

Chapter 5 — Hash Tables

  • hash table
  • hash function
  • collision
  • separate chaining
  • open addressing / linear probing
  • load factor
  • rehash
  • hash flooding

Chapter 6 — Trees

  • tree
  • binary search tree (BST)
  • balanced tree
  • traversal

Chapter 7 — Graphs

  • graph
  • vertex
  • edge
  • adjacency list
  • adjacency matrix
  • BFS (breadth-first search)
  • DFS (depth-first search)
  • Dijkstra’s algorithm

Chapter 8 — Concurrency, Threads, and Midterm Review

  • concurrency
  • parallelism
  • thread
  • process
  • race condition
  • lock / mutex
  • deadlock
  • GIL (Global Interpreter Lock)
  • event loop
  • producer/consumer

Chapter 9 — Your First Server (Node.js)

  • server
  • client
  • port
  • localhost
  • HTTP
  • request / response
  • method (HTTP)
  • GET
  • status code
  • Node.js
  • agentic AI
  • human-in-the-loop

Chapter 10 — APIs, JSON, and FastAPI

  • API (application programming interface)
  • endpoint
  • REST
  • JSON
  • FastAPI
  • Pydantic
  • ASGI
  • uvicorn

Chapter 11 — Persistence I (SQLite)

  • database
  • schema
  • table / row / column
  • primary key
  • foreign key
  • SQL
  • CRUD
  • JOIN
  • parameterized query
  • SQL injection
  • index (B-tree)
  • SQLite

Chapter 12 — Persistence II (PostgreSQL)

  • PostgreSQL
  • connection pool
  • migration
  • transaction
  • ACID

Chapter 13 — Persistence III (MongoDB)

  • MongoDB
  • document store
  • BSON
  • collection (MongoDB)
  • denormalization
  • embedding vs referencing

Chapter 14 — The Front End That’s Good Enough

  • DOM (Document Object Model)
  • fetch
  • CORS (Cross-Origin Resource Sharing)
  • MVP (minimum viable product)

Chapter 15 — Architecting the Whole System

  • MVP (revisited — right-sizing the build)

Chapter 16 — Final Review and Capstone

  • (no new terms — all prior material consolidated)

Coach’s Note — Don’t read this appendix straight through. Open it when a word slips your mind, find the entry, click the chapter pointer, and re-read the section that introduces the term in context. And notice the shape of it: Part 1 (Chapters 1–8) is almost entirely cost — structures and their tradeoffs. Part 2 (Chapters 9–16) is almost entirely systems — servers, data, the wire. That’s the whole book in one glossary.