All articles

How to Choose Software Architecture

An engineering guide to choosing software architecture: compare major approaches, selection criteria, trade-offs, and validation methods through a hypothetical order management system.

An order management system needs to list products, reserve inventory, process payments, and send notifications. These responsibilities can run within one application or be distributed across separate services. However, changing an inventory rule, investigating a failed payment, or handling heavy traffic carries a different cost in each design.

Choosing an architecture starts by examining these differences. Which rules must be preserved together? Which parts should be able to change independently? What should happen when an external service does not respond? Can the team continue developing and operating the system it builds?

An appropriate architecture meets the important requirements and has a clear justification for the complexity it introduces. Choosing one therefore involves more than adopting an architectural label. Code organization, service boundaries, data ownership, and the runtime environment must be considered separately.

This guide connects the major approaches to those decisions and compares how they work, when they are appropriate, and what they cost. Its main example is a hypothetical order management system. Other examples and numerical targets are also design scenarios; they are not presented as measured project outcomes or claims of personal implementation experience.

What Is Software Architecture?

Software architecture encompasses the system's significant responsibilities, components, their relationships, and the fundamental decisions made to meet quality requirements. Properties such as performance, security, modifiability, and availability are central to evaluating those decisions. [31]

For example, calculating prices, reserving inventory, and collecting payments are different responsibilities. Placing them in separate classes is a starting point. The architectural questions are where the rules are enforced, who is allowed to modify the data, and which parts are affected by a change.

Dependencies are not limited to calls between pieces of code. A shared table schema, a message format, or a mandatory deployment order can also couple components. If two services running on different servers must be deployed together for every change, their intended independence remains limited. [12]

Grouping architectural concepts around the following questions makes comparison easier. The grouping shows which decision each approach primarily helps address; it is not an attempt to confine every concept to a single category.

  • Code organization — Key question: How are business rules and dependencies organized? Relevant approaches: Layered, Clean, Hexagonal, Onion

  • Application boundaries — Key question: Which parts are deployed together, and which separately? Relevant approaches: Monolith, modular monolith, service-based architecture, microservices

  • Communication and flow — Key question: How do components communicate, and how does work proceed? Relevant approaches: Client–server, P2P, event-driven architecture, Pipes and Filters, Web–Queue–Worker

  • Extensibility — Key question: How are new capabilities added to the core? Relevant approaches: Microkernel and plugins

  • Data management — Key question: How is information shared, processed, and stored? Relevant approaches: Repository, Blackboard, Space-Based; CQRS and Event Sourcing patterns

  • Execution model — Key question: Who is responsible for infrastructure and capacity management? Relevant approaches: Serverless, managed platforms, virtual machines

Logical code organization must also be distinguished from physical deployment. A layer represents a level of responsibility, whereas a tier represents a physical separation in the runtime or deployment environment. Presentation, business logic, and data access layers can all run in the same process. Moving each layer to a separate server adds network communication and new failure modes. [2]

Similarly, a module does not have to be a separate service. Clean Architecture and microservices answer different questions: one organizes source-code dependencies; the other focuses on the application's service boundaries. Clean Architecture can be applied within a microservice.

Architecture Selection Criteria

First, determine what the system must do, the conditions in which it must operate, and the failures it cannot tolerate. The number of screens or users is not enough on its own. A small number of screens can conceal complex business rules, while many screens may consist of similar record-management operations.

Scope and expected change indicate which boundaries will be valuable. Adding another payment provider, developing with multiple teams, integrating with existing enterprise systems, or supporting offline operation may be concrete needs. Distinguish confirmed requirements from possibilities. A clear integration contract makes sense for a planned second payment provider; the cost of building a comprehensive plugin platform for an uncertain future needs separate justification.

Data correctness determines which operations must be protected together. Available inventory must not become negative, retrying the same payment attempt must not charge the customer again, and order statuses must change according to defined rules.

For example, reading an inventory quantity and then decrementing it may be insufficient under concurrent requests: two requests may both regard the last available item as available. A transaction defines a boundary within which related database changes are committed together or rolled back, but it does not enforce every business rule on its own. Queries, isolation levels, and mechanisms such as conditional updates, locking, or version checks must be designed together. [32]

Security boundaries cover permissions to access data and execute operations. A user or order identifier supplied by a client does not grant permission to access that resource. Authorization must be enforced on the server for the operation concerned. If the application is split into services, service identities and inter-service access must also be included in this design. [33]

