Postgres SQLAlchemy Textbook Ch. 10 — Replication, Failover, and pgvector
Streaming replication, read replica routing, failover handling in SQLAlchemy, and using pgvector for embeddings.
Streaming replication, read replica routing, failover handling in SQLAlchemy, and using pgvector for embeddings.
Cheatsheet: vector column, HNSW vs IVFFlat, cosine / L2 / inner-product distance, RAG hybrid filter.
Everything you need to make pgvector fast in production: HNSW vs IVFFlat, distance operators, m and ef_construction, ef_search at query time, partial indexes for multi-tenant data, and benchmarking your real workload.
A complete, end-to-end RAG backend built on PostgreSQL + pgvector and FastAPI. Real chunking, real embeddings, hybrid (vector + BM25) retrieval, prompt assembly, citations, and production gotchas.