Uploaded October 2026 | Updated November 2026, 20 hours ago
Ten pieces of backend code your database can already do for you, shown on one made-up dog grooming booking app: the code you write today, the SQL that replaces it, and the catch that bites people in production.
We cover RETURNING, CHECK constraints, DISTINCT ON, LATERAL joins, generate_series, exclusion constraints against double bookings, materialized views, SKIP LOCKED job queues, LISTEN/NOTIFY instead of polling, and row level security for multi-tenant apps. Examples use PostgreSQL. Groomly is a made-up app and every number on screen is example data.
CHAPTERS
0:00 The backend code that does not need to exist
0:53 1: RETURNING
1:21 2: CHECK constraint
1:55 3: DISTINCT ON
2:25 4: LATERAL join
2:57 5: generate_series
3:29 Halfway: from glue code to prevention
3:40 6: Exclusion constraint (no double bookings)
4:16 7: Materialized view
4:57 8: SKIP LOCKED
5:39 9: LISTEN / NOTIFY
6:17 10: Row level security
7:13 The whole board
7:47 What still belongs in your app
8:19 Which one would delete the most code?
#postgresql #sql #backend
Ten pieces of backend code your database can already do for you, shown on one made-up dog grooming booking app: the code you write today, the SQL that replaces it, and the catch that bites people in production.
We cover RETURNING, CHECK constraints, DISTINCT ON, LATERAL joins, generate_series, exclusion constraints against double bookings, materialized views, SKIP LOCKED job queues, LISTEN/NOTIFY instead of polling, and row level security for multi-tenant apps. Examples use PostgreSQL. Groomly is a made-up app and every number on screen is example data.
CHAPTERS
0:00 The backend code that does not need to exist
0:53 1: RETURNING
1:21 2: CHECK constraint
1:55 3: DISTINCT ON
2:25 4: LATERAL join
2:57 5: generate_series
3:29 Halfway: from glue code to prevention
3:40 6: Exclusion constraint (no double bookings)
4:16 7: Materialized view
4:57 8: SKIP LOCKED
5:39 9: LISTEN / NOTIFY
6:17 10: Row level security
7:13 The whole board
7:47 What still belongs in your app
8:19 Which one would delete the most code?
#postgresql #sql #backend










