𝗪𝗵𝘆 𝗜 𝗦𝘁𝗼𝗽𝗽𝗲𝗱 𝗪𝗿𝗶𝘁𝗶𝗻𝗴 𝗖𝗼𝗱𝗲 𝗮𝗻𝗱 𝗕𝗲𝗴𝗮𝗻 𝗗𝗲𝘀𝗶𝗴𝗻𝗶𝗻𝗴

I used to think software development meant writing features. I thought my job was to create entities, build controllers, and connect databases.

A recent project changed my perspective. I learned that coding is only one part of the solution. The real work happens before you write a single line of code.

You must decide on the architecture. You must ask why it fits, what it costs, and what risks it solves.

Here are my main lessons:

• Architecture must match the product stage. It is tempting to use microservices, Kubernetes, and complex event queues immediately. For our project, we chose a layered architecture in a single process. This allowed us to separate responsibilities without the headache of a distributed system. Simple is often better when you start.

• Some decisions are cheap now but expensive later. We added a TenantId to our data model from day one. Even though we only had one client, this made a future move to a SaaS model easy. If you wait too long to add multi-tenancy, the migration becomes a nightmare.

• Design prevents future dead ends. Programming solves an immediate problem. Designing solves a problem without closing doors to the future. We used containers early to make moving to different infrastructure easy. We used interfaces to make swapping providers simple.

• Business changes drive technical changes. A system moves to microservices because the business grows. A single clinic app becomes a SaaS platform for hundreds of clinics. This shift changes how you handle billing, subscriptions, and scaling.

• Reliability requires smart patterns. We moved from synchronous calls to event-driven architecture. In a medical system, a slow notification service should not crash an appointment booking. We used the Outbox pattern to ensure data stays safe even if the message broker fails.

• Patterns must fit the domain. Do not use patterns blindly. A medical diagnosis needs strong consistency. You cannot rely on eventual consistency for patient safety. Do not use cache for sensitive clinical data if it breaks your audit trail.

• DevOps is not an afterthought. Deployment, health checks, and pipelines are part of the initial design. You must estimate costs and choose components that actually serve your needs.

A diferença entre um programador e um designer é o "porquê".

Um programador pergunta: "Como faço isso funcionar?" Um designer pergunta: "Por que esta é a solução certa para este problema específico?"

Fonte: https://dev.to/santiagobrahim/lo-que-aprendi-cuando-deje-de-pensar-solo-en-codigo-y-empece-a-pensar-en-arquitectura-4fnm