Use clojure.spec to validate NoSQL data shapes before database writes and at service boundaries.
This section bridges the chapter overview and the detailed lessons below. For Java engineers, the practical question is how to handle clojure.spec validation for schema-light data in Clojure code at the database boundary.
| Review focus | What to check |
|---|---|
| Input contracts | Validate maps before they become database records. |
| Error visibility | Return explainable failures instead of silent bad writes. |
| Evolution | Keep specs flexible enough for changing document shapes. |
Use the child lessons to move from concept to implementation. The section goal is to make the trade-off visible before the code hardens around a database assumption.