Database Design & ORMs
Design real production database schemas, use SQLAlchemy ORM, manage migrations with Alembic, cache with Redis, and know when to reach for NoSQL.
What you'll learn
Database Design & ORMs is organized into 6 focused modules. By the end you'll be comfortable with:
- Schema Design
- SQLAlchemy ORM
- Alembic Migrations
- Redis & Caching
- NoSQL Introduction
- Polyglot Persistence
Course curriculum
23 lessons across 6 modules. Lessons marked Free preview are readable without an account.
Module 1. Schema Design
Design production database schemas with ER diagrams, normalization, and real-world trade-offs.
- 10mER Diagrams and RelationshipsFree preview
Model your domain with Entity-Relationship diagrams before writing a single line of code.
- 12mNormalization vs DenormalizationFree preview
Understand database normalization (1NF–3NF) and when to intentionally denormalize for performance.
- 10mIndexing Strategies
Add the right indexes to make queries fast — and understand why over-indexing slows writes.
- 12mDesigning Real Schemas
Design complete, production-ready schemas for e-commerce and SaaS applications.
Module 2. SQLAlchemy ORM
Use SQLAlchemy to define models, perform CRUD, and query relationships without writing raw SQL.
- 10mDefining SQLAlchemy Models
Map Python classes to database tables with SQLAlchemy's declarative model system.
- 12mAdvanced SQLAlchemy Queries
Write complex queries with filters, joins, aggregations, and subqueries using SQLAlchemy's ORM.
- 10mRelationships and Loading Strategies
Configure SQLAlchemy relationships and choose between lazy, eager, and explicit loading.
- 8mRaw SQL When ORM Falls Short
Use SQLAlchemy's text() for complex queries that are impractical with the ORM.
- 8mORM Performance Patterns
Avoid common SQLAlchemy performance traps and write efficient database code.
Module 3. Alembic Migrations
Manage database schema changes safely with Alembic — the standard migration tool for SQLAlchemy projects.
- 8mWhy Migrations Matter
Understand why direct schema changes in production are dangerous and how migrations provide safety.
- 12mCreating and Running Migrations
Generate, review, and apply Alembic migrations — the daily workflow for schema changes.
- 10mZero-Downtime Migrations
Apply schema changes to a running production database without any downtime or data loss.
- 8mMigrations in Production
Integrate Alembic migrations into your CI/CD pipeline for automated, reliable deployments.
Module 4. Redis & Caching
Cache expensive database queries and API responses with Redis to dramatically reduce response times.
- 8mWhat is Redis?
Understand Redis as an in-memory data store — when and why to use it alongside PostgreSQL.
- 12mCaching API Responses
Implement a cache-aside pattern to cache expensive API endpoint responses in Redis.
- 10mRate Limiting with Redis
Implement scalable, accurate rate limiting using Redis atomic operations across multiple server instances.
- 10mRedis Data Structures
Use Redis hashes, lists, sets, and sorted sets for use cases beyond simple key-value caching.
Module 5. NoSQL Introduction
Understand when NoSQL databases (MongoDB) are the right choice and how the document model works.
- 10mSQL vs NoSQL Trade-offs
Understand when relational databases and NoSQL databases each shine — and when to use both.
- 12mMongoDB Document Model
Work with MongoDB documents, collections, and CRUD operations using pymongo.
- 8mWhen to Choose NoSQL
Apply a decision framework to choose the right database for your specific use case.
Module 6. Polyglot Persistence
Design systems that use multiple databases for different concerns — and know where each data type lives.
- 10mPolyglot Persistence Patterns
Design a multi-database backend architecture where each database handles what it does best.
- 8mDatabase Connection Management
Configure connection pools for PostgreSQL and Redis to handle production load efficiently.
- 8mDatabase Design Review Checklist
Review your database design against a production checklist before shipping.
Frequently asked questions
- Is the Database Design & ORMs course free?
- You can preview lessons for free with no account. Full access to this Pro course is included with a Kodion Pro subscription.
- Do I need prior programming experience?
- This is a intermediate course, so you'll get the most from it if you're already comfortable with the basics of programming.
- How long does Database Design & ORMs take to complete?
- It's 23 lessons across 6 modules, roughly 4 hours of hands-on learning. You can go entirely at your own pace.
- What will I learn?
- You'll work through Schema Design, SQLAlchemy ORM, Alembic Migrations, and more, building real, applied skills through interactive lessons and coding challenges.
- Can I get help if I'm stuck?
- Yes. Kodion's built-in AI tutor gives instant, context-aware hints and explanations right inside each lesson as you code.
Ready to start Database Design & ORMs?
Create a free account to track progress, earn XP, and get instant help from the AI tutor as you code.
Create your free account