internalsGet Pro

System Design · Module 04

SQL databases: modeling, indexing and transactions

Lessons
14
Free
1
Reading
~4 h

Your progress

0 / 14 lessons done

Sign in to track

Lessons

  1. Relational data modeling: tables and relationshipsYour data model decides which mistakes the database can prevent and which changes can rewrite history. These choices affect ordinary features such as receipts, product edits and customer order lists.15 min
  2. Evolvable data models: designing for future featuresProduct features change relationships and the meaning of stored data. You need models that can change without breaking existing orders, application versions or operational tools.19 min
  3. Repository pattern: separating data access from logicBusiness rules often become difficult to change because they are mixed with database access. A repository gives those rules a smaller dependency, but only if its contract preserves the behavior the application needs.18 min
  4. Indexes: speeding up queries without full scansFreeA slow database query can delay every customer sharing that database. Indexes let you reduce unnecessary reads without changing the API, but every index adds work elsewhere.15 min
  5. B-trees: the data structure behind most indexesIndex size, column order and write patterns affect the work your database performs. Understanding the tree helps you explain slow reads and expensive writes without treating an index as a black box.18 min
  6. Query plans: how the database executes SQLA slow query can use an index and still do far too much work. Query plans let you identify that work before changing SQL, indexes or infrastructure.18 min
  7. Transactions and ACID guaranteesBackend operations often change several rows together. Transactions prevent partial database changes, but you still need correct business rules, clear boundaries and careful retry handling.15 min
  8. Isolation levels and locking: handling concurrent writesCorrect checkout code can fail when two requests overlap. You need to protect business rules without holding database locks across slow network calls.20 min
  9. MVCC: letting reads and writes run at the same timeA query can return an older value without reading from a replica or cache. Understanding MVCC helps you explain that behavior, protect concurrent writes, and diagnose growing tables.19 min
  10. Write-ahead logging: recovering after a crashDatabase commits often succeed before changed table pages reach durable storage. Understanding WAL helps you reason about that guarantee, diagnose slow commits and plan recovery.20 min
  11. Schema migrations without downtimeDeployments leave old and new application versions running together. Database changes must support that overlap without blocking customer requests or silently losing updates.19 min
  12. Online index builds on live tablesAdding an index can fix a slow screen and disrupt unrelated writes at the same time. Engineers need to manage both the construction process and the database state left behind.19 min
  13. Soft delete: marking rows as deleted instead of removing themDelete buttons often need an undo path. Implementing that path changes queries, constraints, relationships and cleanup—not just one database column.18 min
  14. Design: a key-value store built on SQLMany services need small values addressed by a key, not a new database product. Building this interface on SQL teaches where indexing, conditional writes and expiration rules belong.30 min

Practise with

Terms this module teaches 63

Open glossary

ACID

The four guarantees of a database transaction: atomicity (all or nothing), consistency (rules stay true), isolation (concurrent transactions don’t interfere) and durability (committed data survives a crash).