For Want of a JOIN
It is one thing when a junior does this because they haven&#x27;t learned better.<p>It&#x27;s quite another when experienced seniors ban the use of SQL features because it&#x27;s not &quot;modern&quot; or there is an architectural principle to ban &quot;business logic&quot;  in SQL.<p>In our team we use SQL quite heavily: Process millions of input events, sum them together, produce some output events, repeat -- perfect cases for pushing compute to where the data is, instead of writing a loop in a backend that fetches events and updates projections.<p>Almost every time we interact with other programmers or architects it&#x27;s an uphill battle to explain this -- &quot;why can&#x27;t just just put your millions of events into a service bus and write some backend to react to them to update your aggregate&quot;. Yes we CAN do that but why do that it&#x27;s 15 lines of SQL and 5 seconds compute -- instead of a new microservice or whatever and some minutes of compute.<p>People bend over backwards and basically re-implement what the databases does for you in their service mesh.<p>And with events and business logic in SQL we can do simulations, debugging, inspect state at every point with very low effort and without relying on getting logging right in our services (because you know -- doing JOIN in SQL is not modern, but pushing the data to your service logs and joining those to do some debugging is just fine...)<p>I think a lot of blame is with the database vendors. They only targeted some domains and not others, so writing SQL is something of an acquired taste. I wish there was a modern language that compiled to SQL (like PRQL, but with data mutation).