Buy everything

We've all built services that fall outside of our core domain. Now it's time to stop.

Raise your hand if you’ve ever built a piece of code that you could’ve bought as a service. One that is still running somewhere, taking time to maintain and upgrade.

Man raising his hand.

Following Domain Driven Design, we can split domains into three basic groups: Core, Generic and Supporting. The Core domains are our focus: they have the highest business differentiation, but also enough complexity that they cannot just be copied by a competitor. The Supporting domains are still directly related to our business, but have limited return of investment: either they are not differentiating enough compared to our competitors, or easy enough to reimplement by them should they be a big differentiator. Last, there are the Generic subdomains: things that basically every service needs, like account management, notifications or subscription management.

Diagram of Strategic Domain Driven Design: Core, Generic and Supporting Domains.

Chart by ddd-crew, licensed under CC-BY-SA-4.0

I’ve been guilty of building services that fall squarely into the Generic field. Payments service, anyone? Spending way too much time figuring out account security and sending password reset emails? Been there, done that.

Now, I always remind myself that I only have limited capacity. Both time and resources are limited. Thus, it is important to identify the places where we should invest these resources: what domain gives us the biggest return of investment in the shortest amount of time? Does having a cool, different account management system woo that new customer to sign with us rather than a competitor? Probably not.
Instead, we should use the above Core Domain Chart and put everything we need on there. For everything that’s a Generic domain, find a SaaS that checks it off our list. If it only matches 90% of our requirements, deal with it - it’s not worth the effort to spend all the time and effort creating something from scratch just for those last 10 percentage points. Instead, change the scope.

Even for Supporting domains, consider finding something that meets your business’s needs as closely as possible. Then, depending on how much business differentiation it really brings, there’s always the option to build a wrapper around it to add the last bits and pieces. Generally, over time, pieces move left on the chart: what’s already a Supporting domain now will most likely at some point become Generic, and any amount of work and maintenance that is left to keep it will need to be compared to changing the implementation to a commoditised solution.
In that case, be ready to migrate off your specialised solution to a new service once the amount of effort required to keep it maintained and updated with customers’ needs (and the features the new commoditised service offers) is higher than migrating.

Be smart with your resources. Buy everything you can.