All posts

PostgreSQL Basics #4 Index Fundamentals: When Indexes Get Used and When They Don't
4 min read

PostgreSQL Basics #4 Index Fundamentals: When Indexes Get Used and When They Don't

Indexes are a reliable way to make reads fast, and this chapter grounds them in PostgreSQL specifics. How a B-tree index changes lookups, the classic reasons an index you created is not being used (leading-column mismatch, functions applied to the column, type mismatch, low selectivity), the cost in write performance and storage, and the working order of "build from the WHERE, JOIN, and ORDER BY of actually slow queries."

Rust Basics #4 References and Borrowing: & and &mut, Solving Borrow-Rule Compile Errors
5 min read

Rust Basics #4 References and Borrowing: & and &mut, Solving Borrow-Rule Compile Errors

References (&) and mutable references (&mut) — using a value without moving ownership. What the borrow rule "any number of shared references, or exactly one mutable reference" actually prevents (mutation during iteration, data races), how to read and fix the cannot borrow as mutable error, how dangling references get blocked at compile time, and finally &str and slices.

SQLAlchemy 2.0 #3 Defining ORM Models: DeclarativeBase, Mapped, mapped_column
4 min read

SQLAlchemy 2.0 #3 Defining ORM Models: DeclarativeBase, Mapped, mapped_column

The 2.0-style way of declaring tables as Python classes: the DeclarativeBase inheritance structure, how Mapped type hints and mapped_column divide the work, the rules mapping Python types to database types, how Optional drives nullable, declaring defaults, unique constraints, and indexes, and the naming convention that gives constraints predictable names from day one.

PostgreSQL Basics #3 Joins and Aggregation: Working Instincts for Read Queries
4 min read

PostgreSQL Basics #3 Joins and Aggregation: Working Instincts for Read Queries

Joins and aggregation make up most of real-world read queries, and this chapter builds the instincts. Choosing between INNER and LEFT JOIN and the classic mistake of filtering LEFT JOIN results in WHERE (turning them back into INNER), the division of labor between GROUP BY and HAVING, the double-counting trap when joins meet aggregation, the fork between subqueries and joins, and the PostgreSQL-native way to get the latest row per group (DISTINCT ON).

Rust Basics #3 Ownership: Move by Default, and How Memory Is Freed Without a GC
5 min read

Rust Basics #3 Ownership: Move by Default, and How Memory Is Freed Without a GC

Head-on with the heart of Rust: ownership. The three rules that give every value exactly one owner, why a value moves on assignment or a function call and the original variable becomes unusable, the Copy privilege reserved for fixed-size stack types, clone as a copy whose cost is visible in the code, and drop at the end of scope — the structure that turns use-after-free into a compile error.

SQLAlchemy 2.0 #2 Engines and Transactions: Connection Pools and the Two Commit Patterns
5 min read

SQLAlchemy 2.0 #2 Engines and Transactions: Connection Pools and the Two Commit Patterns

The foundation of SQLAlchemy: engines and transactions. Why connection pools exist and how they behave, what pool_size and max_overflow actually limit, the commit-as-you-go and begin-once patterns split between connect() and begin(), why transactions never auto-commit, defining tables with MetaData and Table, and running CRUD with Core expressions.

PostgreSQL Basics #2 Data Types and Table Design: What to Store Things As
5 min read

PostgreSQL Basics #2 Data Types and Table Design: What to Store Things As

Half of PostgreSQL design is choosing data types. Why text alone is enough for strings, why numeric is mandatory for money, timestamptz as the standard for points in time and the timestamp trap, primary key strategy (bigint IDENTITY vs UUID, and uuidv7), enforcing data integrity at the database layer with NOT NULL, CHECK, and foreign keys, and where enums and arrays belong.

Rust Basics #2 Variables and Types: let and mut, Shadowing, Functions That End in Expressions
5 min read

Rust Basics #2 Variables and Types: let and mut, Shadowing, Functions That End in Expressions

Starting from what immutable-by-default let means and the explicit mut that opts out of it. Why shadowing — redeclaring the same name — is an everyday idiom, the scalar types (integers, floating point, bool, char) and overflow behavior, tuples and arrays, and the return rule where a single semicolon decides whether something is a statement or an expression.

SQLAlchemy 2.0 #1 The Big Picture: Core, ORM, and the 2.0 Style
5 min read

SQLAlchemy 2.0 #1 The Big Picture: Core, ORM, and the 2.0 Style

First post in a series covering SQLAlchemy, the de facto standard database library for Python, from the ground up: the two-layer structure of Core and ORM, why 1.x-era code and 2.0-style code look different, the unified select()-centric query style and type hint support, installation and the first connection, and running raw SQL with text().

PostgreSQL Basics #1 What PostgreSQL Is: Why It Became the Default, Installation and First psql Session
4 min read

PostgreSQL Basics #1 What PostgreSQL Is: Why It Became the Default, Installation and First psql Session

Starting from why PostgreSQL became the default database for new projects: standards compliance, a rich set of data types, the extension ecosystem (pgvector, PostGIS), and a permissive license. Then the fastest local setup with Docker, connecting with psql and the essential meta-commands (\l, \dt, \d), a first cycle of creating a table, inserting, and querying, and a map of the whole course.

Python Packaging #7 Team Conventions and Tool Choice: uv, poetry, pip
5 min read

Python Packaging #7 Team Conventions and Tool Choice: uv, poetry, pip

The series finale: tool choice and team conventions. uv, poetry, and pip+venv on one table with criteria that decide between them, the real cost of migration, caching and frozen verification in CI, the standard pattern for uv in Docker images, and a team convention checklist that survives new teammates — closing with a look back at the whole series.

Rust Basics #1 What Rust Is: Why Learn It, Installing rustup, First Steps with cargo
5 min read

Rust Basics #1 What Rust Is: Why Learn It, Installing rustup, First Steps with cargo

Starting from what "memory safety without GC" actually means — the reason Rust has spread so quickly from kernels to CLI tools. The difference from languages where safety and performance were a trade-off, the one-line rustup install, the basic cycle of creating and running a project with cargo, how to read your first compile error message, and a map of the whole course.