ld.← ALL FIELD NOTESSELECTED WORK ↗
FIELD NOTES / 22BACKEND ARCHITECTURE   ·   ENGINEERING PRACTICE

The practical value of predictable layers.

I once thought a strict controller–service–repository structure was too much for a small team. Growth changed my mind.

Know where to look

As we added services and developers, a consistent structure made production issues easier to navigate: request validation and response handling at the controller, business rules in the service, and data access in the repository.

The benefit is predictability. A familiar boundary gives the next engineer a starting point instead of making every service a new puzzle.

THREE RESPONSIBILITIES
CONTROLLERRequests & responses
SERVICEBusiness rules
REPOSITORYData access

Structure has a cost

The same layers can slow down a short-lived experiment. We try to be honest about the phase: keep prototypes lightweight, then add the structure a production feature needs.

The discipline is also social. If shortcuts repeatedly cross boundaries and reviews do not catch them, the pattern stops being a reliable guide. Consistency depends on the team, not just the folder names.

Continue the conversation

KEEP READING / 21A dead-letter queue is a signal, not a solution.

Another note from the notebook.