DjangoCon US 2018 - "Normalize until it hurts; denormalize until it works"... by FlƔvio Juvenal

This video features FlƔvio Juvenal at DjangoCon US 2018 in San Diego, CA USA.

0:24:15
Published November 8, 2018
3,318 views

DjangoCon US 2018 - "Normalize until it hurts; denormalize until it works" in Django by FlƔvio Juvenal

Thereā€™s a good practice that says ā€œa database is a representer of factsā€. If thereā€™s more than one way to extract a single fact from the database, then thereā€™s a redundancy in it. Every redundancy can cause different anomalies in the data, which in turn cause bugs in the application. To avoid that, thereā€™s a process called normalization, which involves following sets of rules to restructure the database to remove redundancies without losing the original facts. The traditional set of normalization rules are the so-called Normal Forms: First Normal Form, Second, Third, etc. Unfortunately, those are frequently overlooked by developers due to their excessive formalism. But in fact, even the Normal Forms arenā€™t enough to avoid anomalies, since theyā€™re concerned about redundancies only in a single table*. Since cross-table dependencies are very common in modern applications, we must go beyond normal forms to prevent problems.

In this talk, weā€™ll present normalization rules on a friendly language, going beyond normal forms. Weā€™ll understand how the software requirements cause dependencies in database tables, both in-table and cross-tables. Weā€™ll show real examples of non-trivial dependencies that happen on Django models. Weā€™ll discuss how normalization prevents redundancies, inconsistencies, anomalies, and bugs. Knowing that normalization can cause slowdowns in queries, weā€™ll present how to increase performance with denormalization, which is not the same of not normalizing. Instead, denormalization means being able to represent data in multiple ways to speed up queries without introducing inconsistencies. Weā€™ll discuss Django-related denormalization tools that use cronjobs, indexes, caching, materialized views and triggers, and NoSQL.

*Itā€™s common to ignore the fact that normal forms only discuss redundancies inside a single table/record/relval. More about this in this article reviewed by Codd, Fagin and Date, key figures of the relational model.

This talk was presented at: https://2018.djangocon.us/talk/normalize-until-it-hurts-denormalize-it/

LINKS: Follow FlĆ”vio Juvenal šŸ‘‡ On Twitter: https://twitter.com/flaviojuvenal Official homepage: https://www.vinta.com.br

Follow DjangCon US šŸ‘‡ https://twitter.com/djangocon

Follow DEFNA šŸ‘‡ https://twitter.com/defnado https://www.defna.org/

Note: We understand that names change, people change, and bodies change. We respect each individual's journey and privacy. If you have any concerns about a video or need us to remove content, please don't hesitate to contact us. We will handle your request with care and promptly address any issues.

More videos by FlƔvio Juvenal

More videos from DjangoCon US