Quality goals must be measurable. Saying that a system should be “fast and scalable” is insufficient for comparing two designs. Scenarios should specify the expected workload, data volume, operating conditions, and acceptable outcome. [31]

  • Product-search p95 latency must not exceed 300 ms under a defined load: Queries, indexes, read models, and caching requirements

  • Notification jobs must survive a restart after an order is accepted: Durable job records, delivery, and reprocessing

  • Reports may lag by a few seconds: An asynchronously updated read model

  • Order acceptance must continue when the notification service is down: Call dependencies, queues, and resource boundaries

The p95 value is the threshold below which approximately 95% of measured durations fall. An average can conceal slow requests. Latency measurements should be evaluated alongside error rates, data volume, and load conditions. [34]

Team capacity and total cost also matter. Deploying services independently may provide benefits, but it creates deployment pipelines, access configurations, monitoring, and incident-response responsibilities. Cost includes not only infrastructure bills but also the effort required for development, testing, maintenance, and coordination.

Separating components before identifying the bottleneck can be misleading. Splitting an application into services does not automatically make a slow database query faster. If report generation alone consumes substantial resources, separating that workload may be worth considering without changing the deployment model of the entire application.

Major Architectural Approaches

When examining an approach, it helps to ask the same question each time: What problem does this design solve, and what responsibilities does it introduce in return?

Code and Business Rules

Layered architecture separates responsibilities such as presentation, business logic, and data access. For example, the code handling an HTTP request receives the input, business logic applies the operation's rules, and the data access component reads or writes records. It offers an understandable starting point for business applications with clearly defined responsibilities. [1] [2]

Layers are valuable because they can limit the impact of change. Layers that merely pass the same data back and forth may instead introduce unnecessary files and transformations for every feature. If business rules spread into UI screens or data access code, the separation is weak even if the layers have the right names. Layering does not require dependencies to point toward the database; contracts can be defined inward, reversing the dependency direction.

Clean, Hexagonal, and Onion architectures are substantially overlapping approaches focused on protecting business rules from external technical details. Their differences become clearer after considering their shared purpose:

  • Clean Architecture requires source-code dependencies to point inward toward business rules and use cases. A use case coordinates the steps of an operation; domain rules define business behavior. Database, web framework, and external-service details are adapted to this inner structure. [3]

  • Hexagonal Architecture, also known as Ports and Adapters, emphasizes the application's boundaries with external interactions. A port is a contract for behavior the application provides or needs; an adapter connects that contract to HTTP, a database, or another technology. The same application behavior can be exercised through a web interface, a batch process, or a test. [4]

  • Onion Architecture places the domain model at the center: dependencies point inward, and infrastructure details remain outside. The aim is to preserve rules such as discount eligibility and order-status transitions without tying them to data access or UI technologies. This central model can be valuable in applications with rich business behavior. [5]

A payment integration illustrates their shared idea. An “approve order” use case can depend on an internally defined IPaymentGateway contract rather than using the provider SDK's types directly. A provider adapter implements the contract. At runtime, the use case invokes the adapter; in the source code, however, the dependency points from the adapter toward the inner contract.

This boundary makes it easier to test business rules independently of a provider and connect different integrations to the same behavior. In return, contracts, data mappings, and abstractions must be maintained. Simple record-management operations may not need the same degree of separation. A prescribed number of folders, a particular library, or an interface for every class is not a requirement of these approaches. Abstracting data access also does not eliminate every cost of changing databases. [3] [4] [5]

Domain-Driven Design (DDD) helps teams understand a complex business domain through shared language and models developed with domain experts. A Bounded Context is the boundary within which a model applies. A “customer” might mean the person placing an order in sales, but the person associated with requests and conversations in customer support. Those models can legitimately differ, and each context does not need its own microservice. Detailed domain modeling offers value for complex rules, but may provide less benefit in a simple CRUD application. [6]

MVC, MVP, and MVVM organize presentation and user-interaction responsibilities. In MVC (Model–View–Controller), the controller handles user input and relevant interactions. In MVP (Model–View–Presenter), the presenter manages the interaction between the view and the model. In MVVM (Model–View–ViewModel), the viewmodel exposes the state and actions needed by the view; data-binding mechanisms vary by platform. These patterns do not determine the entire system's deployment model: a mobile application using MVVM can communicate with a modular monolith backend. [7] [8]

