Start by writing down what the system must do and the constraints it must respect, then shape candidate designs against those facts rather than against fashion. Building a system architecture is a decision process: capture requirements, sketch components and boundaries, define interfaces and data ownership, test the design on paper and in a small prototype, document the decisions, and plan how the system will evolve. The exact artifacts matter less than the order, because each step narrows the next. A solo project can finish the core loop in a few afternoons; a team-facing platform may take several weeks of iteration before the first build sprint.

The guidance below assumes you are the person responsible for the design, whether you are a single developer building a side project or a lead shaping a service that others will implement. It stays version-neutral and tool-neutral on purpose: specific frameworks and cloud products change faster than the principles.

Define what the architecture must satisfy before drawing anything

Architecture is the set of choices that are expensive to reverse. That definition is useful because it tells you where to spend effort. A database engine choice, a service boundary, a public API contract, and a data ownership rule are architecture. A logging library or a CSS framework usually is not, because swapping it costs hours, not quarters.

Before sketching boxes, produce a short requirements sheet with four parts.

Functional scope. List the handful of user journeys or system operations the design must support in its first meaningful release. Keep the list small. "Users upload a document, the system extracts text, stores it in a relational database, and returns search results in under a second for the first ten thousand documents" is a usable scope statement. "Build a document platform" is not.

Quality attributes with numbers. Vague goals produce vague designs. Attach a target and a measurement condition to each attribute you actually care about: expected concurrent users at peak, tolerable latency at the 95th percentile, acceptable data loss window, required uptime, and the recovery time after a failure. Where you cannot justify a number, state a range and label it an assumption. A design reviewed against "we think it should be fast" cannot be evaluated; one reviewed against "reads under 200 ms at p95 for 50 concurrent users on a single region" can.

Constraints. Budget, team skills, existing systems you must integrate with, regulatory or data-residency rules, licensing, and the deadline. Constraints are not obstacles to the design; they are half of it. A two-person team with no operations experience should not choose a design that requires a dedicated platform group, no matter how elegant the diagram.

Explicit non-goals. Write down what the first version will not do. This is the cheapest way to prevent scope from silently expanding the architecture. If multi-region failover is out of scope for the first release, say so, and record what would have to change later.

A useful check at the end of this step: hand the requirements sheet to someone who was not in the conversation and ask them to describe what success looks like. If their description matches yours, the sheet is specific enough to design against.

Map the domain, actors, and data before choosing technology

Most architecture failures are domain failures wearing technical clothes. Teams pick a message broker before they know which events matter, or split services before they know where the data's real boundaries are. Work domain-first.

Identify actors and external systems. Who or what initiates work: end users, scheduled jobs, partner APIs, devices, other internal services? For each, note the direction of the interaction and the data exchanged.

Identify the core entities and their lifecycles. For a billing system, that might be customer, subscription, invoice, payment attempt, and refund. For each entity, ask who owns it, what states it moves through, and which transitions must be atomic. Entities whose state changes together usually belong together in the design; entities with genuinely different change rates and owners are candidates for separation.

Trace the primary flows end to end. Write three to six sequences as numbered steps in plain prose, one per important journey. A flow like "customer submits order → inventory reserved → payment authorized → order confirmed → confirmation event emitted" reveals where consistency is required, where failures can occur, and how many systems are in the critical path. Flows also expose steps that look trivial in a diagram but are hard in practice, such as compensating a reservation when payment fails.

Classify the data. Separate transactional records that must be exact from derived data that can be recomputed (search indexes, caches, analytics aggregates). Note volume, growth rate, retention requirements, and sensitivity. This classification drives most later decisions about storage and consistency.

The success check here is concrete: every functional requirement from the first step should appear in at least one flow, and every entity in the flows should have a named owner and a described lifecycle. Gaps mean the requirements or the model is incomplete.

Choose a structural style on stated criteria, not on fashion

There is no universally correct architecture style. There are styles that fit your constraints and styles that do not. Compare the realistic candidates against the same criteria: team size and skills, deployment capacity, consistency needs, expected scale, and change cadence. The common options, honestly described:

Modular monolith. One deployable unit with enforced internal module boundaries. It gives you simple operations, straightforward transactions, and easy local development. Its failure mode is boundary erosion: without discipline, modules become entangled and the system becomes a big ball of mud. It suits small teams, early products, and domains where most operations are transactional and related.

Service-oriented or microservice architecture. Independently deployable services communicating over the network, each owning its data. It buys independent scaling and deployment and clear ownership, at the price of distributed transactions, network failure handling, observability overhead, and operational complexity. It suits organizations with multiple teams that need to ship independently, and domains with genuinely separable bounded contexts. It is a poor default for a solo developer, because you pay the distributed-systems tax without the team-scale benefit.

Event-driven architecture. Components communicate through events rather than direct calls. It decouples producers from consumers and handles asynchronous workflows well, but introduces eventual consistency, duplicate delivery, ordering questions, and harder debugging. It suits workflows with long-running steps and multiple downstream reactions, such as notifications, indexing, and audit trails.

Layered or hexagonal (ports and adapters) organization. A way of structuring code inside a deployable so that domain logic does not depend on frameworks, databases, or transport. This combines with any of the above; it is a discipline, not a deployment topology.

The comparison only becomes a decision when you write it down. A compact table with one row per candidate and one column per criterion forces the trade-off into the open:

Criterion Modular monolith Microservices Event-driven
Team fit Small team, shared codebase Multiple teams, independent ownership Any size, but needs event discipline
Operational load Low High Medium to high
Consistency Strong, local transactions Eventual across services Eventual by default
Change isolation Module-level discipline required Strong per service Strong per consumer
Main failure mode Boundary erosion Network and coordination failures Ordering and duplicate handling

