MODULE 5.1

PostgreSQL & SQL

PostgreSQL: The "Gold Standard" database for Python. It's powerful, open-source, and has great support for JSON data—perfect for storing ML model outputs.

MODULE 5.2

SQLAlchemy ORM

python
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column

class Base(DeclarativeBase):
    pass

class User(Base):
    __tablename__ = "users"
    id: Mapped[int] = mapped_column(primary_key=True)
    name: Mapped[str]
MODULE 5.4

Redis Caching

Why Redis? If an ML prediction takes 2 seconds, we don't want to run it twice for the same input. We save the result in Redis (RAM) for instant retrieval.