Modules and Services

A monolith is an application unit whose core behavior generally runs in one process and is deployed together. It can contain multiple layers, modules, and libraries. Horizontal scaling is also possible by running several instances of the same application. [1]

For functionality that evolves together, in-process calls and a single deployment unit make coordination easier. Consistency can be managed more directly when an operation fits within one local database transaction. In return, a change to one part joins the common release; if only a small area requires heavy resources, replicating the entire application may be inefficient.

A modular monolith preserves that deployment model while making each module's external contract and internal details explicit. Rather than directly changing inventory tables, the order module requests inventory reservation through the inventory module's contract. Data ownership and access rules can be defined even when modules share one database. Creating folders alone does not prove those boundaries are enforced. [9]

This is a strong candidate for teams seeking the operational simplicity of one application while limiting the spread of changes. However, module boundaries must be maintained during development. Modules still share process resources and a release cycle. The cost of extracting a module into a service later also depends on data and transaction dependencies; modularity does not guarantee an inexpensive transition.

Service-based architecture is used here in Richards and Ford's sense of Service-Based Architecture: a system is divided into a relatively small number of separately deployable services covering broad business capabilities, with a shared database as one possible choice. Commerce, reporting, and customer communication, for example, could run separately. [10]

This separation can allow selected areas to be deployed or scaled independently. It also introduces network communication and separate operational responsibilities. If services share a schema, changes may affect more than one service. Having few services does not by itself mean their boundaries are well designed.

Microservices architecture aims for independently deployable services bounded around business capabilities. Each service has clear responsibility for its own behavior and data. Line count or the smallest possible service is not the defining criterion. Separate team release schedules and different scaling requirements can make this approach valuable. [12]

For example, product search and payment might be managed separately if their workloads and change patterns differ. In return, network failures, timeouts, contract versions, distributed consistency, and observability must be designed for. Frequent synchronous calls and constant co-deployment can signal poorly chosen boundaries.

Data ownership does not require a separate physical database server for every service. However, directly reading or modifying another service's internal tables creates a dependency on its schema. Running in separate processes does not, by itself, prevent failures from propagating; synchronous dependencies and shared resources must also be considered. [39]

SOA (Service-Oriented Architecture) is a broader approach to exposing and consuming capabilities through services, potentially across different ownership domains. Service contracts, semantics, access conditions, and policies matter. Integrating existing customer, accounting, and logistics systems is an appropriate example. [11]

The purpose of SOA is not limited to splitting one application into pieces; it also encompasses integrating the capabilities of different systems. Supporting reuse of shared capabilities introduces the costs of aligning data semantics, managing contracts, and coordinating across an organization. Neither an ESB nor SOAP is mandatory. There is no sharp boundary between SOA and microservices based solely on service size.

Communication and Workflows

In a client–server arrangement, the client requests a service and the server evaluates the request and responds. A web or mobile application connecting to an API is a familiar example. This arrangement allows the interface and service to evolve separately while common business rules are managed on the server. The server side may contain a monolith or multiple services. [13]

Network latency and disconnections affect user-facing behavior. Not receiving a response does not mean that the operation never happened on the server. Retry and result-query behavior must be designed, especially for operations that modify data.

In P2P (Peer-to-Peer) systems, nodes may act both as consumers and providers of resources. Some applications also have central components for discovery or coordination. Distributing large files in pieces among participants is an example where resource sharing provides direct value. [14]

The trade-offs include variable connectivity, unreachable nodes, network traversal constraints, untrusted participants, and data integrity concerns. In an application where one organization manages orders and customer state, these costs may be unnecessary if distributing the workload among participants provides no concrete benefit.

Event-driven architecture communicates facts about states that have occurred and allows interested consumers to respond. “Order approved” is an event; “collect payment” is a command specifying work to be done. Not every queue message is an event. [15] [36]

Notifications and reporting can run separately when an order is approved. The producer does not need to know the internal implementation of every consumer, and consumers can proceed at their own pace. In return, delivery, ordering, reprocessing, and the meaning of delayed data must be defined. Requiring events for the same order to be processed in sequence is much less demanding than requiring one global order for the entire system.

Event schemas are contracts too. Changing the meaning of a field affects consumers, and introducing a queue does not remove this dependency. An in-process event call and an event delivered through durable messaging infrastructure also have different reliability characteristics. [15]

