Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 01 · Portfolio Projects · Build It Yourself · about 16 min to read

Play it as a journeyTutor comes with a plan

P3: A full-stack app, end to end

S1 - Build Your Own Database
S1 - Build Your Own Database · Open board

: the board shows a program that takes commands and keeps records safe. This lesson puts a real database under a login, then ships the whole thing and watches it.

Asha Rao (a made-up learner, so her numbers are teaching values) has the API from P2: An API with tests and a pipeline. A recruiter looks at it and asks: “Whose tasks are these? Anyone can read anyone’s list. And what happens to the data when you deploy a new version?” Her API has no users. Her data sits in one file on her laptop. When the program restarts on a server, nobody checks who is calling and nobody can say what shape the database has.

A full-stack app is a page the user sees, an API behind it, and a database under it, all running on a server. By the end of this lesson you will be able to add login to your API, keep each user’s rows apart, change the database safely with numbered scripts, deploy from a pipeline, and see from outside whether the app is healthy.

The history (optional)

In June 2012 a file of about 6.5 million password hashes from LinkedIn was posted on a Russian forum. The hashes were SHA-1 and had no salt, so many were cracked quickly. In May 2016 a much larger set, about 117 million emails and passwords from the same 2012 theft, was posted again. The lesson below shows why the missing salt mattered. Nothing later depends on this history.

Before you start. P2: An API with tests and a pipeline gave you a task API with CRUD, status codes, tests and a pipeline that runs them on every push. Authentication showed that a server must never store a password itself. Shipping without fear: rolling, blue-green, canary and flags showed how to release a new version to a few users first. The Watchtower (Observability) showed that you find out about a fault by measuring, not by waiting for a complaint. You need to know what a SQL table is.

Lesson 10 of 19 in Portfolio Projects

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • Password hash and salt: store a fingerprint, never the password
  • Session and cookie: a token that says “this is the same person”
  • Migration: a numbered script that changes the database
  • Health check and metric: let the app say how it is doing
  • Deploy: the pipeline ships it, and the order matters
  • The migration runner
  • Hashing and checking
  • Edges and trade-offs
  • The deploy workflow (shape only, not run here)
  • Backups

Terms it explains: full-stack app, hash, salt, session token, cookie, migration, health check, metric, CD, "Session cookie or JWT?", Common mistakes, compaction, log-structured, offset, WAL.

Review Portfolio Projects