Lesson 07 Databases
Theme:
Lesson 07 · Slide 1

Lesson 07 — Databases

SQL / NoSQL / vector / search — what to store where, and the cost of getting it wrong.

IT Landscape Module 2

Lesson 07 · Slide 2

Why a database, instead of files?

A folder of .csv files is a database — for one user. It collapses past that.

Lesson 07 · Slide 3

SQL — the 50-year incumbent

Invented in the 1970s. Still the most-deployed kind of database in the world.

Brands you’ll hear (as of 2026):

Lesson 07 · Slide 4

Tables, rows, queries

A tiny SQL query:

SELECT name, email
FROM users
WHERE country = 'UA'
ORDER BY name;

You don’t need to write this — just see the shape: column names, a filter, an ordering.

The users table:

nameemailcountry
Olenaolena@example.comUA
Petropetro@example.comUA
Janejane@example.comUS
Lesson 07 · Slide 5

NoSQL — when SQL doesn’t fit

In the 2000s, web companies hit limits with single-machine SQL:

NoSQL is a catch-all for the alternatives that emerged. There are four main shapes — the next four slides.

Lesson 07 · Slide 6

Document stores — MongoDB & friends

Store JSON-like documents instead of rows. Schema can vary per document.

Names you’ll hear (as of 2026):

Lesson 07 · Slide 7

Key-value — Redis & friends

Just a giant hash map. Lives in memory. Ridiculously fast.

SET user:42:session "abc123"
GET user:42:session   -> "abc123"

Used as:

Names (as of 2026): Redis (king), Valkey (fork), Memcached (older), DynamoDB (also key-value).

Lesson 07 · Slide 8

Search — Elasticsearch & friends

When you need full-text search — typos, synonyms, ranking by relevance — SQL LIKE '%foo%' is the wrong tool.

Search engines build inverted indexes over text and rank results.

Names (as of 2026):

Lesson 07 · Slide 9

Vector databases — for AI (as of 2026)

LLMs and embeddings need to search by semantic similarity, not keyword.

Vector DBs store high-dimensional vectors (~1024 numbers per item) and find nearest neighbors fast.

Names (as of 2026):

This space is the most volatile — vendors come and go quarterly. Refresh annually.

Lesson 07 · Slide 10

Picking the right one

If your data looks like … Reach for …
Transactional / accounts / moneySQL (Postgres)
User-shaped data with varying fieldsDocument store (Mongo)
Session, cache, leaderboardKey-value (Redis)
Search bar with typo toleranceSearch engine (Elasticsearch / Algolia)
RAG — “find similar to this prompt”Vector DB (pgvector / Pinecone)
Lesson 07 · Slide 11

The cost of getting it wrong

Database choice is a long-tail commitment. You will live with this one for years.

Lesson 07 · Slide 12

“Just use Postgres”

A common 2026 take. Also serious advice.

Modern PostgreSQL handles:

One database, fewer moving parts. Caveat: at extreme scale, specialized stores still win.

Lesson 07 · Slide 13

Recap

Coming up: Plan C / Module 3 — getting software actually running for real users.
1 / ?