Pipes and Filters divides processing into stages with defined inputs and outputs. For example, a supplier file can be parsed, validated, normalized, and transformed into product records. Stages may run in one process or in separate components, and suitable stages can be reused in other pipelines. [16]

This approach is useful when a transformation naturally breaks into stages. Intermediate data formats, recovery points after failure, and slow stages must be managed. The order of stages should change only when data dependencies and business meaning allow it. Queues can absorb temporary bursts, but if incoming work consistently exceeds capacity, input rate limiting or backpressure is needed to slow producers.

Web–Queue–Worker is an arrangement in which the web/API layer accepts work, a queue transfers it, and a worker processes it in the background. It is suited to long-running tasks such as report or document generation; web and worker capacity can be managed separately. The user is given a job identifier and its status. A fast initial response does not mean the overall job finishes sooner. [17]

Reliability in this flow starts before a job is placed on the queue. If the API updates the database but stops before sending a message, part of the work may be missing. The Transactional Outbox pattern stores business data and a record of the outgoing message in the same local transaction. A separate publisher forwards the message record to the queue after the database transaction succeeds. This protects the data change and the intention to publish the message together; actual delivery still depends on the publisher running. Duplicate publication remains possible. [18]

Idempotency means repeating the same operation produces no additional business effect. A consumer can store a message's stable identifier in a processing record. If the business data and processing record can share a transaction boundary, they can be written together; concurrent duplicates can be blocked with a uniqueness constraint or a similar mechanism. External payment or email calls do not participate in this local atomicity. Also, a correlation ID that relates an entire operation chain may not be unique to every message in that chain, so the deduplication key must be chosen accordingly. [42]

Plugin Architecture

At the application level, a microkernel allows a stable core to gain new capabilities through defined extension points. This is a different use of the term from an operating system microkernel. Eclipse's plugin and extension-point model is a concrete example. [19]

For example, a document-processing product might keep the common workflow in its core while supporting different output formats or customer integrations through plugins. When the basic behavior remains stable but the options vary, plugins can reduce the need to change the core for every new capability.

This flexibility brings responsibilities for versioning plugin contracts, checking compatibility, controlling loading behavior, and handling failures. If the core changes constantly, plugins may need frequent updates too. Building a full plugin infrastructure may be unnecessary for an application with only a few fixed options.

A plugin running in the same process does not automatically provide security or failure isolation. For untrusted code, separate processes and permission boundaries should be considered. Having a payment adapter also does not imply that an application needs an entire plugin platform.

Data Management

Data design involves three different questions: How do components access shared information? Where is processing applied to the data? How are the current state and change history stored?

Repository Architecture is an arrangement in which multiple components read and update a shared data store or data structure. For example, a code analysis tool's parser, dependency analyzer, and reporting component may work against the same project model. The repository is a logical center; it need not be a single physical server. [20]

This approach is useful when multiple tools process a rich body of shared information. Changes to a common schema can propagate across many components, however, and concurrency and capacity must be managed together. The architectural concept here is not the same as the Repository Pattern, which abstracts access to domain objects behind a collection-like interface. [21]

Blackboard is a problem-solving arrangement in which different specialist components refine a shared workspace with partial results. A control mechanism decides which specialist should act based on the available findings. In industrial fault assessment, for example, vibration evidence might guide the analysis of temperature and maintenance history. [22]

It is valuable when a fixed processing sequence is insufficient and different forms of expertise contribute to a solution. However, evaluating conflicting findings, deciding the next specialist to run, and determining when the solution is complete become harder. Its similarity to Repository Architecture is the shared data; its distinguishing feature is specialist contributions driven by the state of that data. Simply allowing several modules to write to the same database does not create a Blackboard architecture.

Space-Based Architecture partitions data across distributed in-memory spaces and brings relevant processing logic closer to the data. In GigaSpaces implementations, data and related services may be colocated in the same processing unit. The goal is to reduce pressure on centralized data access and minimize data movement under suitable workloads. [23]

Processing many game sessions in separate partitions based on session identifiers is one example. The benefit increases when most work accesses data within its own partition. Operations that continually access other partitions can diminish this advantage.

RAM capacity, uneven partition loads, rebalancing, and durability introduce further costs. In-memory processing does not eliminate the need for persistence. With asynchronous replication, recent changes can be lost if the source node fails before forwarding them to its replica; actual durability depends on the chosen persistence and replication arrangements. Adding a cache alone does not make a system space-based. [24] [25]

