Online course · Development
SQL & NoSQL Database Design for Backend Developers
Design schemas, indexes and transactions that hold up in production, SQL and NoSQL
Created by TrainSkool Trainer
- Development
- Intermediate
- English
- 27 lessons
- 10h 6m
- 8 assessments
- Certificate
Coming soon Launch price ₹1,499
This course is not open for enrolment yet.
About this course
For backend developers, final-year engineering students and Data Analytics graduates who can already write SELECT, JOIN and GROUP BY and now need to design the databases behind real applications. You follow one running example, Ghar Bazaar, a fictional Pune grocery delivery app, from its first order table to a multi-store system. You will model entities and keys, normalise to 3NF, store money in paise and time in UTC with IST display, design indexes from query plans, write safe transactions for wallets and stock, make UPI callbacks idempotent, model documents, key-value and wide-column data, choose SQL or NoSQL with a written decision framework, ship zero-downtime migrations, and plan backups, replication, pooling and partitioning, with DPDP Act awareness. Prerequisite: comfortable basic SQL; the Data Analytics with SQL, Python & Power BI course is recommended. Included: 27 text lessons with slides and quick checks in every lesson, 25 auto-checked SQL and Python exercises, seven chapter projects, chapter quizzes, a rubric-graded capstone, a 20-question final exam and a certificate of completion. Lessons are text and slides; trainer videos are coming later. Products named, such as PostgreSQL, MongoDB, Redis and Apache Cassandra, are referenced descriptively; TrainSkool is not affiliated with or endorsed by them. What you will be able to do: - You will be able to turn a written requirement into entities, relationships and a normalised PostgreSQL schema with the right keys and constraints. - You will be able to design composite, covering and partial indexes and prove their effect with EXPLAIN ANALYZE. - You will be able to write transactions that keep stock and wallet balances correct under concurrency, retries and duplicate callbacks. - You will be able to model data for document, key-value and wide-column stores, with bounded partitions and explicit schemas. - You will be able to choose SQL or NoSQL for a use case with a written, weighted decision record, and keep several stores consistent with an outbox. - You will be able to ship schema and data migrations on live tables without downtime using expand and contract. - You will be able to plan backups, point-in-time recovery, replication, pooling and partitioning against stated RPO and RTO targets. - You will be able to design, test and document a complete data layer for a new application brief.
What you'll learn
- Turn a written requirement into entities, relationships and a normalised PostgreSQL schema with the right keys and constraints.
- Design composite, covering and partial indexes and prove their effect with EXPLAIN ANALYZE.
- Write transactions that keep stock and wallet balances correct under concurrency, retries and duplicate callbacks.
- Model data for document, key-value and wide-column stores, with bounded partitions and explicit schemas.
- Choose SQL or NoSQL for a use case with a written, weighted decision record, and keep several stores consistent with an outbox.
- Ship schema and data migrations on live tables without downtime using expand and contract.
- Plan backups, point-in-time recovery, replication, pooling and partitioning against stated RPO and RTO targets.
- Design, test and document a complete data layer for a new application brief
Course content
Chapter 1 · Module 1: Relational Design — Entities, Keys and Normalisation
- Code lab: From Requirements to Entities, Relationships and CardinalityMeera Kulkarni leads the backend team at Ghar Bazaar, a fictional Pune-based app that delivers groceries and daily essentials from about forty small "dark stores" across Pune, Nashik and Nagpur.9 topics · 22 min
- Code lab: Keys and Constraints: Primary, Foreign, Unique and Check" in application code before inserting a customer. On a busy Sunday morning two signup requests from the same phone arrived 40 milliseconds apart.10 topics · 22 min
- Code lab: Normalisation in Practice: 1NF, 2NF, 3NF and BCNFGhar Bazaar's first supplier-management screen stored everything about a purchase in one row: supplier name, supplier GSTIN, supplier city, product SKU, product name, HSN code, quantity received and…10 topics · 23 min
- Code lab: Data Types, Money, Time and Deliberate Denormalisation00. The app stored prices in a floating-point column.16 topics · 22 min
Chapter 2 · Module 2: Indexing and Query Performance Basics
- Code lab: How Indexes Work: B-Trees, Pages and SelectivityGhar Bazaar's "My orders" screen was instant in the first month.10 topics · 22 min
- Code lab: Composite, Covering and Partial Indexes1, the "My orders" query used an index on customer_id, then sorted the customer's orders by placed_at.10 topics · 22 min
- Code lab: Reading Query Plans With EXPLAIN and EXPLAIN ANALYZEWhen a Ghar Bazaar endpoint is slow, the instinct is to guess: "add an index", "the database is overloaded", "the ORM is bad".10 topics · 23 min
- Code lab: Query Patterns That Scale: N+1, Keyset Pagination and the Cost of IndexesSome of Ghar Bazaar's slowest endpoints had no slow query at all.16 topics · 22 min
Chapter 3 · Module 3: Transactions and ACID
- Code lab: ACID and Transactions in Application CodeGhar Bazaar lets customers pay from a prepaid wallet. Checkout originally ran three separate statements from the API: insert the order, insert its lines, and insert a wallet debit.10 topics · 22 min
- Code lab: Isolation Levels and Concurrency AnomaliesDuring a flash sale on 1 kg ghee tins, Ghar Bazaar's Kothrud store had 3 tins in stock.10 topics · 23 min
- Code lab: Locking, Deadlocks, Idempotency and Safe RetriesGhar Bazaar's payment gateway sends a callback (a webhook) to the backend when a UPI payment succeeds.16 topics · 23 min
Chapter 4 · Module 4: Introduction to NoSQL — Document, Key-Value and Wide-Column Models
- Code lab: Why NoSQL Exists: Scale, Flexibility and the Trade-OffsBy its third year, Ghar Bazaar's PostgreSQL database was doing four very different jobs.10 topics · 22 min
- Code lab: Document Databases: Modelling the Catalogue in MongoDBGhar Bazaar's catalogue team adds new categories every month: first groceries, then personal care, then small electronics and festive clothing.11 topics · 23 min
- Code lab: Key-Value Stores: Redis for Carts, Sessions and Rate LimitsEvery tap in the Ghar Bazaar app touches the cart: add an item, change a quantity, open the cart screen.10 topics · 22 min
- Code lab: Wide-Column Stores: Cassandra for Rider Pings and Order EventsEach Ghar Bazaar rider's app sends a GPS ping every five seconds while on shift: rider id, time, latitude, longitude, speed and battery level.16 topics · 23 min
Chapter 5 · Module 5: Choosing SQL vs NoSQL for a Use Case
- Code lab: A Decision Framework: Access Patterns, Consistency, Scale and TeamIn Chapter 4, Arjun mapped Ghar Bazaar's workloads to data models and left one decision open: should the product catalogue move to a document database, or stay in PostgreSQL?10 topics · 22 min
- Code lab: JSON Inside a Relational Database: PostgreSQL JSONB as a Middle Path1 ended with a decision: keep Ghar Bazaar's catalogue in PostgreSQL, with common fields as columns and the category-specific attributes in a JSONB column.10 topics · 23 min
- Code lab: Polyglot Persistence: Keeping Several Stores in SyncAfter Chapters 4 and 5, Ghar Bazaar's data lives in several places: orders, payments, stock and the catalogue in PostgreSQL; carts and sessions in Redis; rider pings and order status events in…18 topics · 23 min
Chapter 6 · Module 6: Schema Migrations
- Code lab: Migration Tools and Workflow: Versioned, Reviewed and RepeatableIn Ghar Bazaar's first year, whoever needed a schema change connected to the database and typed ALTER TABLE.10 topics · 22 min
- Code lab: Zero-Downtime Changes: Expand, Backfill and ContractGhar Bazaar takes orders from 6 am to midnight every day, and quick-commerce customers do not wait.10 topics · 23 min
- Code lab: Data Migrations and Evolving NoSQL SchemasSome changes are not about the shape of the schema at all, but about the data inside it.16 topics · 23 min
Chapter 7 · Module 7: Backup, Scaling and Replication Basics
- Code lab: Backups and Point-in-Time Recovery: RPO, RTO and Restore DrillsAt 11:42 one Tuesday morning, a support engineer at Ghar Bazaar ran a script meant to cancel a handful of test orders.10 topics · 23 min
- Code lab: Replication: Read Replicas, Lag and FailoverGhar Bazaar's primary PostgreSQL server ran in one data centre zone in Mumbai.11 topics · 23 min
- Code lab: Scaling Out: Connection Pooling, Partitioning and ShardingGhar Bazaar announced expansion from three cities to ten over the next year.16 topics · 23 min
Chapter 8 · Module 8: Capstone — Design a Schema for Ghar Bazaar Daily
- Reading: Capstone Brief: Ghar Bazaar Daily SubscriptionsEvery chapter of this course solved one kind of design problem in isolation: entities and keys, indexes, transactions, NoSQL models, the SQL-versus-NoSQL decision, migrations, backups and scaling.9 topics · 20 min
- Code lab: Building and Proving Your Design: A Step-by-Step WorkplanCapstones usually fail from working in the wrong order: tables before rules are understood, indexes before queries exist, and the hard parts (nightly run, wallet, duplicate rider updates) left until…9 topics · 27 min
- Assignment: Capstone Deliverables, Review Checklist and Grading RubricA reviewer wants to know within minutes what you built, whether it runs, what it was tested on, whether the hard rules (no double charges, the all-or-nothing wallet rule, idempotent rider updates)…8 topics · 18 min
Assessments and certificate
- Module 1 quiz: Relational Design — Entities, Keys and Normalisation7 questions · 15 min · pass mark 70%
- Module 2 quiz: Indexing and Query Performance Basics7 questions · 15 min · pass mark 70%
- Module 3 quiz: Transactions and ACID7 questions · 15 min · pass mark 70%
- Module 4 quiz: Introduction to NoSQL — Document, Key-Value and Wide-Column Models7 questions · 15 min · pass mark 70%
- Module 5 quiz: Choosing SQL vs NoSQL for a Use Case7 questions · 15 min · pass mark 70%
- Module 6 quiz: Schema Migrations7 questions · 15 min · pass mark 70%
- Module 7 quiz: Backup, Scaling and Replication Basics7 questions · 15 min · pass mark 70%
- SQL & NoSQL Database Design for Backend Developers — final assessment20 questions · 40 min · pass mark 70%