Skip to content

Architecture

Multi-Tenant Best Practices Can Backfire

You have a multi-tenant system, but you discover a pretty horrible bug. How can that be? You followed all the best practices! Your HTTP API places a message on a queue to generate an invoice. A background process picks up that message and executes it. Everything looks like it worked. There were no exceptions, no failed database calls, and no errors in your logs. However, something went horribly wrong. The request was supposed to execute for tenant A, but what actually happened is that it executed for tenant B. The wrong tenant. YouTube Check out my YouTube channel, where I post all… Read More »Multi-Tenant Best Practices Can Backfire

Domain Events Are NOT Your Public API

You finally did it. You stopped publishing CRUD events and started broadcasting domain events. Instead of publishing ShipmentStatusChanged, ShipmentUpdated, or EstimatedDeliveryDateChanged, you started publishing more meaningful domain events like DeliveryAttemptFailed, ETARecalculated, and ShipmentDelayed. And apparently that was supposed to be better, right? Wrong. YouTube Check out my YouTube channel, where I post all kinds of content on Software Architecture & Design, including this video showing everything in this post. You’re publishing domain events now rather than CRUD events. But you still feel all the pain when you need to change one of those events. You’re breaking consumers, sometimes consumers you didn’t even… Read More »Domain Events Are NOT Your Public API

Decoupling in Software Architecture Moves Complexity

What happens when someone clicks the Place Order button? To the end user, it is pretty simple. It is a button click. But in a large system, there can be a lot going on behind that button. We have to save the order, record the payment, charge the customer’s credit card, reserve inventory, send a confirmation email, and maybe record loyalty points. There may also be analytics, recommendations, or other processes that react to the order. Because there are so many things happening, there are also a lot of things that can go wrong. We are often told that decoupling… Read More »Decoupling in Software Architecture Moves Complexity