Learning track 05
Databases & Caching, fresher to expert
Ten modules from your first SQL query to Redis clusters, Elasticsearch search, and DynamoDB at scale. VaultCommerce grows with every chapter.
- Articles
- 51
- Modules
- 10
- Total read
- 9 hr 16 min
- Streak
- 0 days
Start here
Why Databases Beat File Storage
Data Foundations
Why databases exist, data models, SQL vs NoSQL, and the storage landscape
- Why Databases Beat File StorageConcurrency, integrity, and query power — why VaultCommerce moved off CSV files on day one.
- Data Models and Storage EnginesRows, documents, and key-values — plus how B-tree and LSM engines store data on disk.
- SQL vs NoSQL in PracticeWhen VaultCommerce picks Postgres vs a document store — patterns, not slogans.
- ACID Transactions ExplainedAtomicity, consistency, isolation, durability — with a checkout example that must not half-succeed.
- The Database Types LandscapeThirteen engine families — relational, document, graph, vector, time-series — and where each fits.
Relational SQL Mastery
Schema design, queries, normalization, constraints, isolation, and indexes
- Relational Schema DesignER modeling, keys, and foreign keys for VaultCommerce users, products, and orders.
- SQL Queries, Joins, and AggregatesSELECT, JOIN, GROUP BY, and HAVING — the queries every backend engineer writes daily.
- Normalization and Denormalization1NF through 3NF for clean schemas, and when to break rules for read performance.
- DDL, DML, and ConstraintsCREATE, INSERT, UPDATE, DELETE — plus CHECK, UNIQUE, and NOT NULL that guard your data.
- Isolation Levels and LockingDirty reads, phantom rows, MVCC in Postgres, and choosing the right isolation level.
- Indexing FundamentalsB-tree indexes, selective columns, and why VaultCommerce indexes email but not description.
Query Performance & Schema Ops
EXPLAIN plans, advanced SQL, connection pooling, and migrations
- Query Optimization and EXPLAINRead execution plans, spot sequential scans, and fix slow VaultCommerce reports.
- Advanced SQL PatternsSubqueries, CTEs, and window functions for rankings, running totals, and cohort analysis.
- Connection PoolingHikariCP sizing, pool exhaustion, and why opening a connection per request kills throughput.
- Database MigrationsFlyway and Liquibase for versioned schema changes without downtime surprises.
NoSQL & Polyglot Persistence
Document, column, and graph stores plus choosing the right engine
- Document Databases with MongoDBFlexible product catalogs, embedded reviews, and when JSON documents beat rigid tables.
- Column-Family Stores with CassandraWrite-heavy event logs, partition keys, and tunable consistency for VaultCommerce analytics.
- Graph Databases with Neo4jNodes, edges, and traversal queries for recommendations and fraud detection.
- Choosing the Right DatabaseA decision framework — structure, query patterns, scale, and team skills.
- Polyglot PersistencePostgres for orders, Redis for sessions, Elasticsearch for search — one platform, many engines.
Distributed Data
Replication, sharding, consistent hashing, CAP, and secondary indexes
- Replication ModelsSingle-leader, multi-leader, and leaderless replication — sync vs async trade-offs.
- Partitioning and ShardingVertical vs horizontal splits, hash vs range keys, and rebalancing without downtime.
- Consistent Hashing in PracticeThe hash ring that lets you add cache nodes without remapping every key.
- CAP and PACELC Trade-offsConsistency vs availability under partitions — the database engineer's lens.
- Secondary Indexes at ScaleGlobal vs local indexes, write amplification, and query fan-out in distributed stores.
Caching Fundamentals
Cache patterns, eviction, stampede prevention, and distributed cache design
- Cache FundamentalsWhat caching buys you, where it sits in the stack, and when it hurts more than helps.
- Caching PatternsCache-aside, read-through, write-through, and write-behind — with VaultCommerce cart examples.
- Eviction, TTL, and Cache StampedeLRU policies, time-to-live, and preventing thundering herd on hot keys.
- Memcached vs RedisSimple LRU blobs vs rich data structures — pick the right in-memory engine.
- Distributed Cache ArchitectureClient-side vs server-side caching, replication, and cache layers in production.
Redis Deep Dive
Data types, pub/sub, streams, persistence, cluster, and production hardening
- Redis Architecture OverviewSingle-threaded event loop, in-memory speed, and where Redis fits in VaultCommerce.
- Redis Strings, Lists, and SetsSET, GET, LPUSH, SADD — the commands behind sessions, queues, and unique tags.
- Redis Sorted Sets and HashesLeaderboards with ZADD, user profiles with HSET — structured data in memory.
- Redis Pub/Sub and StreamsFire-and-forget messaging vs durable consumer groups for event pipelines.
- Redis Persistence: RDB and AOFSnapshots vs append-only logs — durability trade-offs for in-memory data.
- Redis Cluster, Sentinel, and ProductionHigh availability, automatic failover, sharding, and hot-key mitigation.
Elasticsearch
Architecture, mapping, full-text search, aggregations, and production ops
- Elasticsearch ArchitectureClusters, nodes, shards, and replicas — how VaultCommerce indexes millions of products.
- Elasticsearch CRUD and MappingIndex documents, dynamic vs explicit mapping, and keyword vs text fields.
- Full-Text Search Queriesmatch, bool, fuzzy, and term queries for product search that tolerates typos.
- Elasticsearch AggregationsBucket and metric aggregations for faceted search and sales dashboards.
- Elasticsearch Production OpsAnalyzers, index lifecycle management, reindexing, and the OpenSearch fork note.
DynamoDB
Access patterns, indexes, single-table design, streams, DAX, and transactions
- DynamoDB Core ConceptsTables, items, partition keys, and sort keys — the NoSQL engine behind high-write workloads.
- DynamoDB Access PatternsDesign tables around queries, capacity units, and why scans are the last resort.
- DynamoDB GSI and LSIGlobal and local secondary indexes — alternate access paths without full table scans.
- DynamoDB Single-Table DesignEntity overloading, composite keys, and one table for an entire microservice domain.
- DynamoDB Streams, DAX, and TransactionsChange data capture, microsecond caching, and multi-item ACID writes.
- DynamoDB Production PatternsTTL cleanup, on-demand scaling, and a social-stories-style access pattern walkthrough.
Production & Expert Playbook
Backup, security, monitoring, and the on-call reference checklist
- Backup and Disaster RecoveryRPO, RTO, point-in-time recovery, and cross-region failover for VaultCommerce data.
- Database SecurityEncryption at rest and in transit, RBAC, least privilege, and SQL injection prevention.
- Monitoring and Slow Queriespg_stat_statements, Redis INFO, CloudWatch alarms, and the on-call triage playbook.
- Database Production ChecklistThe expert reference card — indexing, pooling, caching, backups, and interview talking points.