← Cursos
🎓
AvanzadocourseAcceso por bootcamp

SQL Patterns for Production APIs Guide

64

Lecciones

8

Módulos

🎓

Acceso por bootcamp

Lo que aprenderás

Implement cursor and keyset pagination with SQLAlchemy 2.0 (17x faster than OFFSET on deep pages) with composite cursors for secondary sort
Model soft deletes with partial indexes and avoid the anti-patterns that destroy performance (plus knowing when to use archive tables or partitioning instead)
Design audit logs with PostgreSQL triggers, history tables, or lightweight event sourcing, choosing the right approach per case
Implement multi-tenancy correctly with Row-Level Security (RLS), schema-per-tenant, or shared schema — with quantified trade-offs
Execute zero-downtime migrations with expand-contract, `CREATE INDEX CONCURRENTLY`, `lock_timeout`, and `statement_timeout` using Alembic in production
Handle concurrent updates with optimistic locking (version columns) and translate `StaleDataError` to HTTP 409 with useful client feedback
Version schemas with backward-compatible changes, deprecation strategies, and contract testing
Run bulk operations at PostgreSQL speed: `COPY` with `copy_expert`, batch inserts, upserts with `ON CONFLICT DO UPDATE`, with measured benchmarks
Build a production-ready multi-tenant SaaS API consolidating all seven patterns with a live zero-downtime migration

¿Para quién es?

  • Senior backend Python developers with FastAPI apps in production who have hit real problems: slow deep-page pagination, leaky multi-tenancy, migrations that broke deploys
  • Engineers who completed the PostgreSQL & SQLAlchemy and Database Performance guides and need the patterns that come after "you know how to optimize queries"
  • Engineers building multi-tenant SaaS who need to choose an isolation architecture (RLS vs schema-per-tenant vs shared schema)
  • Tech leads writing team guidelines for how pagination, soft deletes, and migrations should be done
  • Developers preparing for senior backend interviews at SaaS companies where cursor pagination, RLS, and zero-downtime migrations are asked
  • Anyone who has had to run an `ALTER TABLE` in production at 3am and would rather not repeat the experience

Requisitos

  • PostgreSQL & SQLAlchemy guide completed (or equivalent: SQLAlchemy 2.0 ORM with relationships, basic Alembic, ACID, isolation levels)
  • Database Performance & Query Tuning guide completed (or equivalent: EXPLAIN ANALYZE, advanced indexing, N+1 with SQLAlchemy)
  • Functional FastAPI app with real data (>100k rows in at least one table) for hands-on practice
  • PostgreSQL 14+ installed locally or in Docker (some RLS features require 14+)
  • Familiarity with `psql`, Alembic CLI, and FastAPI dependency injection
  • Comfort with async/await in Python

Contenido del curso

1Módulo 1: Pagination Patterns — Guía para el Creador8 lecciones
2Módulo 2: Soft Deletes Correctos — Guía para el Creador8 lecciones
3Módulo 3: Audit Logs y History Tables — Guía para el Creador8 lecciones
4Módulo 4: Multi-Tenancy en PostgreSQL — Guía para el Creador8 lecciones
5Módulo 5: Zero-Downtime Migrations — Guía para el Creador8 lecciones
6Módulo 6: Optimistic Locking + Schema Versioning — Guía para el Creador8 lecciones
7Módulo 7: Bulk Operations — Guía para el Creador8 lecciones
8Módulo 8: Proyecto Final — TaskFlow API — Guía para el Creador8 lecciones
Reviews

What students say

Sign in to leave a review.

No approved reviews yet.

Be the first to share your experience!