Denormalization With Eloquent: How, Why and When
summary
Claims that precomputing read projections cuts expensive multi-join queries (often 10–30 left joins) down to single-table reads, turning queries that can take four or five minutes into fast selects. Implements this with Eloquent model events that enqueue denormalizers to populate materialized views (or scheduled rebuilds), optionally wrapped in the same transaction for strong consistency or queued for eventual consistency. Advises monitoring the queue, providing an artisan rebuild command, and naming views; this is built as application code and materially improves read performance.
AI-written summary · about
chapters (8)
- 0:00Intro
- 1:06ASSUMPTIONS
- 3:09HOW POPULAR IS Normalization?
- 4:47NORMALIZATION Database normalization is the process of Organizing the columns (attributes) and tables (relations) of a relational database to reduce data redundancy and improve data integrity
- 13:50DENORMALIZATION
- 18:151. Fill the table once 2. Run the query to fill the table at intervals (24 hours) 3. Update the materialized view as source data changes...
- 21:23MATERIALIZED VIEWS With Eloquent
- 30:39FUN THINGS WE CAN DO
related talks
37mDenormalizing Rails
24m"Normalize until it hurts; denormalize until it works" in Django
43mThe denormalized query engine design pattern
41mUsing Databases to Pull Your Application Weight
29mHow De-normalizing Your Data with JSON Can Boost Query Performance
36mNormalisation: Friend Or Foe
46mBeyond Good and ORMs
28mDaniel Coulbourne :: Flip the Switch Slowly
