Skip to content
Eunji LEE edited this page Jun 27, 2026 · 11 revisions

Job-Demand Dashboard — Database Design

Django + Next.js · Adzuna API

This document defines the schema for data the app owns. Live job postings from Adzuna are not stored as tables — they live in Django's cache (TTL) and are refetched from Adzuna when they expire.


1. Stored in the DB vs. Cached

Type What How it's kept
Stored in DB Accounts, favourites, saved searches, daily analytics Permanent tables
Cached, not stored Live job listings, salary histograms, regional / trend data Django cache (refetched from Adzuna on TTL expiry)

Adzuna postings only sit in the cache briefly, but CSV postings must be stored permanently, so a separate table is required. FAVOURITE_JOBS can't be reused because it's per-user data.


4. Considerations for CSV Import

Once CSV postings are stored in the DB, the listings shown on screen come from two sources:

  1. The JOB_POSTINGS table (our postings)
  2. The Adzuna cache (external postings)

So decide up front how the frontend (JobList.js) merges them:

  • Merge into one list → needs combining logic in the backend
  • Split into tabs → "External postings" / "Our postings"

5. Three Things to Remember

  1. User data is one-to-many — one USERS row owns many FAVOURITE_JOBS and SAVED_SEARCHES rows.
  2. Analytics stands alone — DEMAND_SNAPSHOTS has no user link; it's global data built by a daily job.
  3. Adzuna postings are cached, not modeled — the DB only holds data you own. Only CSV postings are stored, in JOB_POSTINGS.

Clone this wiki locally