CQRS and Event Sourcing organize different decisions about data. CQRS separates read and write models, whereas Event Sourcing makes the event history the durable source of state. Neither requires the other. [26] [27]

With CQRS (Command Query Responsibility Segregation), the write model focuses on business rules, while the read model focuses on the needs of a screen or report. Creating an order may enforce stock and pricing rules, while an administrative screen can use a simple model combining the customer name, amount, and status. Separate databases or a message queue are not mandatory; the models can share one data store. [26]

This pattern is useful when reading and writing have clearly different needs, but it adds models and transformations. An asynchronously updated read side may lag behind. The stock quantity shown on a screen does not guarantee that an order can be accepted; the write side must check the current conditions when performing the operation. For simple CRUD—create, read, update, and delete—this extra separation may be unnecessary.

With Event Sourcing, the durable source of truth for a business area is a stream of change events. An order's state can be derived from events such as order creation, item addition, and cancellation. The approach makes sense when the history itself has value or when different read views need to be rebuilt. [27]

Event-schema evolution, concurrent writes, replay duration, and the correctness of derived views must be managed separately. A snapshot records the state at a particular point in the stream and can reduce recomputation by requiring only later events to be processed. It does not replace the original event stream. Replaying events must not trigger external effects such as payments or emails again.

Event Sourcing is not merely publishing events or keeping an audit log. It changes how durable state is represented, so it should not become the default choice for ordinary history-tracking requirements.

Serverless and the Execution Model

Serverless delegates much of server provisioning and infrastructure capacity management to a provider. Function-execution services are one form of it; the concept is not limited to a single function product. Responsibility for application code, data, access control, and cost remains. [28]

Generating a preview from an uploaded image or preparing a notification from an order event can run in managed functions. This choice does not require the order-processing core to be a monolith or a microservice.

For infrequent and variable workloads, serverless may reduce the cost of unused capacity. On the other hand, preparing a new execution environment can create startup latency. Execution time, concurrency, resource, and scaling limits differ by provider and service. Durable job state must not depend on the assumption that a temporary execution environment will still exist on the next invocation. [29] [30] [38]

Cost accounting must include storage, messaging, data transfer, observability, and any provisioned capacity—not just function execution. Continuous heavy load or strict latency targets require measurement against alternatives. Provider-specific integrations also affect migration cost. Automatic scaling does not guarantee that connected databases or external services can increase capacity at the same rate.

The Architecture Selection Process

Example: An Order Management System

Consider an application with orders, inventory, payments, and notifications. Suppose our hypothetical product is developed by one team, the order and inventory rules change together, and report generation can finish independently of the user's response.

Under these conditions, we can compare the options as follows:

  • Modular monolith: Benefit: Manage order and inventory rules together within explicit module boundaries. Cost: A shared release cycle and process resources.

  • Coarse-grained services: Benefit: Deploy or scale commerce, reporting, and communication independently. Cost: Network communication, separate operations, and coordination of a shared schema if present.

  • Microservices: Benefit: Manage well-defined business areas through independent teams, data ownership, and release cycles. Cost: Distributed consistency, contract compatibility, and greater operational responsibility.

A modular monolith is a reasonable starting candidate under the stated conditions. Heavy reporting work can be moved to a separate worker, isolating only the work that benefits from independent execution. If teams, workload profiles, or security boundaries diverge later, extracting a service can be reconsidered. This conclusion is an engineering judgment specific to the example's assumptions.

The design's boundaries become visible during failures as well as successful operations. Recording an order and reserving inventory can be completed together within an appropriate transaction in the same database. A call to an external payment provider, however, does not automatically participate in that local atomicity—even when the application is a monolith.

In a workflow distributed across services, inventory may be reserved, payment attempted, and the order completed after the outcome is verified. On failure, the system may need to release the inventory or refund a collected payment. A Saga coordinates local transactions and compensating actions where necessary. Compensation does not rewind history like a database rollback; a refund is a new operation that can fail in its own right. The flow may be managed by a coordinator or by participants reacting to events. As complexity grows, tracking the process state becomes increasingly important. [36]

If a payment request times out, its outcome may remain unknown. The provider might have collected the payment even though the response was lost. The result of the original attempt should be established through the provider's supported status queries, safe retries using the same idempotency key and parameters, notifications, or reconciliation mechanisms. Do not initiate an uncontrolled new charge while the outcome remains uncertain. Retry windows and guarantees must be evaluated against the provider's current contract. [41]

