April 2019
Beginner to intermediate
244 pages
6h 34m
English
Ecto’s protection against N+1 queries helps prevent runaway situations where our code is making huge numbers of queries for what appears to be a simple operation. But even then, fetching associated records always requires an extra round-trip to the database, and there may be situations where you want to avoid it. You might be working with associated records that always need to be loaded along with the parents, or you may be in a performance-critical situation where you need to eke out every last ounce of speed that you can. In cases like these, Ecto provides embedded schemas.
With embedded schemas, associated records are stored in a single database column along with the rest of the parent record’s ...
Read now
Unlock full access