Chapter 18: Further Reading

Annotated Bibliography

1. "Designing Data-Intensive Applications" by Martin Kleppmann (O'Reilly, 2017)

The definitive guide to understanding how modern databases and data systems work under the hood. Covers storage engines, replication, partitioning, transactions, and distributed systems. While not a hands-on coding book, it provides the conceptual foundation that helps you make informed decisions about database selection and architecture. Essential reading for anyone building systems that handle significant data volumes.

2. SQLAlchemy Official Documentation -- ORM Tutorial (2.0 Style)

https://docs.sqlalchemy.org/en/20/tutorial/ The official SQLAlchemy 2.0 tutorial is comprehensive and well-written. It walks through engine creation, session management, model definition, relationships, and querying using the modern select() API. Always refer to the official docs rather than older blog posts, as the 1.x-to-2.0 transition changed many patterns. Bookmark the "ORM Mapped Class Configuration" section for reference when defining models.

3. Alembic Official Documentation

https://alembic.sqlalchemy.org/en/latest/tutorial.html The Alembic tutorial covers setup, autogeneration, running migrations, and branch management. Pay special attention to the "Auto Generating Migrations" section for understanding what Alembic can and cannot detect automatically. The "Cookbook" section contains solutions for common migration scenarios like data migrations, multi-database setups, and batch migrations for SQLite.

4. "SQL Performance Explained" by Markus Winand (self-published, 2012)

A focused, practical guide to SQL indexing and query optimization. The companion website https://use-the-index-luke.com/ provides free access to most of the content. Covers B-tree indexes, composite indexes, partial indexes, and how to read execution plans. The examples use multiple database engines (PostgreSQL, MySQL, Oracle, SQL Server) and highlight cross-engine differences. This is the resource to consult when your queries are slow.

5. PostgreSQL Official Documentation -- Chapter on Indexes

https://www.postgresql.org/docs/current/indexes.html PostgreSQL's documentation on index types (B-tree, Hash, GiST, GIN), multicolumn indexes, partial indexes, and expression indexes. While dense, it is authoritative and accurate. The section on "Examining Index Usage" teaches you how to verify whether the database is actually using your indexes.

6. Pydantic Official Documentation (v2)

https://docs.pydantic.dev/latest/ Pydantic v2 is a major rewrite with significantly better performance and cleaner syntax. The docs cover model definition, field validators, custom types, and settings management. The "Concepts" section explains validation behavior in depth. Essential reference for building the validation layer of your data architecture.

7. "Architecture Patterns with Python" by Harry Percival and Bob Gregory (O'Reilly, 2020)

This book covers the repository pattern, unit of work, and other architectural patterns for building maintainable Python applications with database access. It uses SQLAlchemy extensively and demonstrates how to separate domain logic from infrastructure concerns. Chapter 2 (Repository Pattern) and Chapter 6 (Unit of Work) are directly relevant to the data layer patterns covered in this chapter. Available free online at https://www.cosmicpython.com/.

8. "Database Design for Mere Mortals" by Michael J. Hernandez (Addison-Wesley, 4th edition, 2020)

A thorough introduction to relational database design for people without a computer science background. Covers entity identification, relationship mapping, normalization, and integrity rules in a systematic, step-by-step manner. The methodology for gathering requirements and translating them into a database design is particularly valuable for vibe coders who need to describe their domain to AI assistants.

9. Real Python -- SQLAlchemy Tutorial Series

https://realpython.com/python-sqlite-sqlalchemy/ A practical, code-heavy tutorial that walks through SQLAlchemy with clear examples. Covers both Core and ORM usage, session management, relationships, and integration with Flask and FastAPI. Good as a supplement to the official documentation, with more narrative explanation and complete working examples.

10. "Seven Databases in Seven Weeks" by Luc Perkins, Eric Redmond, and Jim R. Wilson (Pragmatic Bookshelf, 2nd edition, 2018)

A survey of different database paradigms: relational (PostgreSQL), document (MongoDB, CouchDB), columnar (HBase), key-value (Redis, Riak), and graph (Neo4j). Each database gets a week of hands-on exploration. This book helps you understand when to use each type and builds intuition for the trade-offs covered in Section 18.8.

11. TestDriven.io -- FastAPI with SQLAlchemy

https://testdriven.io/blog/fastapi-sqlalchemy/ A practical tutorial on integrating FastAPI with SQLAlchemy, including dependency injection for sessions, async support, and testing with pytest. Directly applicable to connecting the data layer from this chapter to the API layer from Chapter 17. Covers both synchronous and asynchronous patterns.

12. "The Art of PostgreSQL" by Dimitri Fontaine (self-published, 2nd edition, 2022)

A deep dive into PostgreSQL-specific features: window functions, CTEs, JSON support, full-text search, and advanced indexing. Goes well beyond standard SQL into PostgreSQL's powerful extensions. Particularly valuable once you move past basic CRUD and need to write complex analytical queries or leverage PostgreSQL-specific optimizations.

13. MongoDB University -- Free Online Courses

https://learn.mongodb.com/ MongoDB's official learning platform offers free courses on document modeling, aggregation pipelines, indexing, and schema design patterns. If you decide MongoDB is the right fit for your project (see Section 18.8), these courses provide structured, hands-on training. The "Data Modeling" course specifically covers how to think about document relationships differently from relational tables.

14. Redis University -- Free Online Courses

https://university.redis.io/ Redis's official training covers data structures (strings, hashes, lists, sets, sorted sets), persistence, pub/sub, and Lua scripting. The "Redis for Python Developers" course uses the redis-py library and covers practical caching patterns. Useful if you need to implement the caching and rate-limiting patterns discussed in Section 18.8.