Skip to content

Learn more about Software Architecture & Design.
Join thousands of developers getting weekly updates to increase your understanding of software architecture and design concepts.


Follow @CodeOpinion

Derek Comartin

DRY principle is why your codebase sucks?

DRY Principle is seemingly advocated for or against. In reality, it’s not good or bad so as long as you understand why you’re applying it and for what purpose. Misunderstanding DRY is why your system can turn into a hard to change rats nest. YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. Don’t Repeat Yourself (DRY) When it comes to DRY, opinions are all over the map. Some folks swear by it, while others argue it’s the worst idea ever. The truth? It’s not inherently good… Read More »DRY principle is why your codebase sucks?

Distributed Systems Consistency: Mistake Nobody Warns You About!

One of the most common and very overlooked issues when writing a distributed system is consistency. You have one thing happening in one part of your system that triggers something else to happen in another part of the system, except it doesn’t happen, and that can be a nightmare to deal with. This is incredibly overlooked but incredibly common, so let’s jump into some code as an example. YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. Example Here’s a really simple sample example that I’m using… Read More »Distributed Systems Consistency: Mistake Nobody Warns You About!

Multi-Tenant: Database Per Tenant or Shared?

When building a multi-tenant application, one of the first decisions revolves around data management: Should you use a shared database or a database per tenant? YouTube Check out my YouTube channel, where I post all kinds of content accompanying my posts, including this video showing everything in this post. Shared Database Let’s start with the shared database model. In this scenario, tenant A and tenant B are hitting the same API, connecting to the same database instance with the same schema. This means you need to record tenant information alongside the data you are persisting. For example, customer data might look like:… Read More »Multi-Tenant: Database Per Tenant or Shared?