Clean Architecture - The Art of Drawing Lines

Topics covered
Popular Clips
Episode Highlights
Efficient Updates
Efficiently updating databases, especially with large datasets, is a complex task. Joe Zack explains that while SQL queries can quickly update attributes, they often fail to enforce business rules, leading to potential inconsistencies 1. He emphasizes the importance of ensuring data consistency and correctness, even if it means spinning up thousands of objects in memory to validate changes 2.
You spun up 10,000 objects in memory in your application to ensure that you can update it properly just to send it back to the database. And that feels inefficient and it probably is from an operation standpoint, but from a data consistency and a data, um, what do they call it?
--- Joe Zack
This approach, though seemingly inefficient, guarantees that updates adhere to business logic and maintain data integrity.
  Â
Business Logic
Joe discusses the debate over where business logic should reside, arguing that databases should primarily serve as storage. He notes that mixing storage with business rules can hinder scalability and performance 3.
Your business rules should be something else. And if you think about that, especially in a lot of today's architectures and applications and whatnot, where the whole idea is cloud and the ability to scale horizontally in order to get the performance and the expectations that you need for your users, then that makes sense.
--- Joe Zack
He warns against the temptation to place business logic in the database for efficiency, as it can lead to unintended consequences and complicate maintenance 4.
  Â
SQL Tricks
Joe shares advanced SQL tricks that can enhance database management. He highlights the use of stored procedures and meta objects to uncover hidden functionalities in SQL Server 5. One useful trick involves searching the entire database for specific procedures or functions using the output window in SQL Server Management Studio 6.
One of the tips that I do or one of the tricks that I do a lot is also like star from, from Sys objects where object definition like, and then I'll put whatever I want in there and I can search the entire database for procs functions, whatever that have something.
--- Joe Zack
These techniques can significantly streamline database operations and improve efficiency.
Related Episodes

Clean Architecture - Fight for Architecture
Answers 383 questions

Clean Architecture - Are Microservices Truly Decoupled?
Answers 383 questions

Clean Architecture - Programming Paradigms
Answers 383 questions

Clean Architecture - Make Your Architecture Scream
Answers 383 questions

Clean Architecture - Keeping Your Options Open
Answers 383 questions

Clean Architecture - How to Quantify Component Coupling
Answers 383 questions

Clean Architecture - Components and Component Cohesion
Answers 383 questions

Clean Code - How to Build Maintainable Systems
Answers 383 questions

Clean Code - How to Write Classes the Right Way
Answers 383 questions

Clean Architecture - What is the Humble Object Pattern?
Answers 383 questionsClean Code - How to Write Amazing Functions
Answers 383 questionsThe DevOps Handbook – Architecting for Low-Risk Releases
Answers 383 questions

Clean Code - Comments Are Lies
Answers 383 questionsClean Code - Formatting Matters
Answers 383 questionsDesign Patterns Part 3
Answers 383 questions
