Subdominios Core / de Soporte / Genéricos

Tipos de subdominio

Escrito por Darjus Kazakevic · revisado el

Spend your best effort where the business is different, and buy the rest.

A subdomain is one area of what the business does. In an online shop: pricing, returns, payments, login. They do not all deserve the same effort. Domain-Driven Design is expensive, and applied evenly it puts careful models around things that are only a form and a table.

So you classify. The core subdomain is where the company wins against competitors. Supporting subdomains are needed but ordinary. Generic subdomains are problems every business has, like payments or login, and you usually buy them.

En esencia — Classify each part of the business as core, supporting or generic, and give a rich model only to the core, where the business competes.

Cuándo recurrir a él

Recurre a él cuando

  • Deciding where to put modelling effort and senior engineers
  • Making a build-or-buy decision for a part of the system
  • Explaining why one module has a rich model and another does not

Reconsidéralo cuando

  • A small system that is one subdomain anyway
  • As a permanent label: the classification changes over time
  • Without business input: engineers cannot judge value alone

The three kinds

Core subdomain
Where the business differs from its competitors: the reason customers choose it. It changes often and is worth a rich model and the strongest engineers.
Supporting subdomain
Specific to this business and necessary, but not a reason customers choose it. Usually simple rules over data, best written as plain code.
Generic subdomain
A problem every business has, already solved well by others. Buying a product or using an open-source tool is almost always cheaper than your own model.

Applying the analysis

Ask what would happen without it
If losing it would end the company's advantage, it is core. If it would only be inconvenient, it is supporting. If a competitor's version would work just as well, it is generic.
Do not confuse hard with core
A messy integration or a complex report is hard, but hard is not an advantage. Many core subdomains are small, and many complex parts need only clear procedural code.
Buy generic subdomains
Custom login, a home-made scheduler or an in-house search engine starts as one week of work and becomes a cost forever. Put the bought product behind an interface so you can replace it.
Review the labels when strategy changes
Today's core becomes generic when vendors catch up, and a supporting area can become core when strategy shifts. Re-check when the business model changes, not only at the start.

Errores habituales

  • Every team calls its own part core, so nothing is
  • Building a generic subdomain because it looked like fun
  • Full tactical DDD on a simple supporting subdomain
  • Classifying once at kickoff and never again