Lab 20: Capstone — Multi-Model App
Architecture Overview
┌─────────────────────────────────────────────────────────────────┐
│ Social Media Analytics Platform │
├─────────────────┬──────────────────┬────────────────────────── │
│ PostgreSQL 15 │ MongoDB 7 │ Redis 7 │
│ ───────────── │ ──────────── │ ────────────── │
│ • Users │ • Raw events │ • Session cache │
│ • Posts │ • Event logs │ • Trending posts (ZSet) │
│ • Analytics │ • User activity │ • Real-time counters │
│ • Aggregates │ • Device info │ • Rate limiting │
│ │ │ • Pub/Sub notifications │
└─────────────────┴──────────────────┴────────────────────────── ┘
Data Flow:
User Action → Redis counter INCR
→ MongoDB event INSERT
→ PostgreSQL analytics UPDATE (batch)
→ Redis trending ZINCRBYStep 1 — PostgreSQL: Relational Schema
Step 2 — PostgreSQL: Seed Data
Step 3 — PostgreSQL: Analytics Queries
Step 4 — MongoDB: Raw Event Log
Step 5 — MongoDB: Event Analytics
Step 6 — Redis: Session Cache and Real-Time Counters
Step 7 — Data Flow: Connecting All Three Systems
Step 8 — Capstone Queries: Cross-Database Analytics Report
Architecture Summary
Data Type
Storage
Why
What You Built
Last updated