The selected design may combine different approaches for distinct purposes:

  • Modular monolith: Keeps order and inventory boundaries within one application.

  • Clean or Hexagonal principles: Separate payment integrations and data access from business rules.

  • Client–server: Connects web and mobile clients to the application's API.

  • Web–Queue–Worker: Handles report and document generation in the background.

  • Event-driven communication: Propagates appropriate state changes to notifications and reporting.

  • CQRS where needed: Applies in areas where read requirements clearly differ from the transaction model.

Each approach has its own justification in this combination. Not every module needs the same level of architectural detail: a simple reference-data screen and a complex pricing workflow may warrant different designs.

Validating and Recording the Decision

When comparing alternatives, first establish the non-negotiable conditions. If data correctness or a mandatory security boundary is not satisfied, low infrastructure cost does not make the option acceptable. For candidates that pass this threshold, evaluate benefits and costs together.

A practical decision process can proceed in this order:

  1. Write down the business rules and constraints. Which data must remain consistent together, which integrations are mandatory, and which outages are unacceptable?

  2. Make quality goals concrete. Define the workload, data volume, latency, and behavior under failure.

  3. Identify a small set of viable candidates. State which need each candidate addresses and which additional responsibilities it introduces.

  4. Test the most important uncertainty. Use realistic data to examine query latency, the resource consumption of a heavy workload, or the failure behavior of a critical integration.

  5. Compare the total cost. Consider development, deployment, testing, incident diagnosis, and team coordination.

  6. Record the decision and its conditions for change. What assumption would have to become invalid for the design to be reconsidered?

The goal is not to model the entire future, but to reduce the most important uncertainty before making an expensive decision. Keep experimental results tied to their measurement conditions: a query that runs quickly against a small dataset does not prove its performance at the target data volume.

A short Architecture Decision Record (ADR) can capture the context, decision, status, and positive and negative consequences. This makes it possible to understand not only what was done later, but why it was chosen. [35]

The decision record for our example could be summarized as follows:

  • Context: One team; order and inventory rules that evolve together; heavy reports that can be separated from the request–response path.

  • Decision: A modular commerce core with a report worker operating through a queue.

  • Accepted consequences: The core is deployed together. The worker requires separate delivery, reprocessing, and failure tracking.

  • Conditions for reconsideration: Evaluate extracting the relevant module if measured resource problems, independent team or release requirements, or different security boundaries emerge.

An ADR does not freeze the architecture. It keeps the earlier reasoning and accepted costs visible when changes become necessary.

Testing, Deployment, and Maintenance

Testing and Deployment

Architectural boundaries must be enforced during implementation. A decision such as “other modules cannot access the inventory module's internals” can be tested through dependency checks. Tools that distinguish a module's external contracts from its internal implementation can support these checks. [9]

Every test should correspond to the claim it verifies. A unit test of a business rule does not prove that concurrent writes are safe in a real database. A scenario passing with a fake payment adapter does not verify the provider's timeout and repeated-notification behavior.

The following scenarios are particularly valuable in our order-management example:

  • Two concurrent orders for the last available item: The defined inventory rule is enforced, and the rejected operation receives a clear result.

  • Redelivery of the same message: No additional business effect occurs.

  • Worker stops during processing: The job can be safely resumed or reconsidered according to its durable state.

  • Payment response is lost: The uncertain outcome is reconciled; no uncontrolled new charge is initiated.

  • An older consumer works with a newer producer: Compatibility with the supported message contract is preserved.

CI (Continuous Integration) supports frequent integration of changes through automated builds and tests. Continuous Delivery keeps verified software in a state where it can be released on demand. Continuous Deployment automatically sends changes that pass the checks into production. A single application deployed together and independently deployed services require different forms of release coordination. [40]

A deployment plan must address application code, database schemas, and message contracts together. Gradual transitions may be necessary—for example, adding a backward-compatible field first, deploying the new code, and removing the old field later. Reverting to the previous application package does not automatically restore the schema or the data to their earlier state; rollback or forward-fix plans must account for this. [37]

Monitoring and Reassessment

Monitor latency, traffic, error rates, and resource saturation in production. These are fundamental indicators for understanding capacity and user-visible problems. In queued workflows, the number of pending jobs, the age of the oldest job, and retry behavior also matter. [34]

