Speaker
Leonardo Rochael Almeida
Material
Note
-
SQLAlchemy
- SQL Expression Language (a Python DSL)
- Object Relational Mapper (ORM)
-
The ORM Trap
- Sensible Python Code → Bad SQL access patterns
- unnoticeable at low data volumes
- e.g., dev and early production
-
The Fix: Let the DB do its job
- Be aware of implicit queries
- especially from relationships
- Aim for O(1) queries per request/job/activity
- Avoid looping through model instances
- Be aware of implicit queries