Expect to combine styles: a modular monolith for the transactional core, with an event stream feeding search indexing, is a common and defensible shape. What matters is that each choice traces back to a criterion in your requirements sheet.

Define components, responsibilities, and interfaces

With a style chosen, draw the coarse structure. Keep the diagram at the level of responsibilities, not classes. A useful component has a one-sentence responsibility, an owner (a person or team), and a clear answer to "what does it not do?"

Set boundaries around change and ownership. A boundary is justified when the two sides change for different reasons, are owned by different people, or have materially different scaling or availability needs. If none of those hold, a boundary adds coordination cost for no benefit.

Specify interfaces before internals. For every interaction across a boundary, define the contract: the operation, the request and response shapes, error semantics, idempotency behavior, and timeout expectations. Write one or two real example payloads. Contracts surface mismatched assumptions early, when changes are cheap.

Assign data ownership explicitly. Each piece of data should have exactly one owning component that is authoritative for writes. Other components read through the owner's interface or through an explicitly derived copy. Shared databases with multiple writers are the most reliable way to create hidden coupling; treat them as a deliberate exception with a documented reason.

Decide the synchronous/asynchronous split. Use synchronous calls when the caller needs the answer to proceed and the latency budget allows it. Use asynchronous messaging when work is long-running, when multiple consumers react to the same fact, or when the producer should not fail because a consumer is down. Document delivery expectations: at-most-once, at-least-once with idempotent consumers, or exactly-once where the platform genuinely provides it.

The check for this step: take each interface and ask what happens when the callee is slow, returns an error, or is entirely unavailable. If no one at the design review can answer for a given boundary, that boundary is underspecified.

Walk through failures and verify the design on paper

A design that has only been described on its happy path is a sketch, not an architecture. Stress it deliberately.

Failure walkthroughs. For each critical flow, narrate what happens at each step when a component fails, a message is delivered twice, a call times out after the work actually succeeded, or a retry storm hits. Name the mitigation and where it lives. The goal is not to eliminate failure but to make each failure mode's consequence a conscious choice.

Numbers where they matter. Estimate the load each component must absorb: requests per second at peak, storage growth per month, message volume per day. Rough arithmetic is enough at this stage. If a flow assumes 100 requests per second and each request makes six downstream calls, the downstream services see roughly 600 calls per second, and that figure needs a sanity check against their design. Label these as estimates with their inputs, because they will change.

A small prototype for the riskiest assumption. Identify the single assumption that would invalidate the design if wrong, such as the database handling the required query pattern at the target volume, or the third-party API meeting its latency claim. Build the smallest experiment that tests that assumption, with realistic data volume where feasible. Prototypes are for retiring risk, not for proving you can write code.

A design review with a defined agenda. Present the requirements sheet, the flows, the boundaries, and the failure walkthroughs. Ask reviewers to attack specific decisions, not to redesign the whole system. Record which objections were accepted and which were rejected and why.

The success check: every critical flow has a documented failure story for its riskiest step, and every quantified assumption has either test evidence or an explicit label as an open assumption.

Document decisions so the architecture survives you

Documentation is not a deliverable separate from design; it is how the design remains usable after the meeting ends. Keep the artifact set small and load-bearing.

An architecture decision record per significant choice. Each record captures the context, the decision, the alternatives considered, and the consequences, including what would be required to reverse it. A page or two suffices. Records dated and appended over time become the memory of why the system looks the way it does.

One current architecture diagram, kept honest, showing components, responsibilities, data ownership, and the main synchronous and asynchronous interactions. Diagrams drift; assign an owner and a review cadence rather than letting them age silently.

The interface contracts and data model in a location implementers actually consult, such as the repository alongside the code. Contracts that live only in a slide will diverge from reality.

The open-questions list, with owners and dates. Unresolved items are legitimate at review time; unresolved items with no owner are how designs quietly fail.

The check: a new team member should be able to read the requirements sheet, the diagram, and the decision records and explain why the system is shaped as it is, without needing a meeting.

Plan evolution, operations, and the stop conditions

Architecture is never finished at the first release. Decide in advance how the design responds to change.

Identify the seams where growth will happen. Which components will need to scale first? Which boundaries are likely to split as the domain matures? Sequence the likely changes and note the trigger for each: "when write volume exceeds X, extract the notification handling into its own consumer" is more useful than a general commitment to scalability.

Design for operation from the start. Decide how the system will be deployed, observed, and recovered: what metrics and logs answer "is it healthy?" and "why did it fail?", how a deploy rolls back, and how backups are tested rather than merely taken. Operational requirements belong in the quality attributes from step one.

Name the stop conditions. Some work needs a specialist rather than more iteration. If the design touches regulated data handling, payment card processing, health information, or legally binding financial workflows, or if the failure walkthroughs reveal safety consequences you cannot confidently bound, stop and bring in qualified help in that specific domain before proceeding. Continuing to improvise in those areas is the expensive mistake.

The check for this stage: for each foreseeable growth event, there is a documented trigger and a plan, and for each area outside your competence, there is a named point of escalation.

A final note on sequencing, since the steps above have a strict order. Requirements and domain flows must come before structural choices, because the structure is a response to them. Interface definition comes before implementation, because contracts are cheap to change early and expensive later. Failure analysis and the prototype come before the review, so the review has evidence to weigh. Documentation runs alongside the whole process rather than at the end. If you follow only the order and not the artifacts, you will still make better decisions than starting from the diagram.