๐Ÿ—„๏ธ
๐Ÿ“ Data & Storage with the Larz Stack ยท LARZ-701 ยท Assignments

Data & Storage with the Larz Stack โ€” Assignments

Work each problem yourself first, then open the worked solution to check your thinking. This is where the course sticks.

๐Ÿ“ 4 problemsโœ๏ธ Worked solutions
Problem 1

Explain when larzdb is the right choice and when you'd move to a database server.

Show worked solution

A strong answer notes larzdb suits prototypes, tools and small-to-medium single-server apps (crash-safe, zero setup), and you move to a server for high write concurrency or very large datasets - and that larzsql + larzmigrate make that transition smooth rather than a rewrite. It reflects not taking on server complexity before you need it.

Problem 2

Explain how larzsql makes SQL injection impossible 'by construction'.

Show worked solution

Good answers explain that larzsql never inlines a value into the SQL text - it emits a placeholder plus a separate params list, so user input is always data, never code - making injection structurally impossible rather than dependent on the developer remembering to escape. Bonus: identifiers are validated too.

Problem 3

Describe why migrations matter and what 'drift' is.

Show worked solution

Strong answers explain migrations as ordered, versioned, repeatable schema changes that keep environments in sync (vs risky hand-edits), and drift as an already-applied migration being edited so files no longer match what ran - which larzmigrate catches via checksums, pushing you to add a new migration instead of altering history.

Problem 4

Identify something worth caching in an app and explain how you'd keep it fresh.

Show worked solution

Good answers pick expensive, slow-changing work (a heavy query, an API result, a computed report), cache it (e.g. @memoize or an LRU with TTL), and manage freshness with a TTL and/or explicit invalidation when the underlying data changes - while noting you should be careful caching data that must always be current.

More in this course

Course home → · Browse all courses →