An API responding successfully does not, by itself, show that the order workflow is healthy. Paid but incomplete orders or delayed notifications require monitoring business outcomes alongside technical metrics. Correlation identifiers carried between components make it easier to bring together records belonging to the same workflow.

Transient failures should be retried at appropriate intervals and only a limited number of times. Permanently failing jobs can be moved to a separate failure flow rather than being returned indefinitely to the same queue. The state of reprocessing and the person responsible should be explicit. Not every error should be retried; aggressive retries can increase load on an already failing service. [43] [15]

Maintenance responsibility is part of the design: Who will investigate an alert? Who will reprocess a failed job? Which measurements will trigger a capacity change? Expectations for data loss and recovery must also be defined. Restarting a process does not mean its business data has returned intact and is usable.

Monitoring and development experience provide evidence for decisions to change the architecture. The following developments may justify reconsideration:

  • One module grows at a different rate and shared resource usage creates measurable problems.

  • Separate teams repeatedly have to wait for each other's deployments.

  • New security or data-residency requirements call for different boundaries.

  • Small changes unexpectedly propagate across many modules or services.

  • The cost of operating services and resolving failures outweighs the independence they provide.

These signs do not automatically mean “more services.” Investigate the actual cause first. A slow query may call for a different index or data model; a heavy job may need dedicated resources. Two services that constantly change together may be candidates for merging. If an extracted module still accesses the internal tables of other components, the dependency has merely moved to the other side of the network. [39]

By the end of the architecture-selection process, these questions should be answerable: Where is each rule enforced? Which part can change independently? What happens on failure? What does it cost to operate this arrangement? Architectural labels are useful only insofar as they help explain those answers.

An architectural decision is complete when its rationale, accepted costs, and validation method are documented. As needs change, what should endure is not the original diagram but a decision-making process capable of evaluating new conditions with the same clarity.

Further Reading

To explore Clean Architecture in greater depth, including its dependency rules, layered structure, practical .NET examples, and when it makes sense to use it, read What Is Clean Architecture, and When Should You Use It?.

References

1. Microsoft — Common web application architectures

2. Microsoft — N-tier architecture style

3. Robert C. Martin — The Clean Architecture

4. Alistair Cockburn — Hexagonal architecture — original article

5. Jeffrey Palermo — The Onion Architecture — part 1

6. Martin Fowler — Bounded Context

7. Martin Fowler — GUI Architectures

8. Microsoft — Model-View-ViewModel

9. Spring — Spring Modulith — Fundamentals

10. Mark Richards and Neal Ford — Fundamentals of Software Architecture — Service-Based Architecture Style

11. OASIS — Reference Model for Service Oriented Architecture 1.0

12. James Lewis and Martin Fowler — Microservices

13. Roy Fielding — Architectural Styles — Client-Server

14. IAB / RFC Editor — RFC 5694 — Peer-to-Peer Architecture

15. Microsoft — Event-Driven Architecture Style

16. Microsoft — Pipes and Filters pattern

17. Microsoft — Web-Queue-Worker Architecture Style

18. AWS — Transactional outbox pattern

19. Eclipse — The runtime plug-in model

20. David Garlan and Mary Shaw — An Introduction to Software Architecture

21. Edward Hieatt and Rob Mee — Repository

22. John W. McManus / NASA — Design and Analysis Tools for Concurrent Blackboard Systems

23. GigaSpaces — Space-Based Architecture

24. GigaSpaces — In-Memory Data Grid Layer

25. GigaSpaces — Replication

26. Microsoft — CQRS Pattern

27. Microsoft — Event Sourcing Pattern

28. AWS — What is AWS Lambda?

29. AWS — Lambda execution environment lifecycle

30. AWS — Lambda quotas

31. Carnegie Mellon SEI — Quality Attribute Workshop Collection

32. PostgreSQL — Transaction Isolation

33. OWASP — Authorization Cheat Sheet

34. Google SRE — Monitoring Distributed Systems

35. Michael Nygard — Documenting Architecture Decisions

36. Microsoft — Saga distributed transactions pattern

37. Microsoft — Safe deployment practices

38. AWS — Designing Lambda applications

39. Microsoft — Data considerations for microservices

40. Martin Fowler — Continuous Delivery

41. Stripe — Advanced error handling

42. Microsoft — Idempotent Consumer pattern

43. Microsoft — Retry pattern