APIs Are Not Just CRUD: Why Complex Systems Need Domain-Driven Architecture
by Eric Hanson, Backend Developer at Clean Systems Consulting
When someone says, “It’s just CRUD,” a backend engineer cringes. Creating, reading, updating, deleting—sounds simple, right? In practice, real systems involve multiple services, business rules, and asynchronous workflows. Suddenly, CRUD isn’t enough.
CRUD Only Covers the Surface
CRUD endpoints focus on data, not behavior. That’s fine for prototypes, but production systems do more.
- Multiple database queries per action.
- Integration with external services or APIs.
- Business rules that span entities or domains.
Treating APIs as just CRUD hides complexity that will surface later as bugs, performance issues, and brittle code.
Domains Organize Complexity
Domain-driven architecture encourages grouping logic around business domains instead of technical operations.
- Each domain owns its rules, workflows, and validations.
- Keeps controllers thin and focused on request/response handling.
- Makes it clear where to add new features without breaking unrelated parts of the system.
Domains turn APIs from arbitrary endpoints into meaningful, maintainable actions.
Side Effects and Asynchronous Workflows
Modern APIs rarely act in isolation. Actions often trigger other operations.
- Publishing events to message brokers or queues.
- Updating caches or notifying other services.
- Handling retries, errors, and fallbacks.
DDA isolates these side effects into dedicated layers or event handlers. Controllers and services stay predictable, while asynchronous logic remains organized.
Testing and Maintainability Benefits
Domain-driven architecture isn’t just about structure—it pays off in quality and speed.
- Unit tests can target domain logic without touching the network or database.
- Adding new endpoints often means extending a domain rather than rewriting everything.
- Scaling teams becomes easier because responsibilities are clearly defined.
When domains are well-isolated, systems evolve gracefully without creating spaghetti code.
Beyond CRUD, Towards Sustainable APIs
CRUD might be enough for a simple app, but real-world APIs need more. Domain-driven architecture provides a blueprint for handling rules, workflows, and side effects cleanly.
Think of APIs as contracts, not just database operations. Organize around domains, and complexity becomes manageable instead of chaotic.