{
  "id": "software-architecture",
  "title": "Software Architecture",
  "lang": "en",
  "source_lang": "en",
  "summary": "Software architecture describes a software system’s fundamental structures, their relationships, and the principles governing its design and evolution.",
  "category": "computer-science",
  "subcategory": "software",
  "type": "concept",
  "aliases": [
    "Software system architecture"
  ],
  "generated_at": "2026-11-03",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/software-architecture/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/software-architecture/",
      "json": "https://aiwiki.page/zh/software-architecture.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "Software architecture is the organization of a software system into significant elements, the relationships among those elements, and the principles that guide their construction and evolution. It concerns structures that allow a system to satisfy its purposes: how responsibilities are divided, how information moves, where computation takes place, and how changes or failures propagate. In software engineering, architecture connects stakeholder needs and constraints to an implementable technical organization.\n\nArchitecture is not simply a diagram, a technology stack, or a list of frameworks. It includes decisions expressed in interfaces, dependencies, data ownership, deployment boundaries, operational policies, and assumptions about the surrounding environment. Every substantial software system has an architecture, whether deliberately designed or accumulated through successive modifications. An architectural description represents selected aspects of that architecture; it is not the architecture itself.\n\nArchitectural choices influence performance, security, reliability, maintainability, development coordination, and cost. A system organized for rapid local computation may be difficult to distribute; one optimized for independent deployment may require more complicated failure handling and data management. The subject therefore encompasses both technical structures and the reasoning used to choose, communicate, evaluate, and revise them."
    },
    {
      "heading": "Foundations and historical development",
      "text": "Software architecture emerged from earlier work on program organization, modularity, and the management of complexity. During the 1960s and 1970s, increasing software size made it difficult to understand systems solely as sequences of instructions. Edsger Dijkstra’s 1968 description of the THE multiprogramming system demonstrated a disciplined hierarchical organization in which higher layers depended on services provided by lower ones. David Parnas’s 1972 paper on criteria for decomposing systems into modules argued that modules should conceal design decisions likely to change, rather than merely correspond to processing steps. This principle, known as information hiding, remains central to architectural boundary design.\n\nArchitecture became a more explicit research field in the late 1980s and 1990s. Work associated with Mary Shaw, David Garlan, and other researchers distinguished recurring system organizations from the details of individual programs. Their 1996 book, Software Architecture: Perspectives on an Emerging Discipline, helped consolidate a vocabulary of components, connectors, configurations, and architectural styles. The emphasis shifted from treating a system as a collection of procedures or classes to studying its larger-scale organization and the properties that organization enables or constrains.\n\nStandards subsequently formalized architecture description. IEEE 1471, published in 2000, established a framework centered on systems, stakeholders, concerns, views, and viewpoints. ISO/IEC/IEEE 42010:2011 developed this framework further. Its conception of architecture includes the fundamental concepts or properties of a system in its environment, embodied in elements, relationships, and principles of design and evolution. This formulation is broader than the arrangement of source files: operational context, external dependencies, and governing assumptions may all matter.\n\nThere is no universal size threshold that separates architectural decisions from ordinary design decisions. A choice is architecturally significant when it has substantial consequences for system-wide properties, constrains many subsequent decisions, or is expensive to reverse. Selecting a database consistency model can be architectural, while selecting a local variable name ordinarily is not. Yet scale alone is insufficient: a small authentication component can be architecturally critical because every request crosses its boundary. Architecture and detailed design therefore form overlapping levels of reasoning rather than strictly separate phases.\n\nArchitectural practice also differs from instruction set architecture, which specifies the interface between machine software and a processor, and from enterprise architecture, which addresses broader relationships among organizational capabilities, information, processes, and technology. These subjects interact, but software architecture focuses on the structures and decisions governing software-intensive systems."
    },
    {
      "heading": "Elements, interfaces, and structural relationships",
      "text": "A software system can be examined through several distinct structural decompositions. A module structure describes implementation units and their dependencies: packages, libraries, subsystems, or other units of responsibility. A runtime structure describes executing elements such as processes, services, threads, and their interactions. An allocation structure maps software onto its environment, including machines, containers, development teams, or deployment locations. These structures are related but not interchangeable. A single module may execute in many process instances, while one process may contain code from numerous modules.\n\nArchitectural elements are defined partly by what they are responsible for and partly by the contracts through which they interact. An application programming interface may specify operations, input and output types, error conditions, and compatibility rules. A complete interaction contract may also specify ordering, deadlines, authentication requirements, and whether repeating a request is safe. An interface that documents only message syntax leaves important architectural behavior unspecified. For example, a payment operation needs rules for retries and duplicate requests, not merely a schema containing an amount and an account identifier.\n\nDependencies determine how change propagates. If a user-interface module directly depends on a particular storage engine, replacing that engine may require changes throughout the interface. Introducing a stable abstraction can redirect this dependency, but abstraction is useful only when it isolates a meaningful variation. A generic interface that exposes every feature of one implementation may preserve the original coupling under a different name. Coupling and cohesion describe complementary concerns: coupling concerns relationships between elements, while cohesion concerns how closely an element’s internal responsibilities belong together.\n\nConnectors deserve explicit attention because they impose behavior of their own. An in-process function call, a network request, a shared table, and an asynchronous event channel have different latency, failure, concurrency, and ownership characteristics. Replacing a local call with a remote call changes more than its transport. Arguments must be serialized, independent failures become possible, and the caller may not know whether a timed-out operation completed. Architectural reasoning therefore examines both the elements and the semantics of their connections.\n\nBoundaries also establish authority over information and behavior. A module may own an invariant such as “an account balance cannot be changed without a corresponding ledger entry.” If other modules bypass its interface and modify its tables directly, the apparent boundary does not preserve that invariant. This distinction explains why a system’s actual architecture must be inferred from executable dependencies, data access, and operational behavior as well as from diagrams. A documented boundary has little protective effect if the implementation routinely crosses it."
    },
    {
      "heading": "Architectural styles and recurring organizations",
      "text": "An architectural style defines a family of system organizations through characteristic element types, connectors, and constraints. A pattern is commonly a more focused, reusable response to a recurring problem, although usage of “style” and “pattern” overlaps. Neither term denotes a complete ready-made design. A real system usually combines several organizations at different levels: a browser-based application can be client–server overall, layered within its server, and event-driven for background processing.\n\nLayered architectures organize responsibilities into levels with controlled dependencies. A common business application separates presentation, application coordination, domain rules, and persistence. Strict layering allows access only to the next lower layer; more permissive arrangements allow lower layers to be accessed directly. Layers support separation of concerns, but poorly chosen layers can force simple changes through many pass-through components. Logical layers must also be distinguished from physical tiers: three logical layers can execute in one process, while a single logical responsibility can span several machines.\n\nClient–server architecture separates service requesters from service providers. The World Wide Web is a prominent example, although contemporary web systems commonly add proxies, caches, gateways, and multiple backend services. Pipe-and-filter architectures instead compose transformations connected by streams. A compiler illustrates this organization through stages such as lexical analysis, parsing, optimization, and code generation, though practical compilers often share intermediate representations and supporting services across stages. The model works especially well when transformations have explicit inputs and outputs and can be composed without extensive shared state.\n\nA monolithic application generally packages substantial functionality into a common deployment unit. It may still have strong internal module boundaries. Microservices divide a system into services intended to support independent evolution and deployment, often around business capabilities. Their advantages depend on boundaries that limit coordination and shared data dependencies. Splitting an application into many network endpoints does not by itself create independence; tightly synchronized deployments and shared mutable tables can produce a distributed monolith with both coordination overhead and network failure modes.\n\nEvent-driven architecture organizes interactions around notifications of occurrences, often conveyed through a message broker. Producers need not synchronously invoke every consumer, enabling buffering and independent reactions. The trade-offs include delayed visibility, event-schema evolution, duplicate delivery, and more difficult end-to-end tracing. A published “order accepted” event can trigger fulfillment and analytics independently, but the system must define what acceptance means and how consumers recover after interruption.\n\nOther organizations emphasize different constraints. Hexagonal architecture, also called ports and adapters, separates application behavior from external technologies through ports implemented by adapters. Microkernel or plug-in architectures concentrate a stable core around extension mechanisms. Repository-centered architectures coordinate tools through shared information, while peer-to-peer systems distribute roles among participating nodes. Choosing among these structures requires identifying the forces that matter; no style simultaneously minimizes latency, maximizes isolation, simplifies operations, and eliminates change costs."
    },
    {
      "heading": "Quality attributes and architectural trade-offs",
      "text": "Functional requirements describe what a system does; quality attributes describe characteristics of how it does so or how it can change. Performance, availability, security, modifiability, usability, and interoperability frequently drive architectural choices. Broad labels are insufficient for evaluation. “Fast” might mean a short median response time, a bounded worst-case execution time, or high throughput under sustained load. These are different properties and can require different structures.\n\nA quality-attribute scenario makes the requirement more concrete by identifying a stimulus, its source, the relevant environment, the affected system element, the expected response, and a measurable response criterion. For example, a scenario might require that, during normal operation, 95 percent of product-search requests complete within 300 milliseconds at a specified request rate and dataset size. The percentile, operating conditions, and workload are essential: an average response time can conceal slow requests, and an unloaded benchmark may say little about peak operation.\n\nArchitectural tactics are decisions intended to influence particular qualities. Caching can reduce repeated computation or remote access; replication can improve read capacity or tolerate some failures; isolation can prevent one component’s resource exhaustion from affecting others. Each tactic introduces obligations. A cache requires invalidation or expiry rules. Replication requires decisions about consistency, failover, and conflict handling. Isolation consumes resources and may complicate communication. Architecture selects combinations of tactics rather than treating each quality as an independent feature.\n\nSimple models clarify some constraints. Under steady-state conditions, Little’s law relates the average number of items in a system \\(L\\), arrival rate \\(\\lambda\\), and average time in the system \\(W\\):\n\n\\[L = \\lambda W.\\]\n\nIf a service sustains 200 requests per second with an average response time of 0.5 seconds, approximately 100 requests are in the system on average. This relationship does not predict every queueing effect, but it helps expose inconsistencies in concurrency and capacity assumptions. Near resource saturation, waiting time can rise sharply even when the processing time of an individual request has not changed.\n\nReliability and availability likewise require carefully bounded models. For a repairable component under simplifying assumptions, steady-state availability can be expressed as\n\n\\[A = \\frac{\\mathrm{MTBF}}{\\mathrm{MTBF}+\\mathrm{MTTR}},\\]\n\nwhere MTBF is mean time between failures and MTTR is mean time to repair. A system composed of several required components can be less available than any one component, while redundant components improve availability only if failover works and failures are sufficiently independent. Shared credentials, power supplies, deployment errors, or network dependencies can defeat apparent redundancy.\n\nSecurity illustrates the interaction among qualities. Centralizing authentication can simplify policy enforcement but creates a dependency that requires careful availability design. Additional validation and encryption can increase processing costs while reducing exposure. Architectural analysis makes these tensions explicit rather than assuming that every desirable quality can be maximized independently."
    },
    {
      "heading": "Distribution, state, and failure",
      "text": "Distribution introduces architectural problems that do not arise in the same form inside a single process. Nodes communicate through messages, do not share perfectly synchronized clocks, and may fail independently. A request timeout establishes that a response did not arrive within a deadline; it does not prove that the remote operation failed. Distributed computing therefore requires explicit treatment of uncertainty, partial failure, message ordering, and recovery.\n\nState placement is a central decision. A stateless request-processing instance can often be replaced without losing durable business information, but the overall application still depends on state stored elsewhere. A database, object store, event log, or external service becomes part of the system’s reliability and consistency model. Shared storage simplifies some coordination, yet it can couple otherwise separate components through schema assumptions, transaction contention, and capacity limits. Assigning data ownership to individual services strengthens boundaries but makes cross-service operations more complex.\n\nThe CAP theorem concerns a specific incompatibility in asynchronous distributed storage systems: during a network partition, a system cannot guarantee both linearizable consistency and availability as defined by the theorem. Availability here means that every request received by a non-failing node eventually obtains a response, rather than a general uptime percentage. The theorem is not a rule that every database simply chooses two of three permanent features. Its practical significance is that partition behavior must be specified rather than concealed behind an unqualified claim of consistency and availability.\n\nTransactions provide one way to preserve invariants across multiple changes. Within a relational database, a transaction can make related updates atomic under the database’s supported isolation semantics. Across independently managed services, coordination may use distributed commit protocols or application-level workflows. A saga divides a longer operation into local transactions with compensating actions. Compensation is a business operation, not necessarily a literal reversal: canceling a reservation may release capacity, while an already dispatched physical shipment cannot be undone by restoring a database row.\n\nDelivery semantics also affect correctness. At-least-once delivery permits duplicates, so consumers often need idempotent processing or deduplication based on stable identifiers. At-most-once delivery avoids repeated processing at the cost of potentially losing work. Claims of exactly-once behavior require a stated boundary: a broker may coordinate consumption and publication within its own transactional domain without guaranteeing a single external bank transfer. An outbox pattern places a business update and an outgoing-event record in the same local transaction, allowing a separate publisher to retry delivery without losing the event after the business update commits.\n\nFailure containment combines timeouts, bounded retries, backpressure, bulkheads, and circuit breakers. Retries can improve success rates after transient faults, but synchronized retries may amplify an overloaded dependency’s workload. Operational observability—using signals such as metrics, logs, and traces—helps reveal these interactions. It supports diagnosis, but it does not replace a design that specifies acceptable behavior when dependencies remain unavailable."
    },
    {
      "heading": "Views, models, and architectural documentation",
      "text": "An architectural description selects information for particular stakeholders and concerns. Developers may need dependency rules, operators may need deployment and recovery information, and security specialists may need trust boundaries and data flows. A single diagram rarely answers all these questions. A viewpoint defines conventions for constructing and interpreting a kind of view; a view applies those conventions to a particular system. This distinction allows different representations to remain purposeful rather than becoming an unstructured collection of drawings.\n\nPhilippe Kruchten’s 1995 “4+1” view model is an influential example. It describes logical, process, development, and physical views, with scenarios connecting and validating them. The logical view addresses major abstractions and functionality; the process view addresses runtime behavior and concurrency; the development view addresses implementation organization; and the physical view addresses deployment. The model illustrates why the same system needs several complementary representations. A class relationship alone cannot explain which process owns an object, where it executes, or what happens when its host fails.\n\nThe Unified Modeling Language provides notation for several relevant model types, including component, deployment, sequence, and state-machine diagrams. Other approaches use simpler context, container, and component diagrams. The value lies less in a notation’s visual sophistication than in its semantics and consistency. A box labeled “service” must have a clear meaning: it might denote a logical capability, a separately deployable program, or a running instance. Mixing these meanings can hide scaling and failure assumptions.\n\nEffective software documentation combines structural diagrams with explanatory text. Interface contracts describe operations and errors; sequence diagrams show representative interactions; deployment models identify execution environments and network boundaries. Data-flow descriptions identify where sensitive information enters, is transformed, and is retained. Operational material specifies health checks, dependencies, recovery procedures, and migration constraints. Documentation should also record what lies outside the system boundary, since external identity providers, payment processors, and network services can determine system behavior.\n\nAn architecture decision record captures a significant decision together with its context and consequences. Michael Nygard’s 2011 description popularized a lightweight form of this practice. A record might explain why a team chose asynchronous messaging instead of synchronous calls, which alternatives were considered, and which assumptions justified the choice. Preserving the rationale prevents later maintainers from mistaking an intentional trade-off for an accidental implementation detail.\n\nDocumentation can be checked against implementation. Dependency analysis can reveal forbidden imports; deployment definitions can expose an undocumented database; traces can reveal unexpected synchronous call chains. Generated diagrams are useful for describing current structures, but they do not automatically explain intent. Conversely, manually maintained models can preserve intent while becoming outdated. Architectural descriptions remain useful when their scope, ownership, and relationship to the running system are explicit."
    },
    {
      "heading": "Architectural evaluation and evidence",
      "text": "Architecture evaluation examines whether proposed or existing structures can satisfy important requirements under stated assumptions. It is not limited to verifying compliance with a preferred style. A design may be a well-formed microservices architecture and still fail its latency or recovery requirements. Evaluation therefore begins with business drivers, significant scenarios, constraints, and uncertainty. Evidence can come from structured review, prototypes, measurements, mathematical models, implementation analysis, or combinations of these methods.\n\nThe Architecture Tradeoff Analysis Method, developed at the Software Engineering Institute in the late 1990s, uses stakeholder participation and quality-attribute scenarios to identify risks and trade-offs. Reviewers examine how architectural approaches support prioritized scenarios, looking for sensitivity points where a decision strongly affects a quality and trade-off points where it affects several qualities. For example, the number of replicas may influence read capacity, infrastructure cost, recovery behavior, and consistency overhead. The method makes these relationships visible without pretending that all consequences can be reduced to one numerical score.\n\nPrototypes and experiments address uncertainties that discussion alone cannot resolve. A performance prototype may test whether a critical query can meet its latency target with a realistic dataset. An integration experiment may establish whether an external service supports the required authentication or idempotency behavior. Such experiments need representative conditions. A benchmark using a tiny in-memory dataset can be misleading if production performance depends on storage access, network distance, data skew, or contention. Measurement should distinguish startup effects, steady-state operation, and overload behavior.\n\nAnalytical methods are valuable when their assumptions fit the problem. Queueing models can investigate utilization and waiting time. Dependency graphs can reveal cycles or unusually central components. Formal verification can establish properties of a protocol or state machine relative to a mathematical model. For instance, a model may check that a resource cannot be assigned simultaneously to two owners under the modeled failure conditions. The resulting assurance applies to those assumptions and abstractions, not automatically to every implementation detail or operational circumstance.\n\nSecurity evaluation often uses a threat model to identify assets, trust boundaries, attacker capabilities, and possible attack paths. This can expose architectural weaknesses such as placing authorization entirely in a client that an attacker controls. Resilience exercises similarly examine whether redundancy and recovery mechanisms work under injected failures. Testing a database failover may reveal that application connection pools do not recover as expected, despite the storage cluster successfully electing a replacement.\n\nEvaluation produces evidence and residual risks, not a permanent certificate of architectural correctness. Workloads change, dependencies evolve, and operational conditions differ from forecasts. Important findings therefore connect to measurable checks, explicit assumptions, and identified follow-up work. An accepted risk can be reasonable when its consequences and boundaries are understood; an undocumented assumption can remain dangerous even in an otherwise carefully reviewed design."
    },
    {
      "heading": "Evolution, delivery, and architectural erosion",
      "text": "Software architecture changes throughout a system’s life. New requirements, larger datasets, altered traffic patterns, dependency retirement, and organizational changes can invalidate earlier assumptions. Evolution is not necessarily a failure of initial design: many future conditions cannot be predicted economically. The architectural problem is to preserve essential invariants while making necessary change possible. Stable boundaries, explicit contracts, and controlled dependencies provide options for change without requiring every future feature to be anticipated.\n\nTechnical debt describes obligations created by design or implementation choices that make later work more costly. The metaphor is useful when it distinguishes a deliberate short-term compromise from uncontrolled deterioration. An organization may knowingly postpone replacing a fragile integration to meet a fixed deadline, while recording the resulting limitations. Architectural debt can also arise unintentionally when a system outgrows an initially suitable structure. Debt is not equivalent to old technology: a mature component can remain appropriate, while a recently introduced abstraction can create unnecessary complexity.\n\nArchitectural erosion occurs when implementation changes progressively violate intended constraints. Examples include presentation code issuing direct writes to a database intended to be owned by a domain module, or an ostensibly asynchronous workflow acquiring a long chain of blocking requests. Automated dependency checks and architectural tests can detect some violations. Fitness functions are executable checks that monitor selected architectural properties, such as forbidden dependencies, service latency, or deployment-policy compliance. Their usefulness depends on choosing measurements that represent the intended quality rather than merely convenient proxies.\n\nContinuous delivery makes deployment capability part of architectural design. Independently deployable components require compatible interfaces, automated verification, controllable configuration, and migration strategies. Database changes often use an expand-and-contract sequence: introduce a compatible schema extension, deploy code that can work during the transition, migrate data, and remove obsolete structures only after older consumers are no longer present. A destructive schema change bundled with one application release can make rollback impossible even if the application binary itself is easy to restore.\n\nGradual replacement offers an alternative to complete rewrites. A strangler-style migration directs selected functionality to a new implementation while the old system continues to serve the remainder. The difficult work often lies in shared data, user identity, transaction boundaries, and determining which implementation owns a request during transition. Keeping two systems active can reduce cutover risk but introduces temporary complexity and reconciliation obligations. Migration architecture is therefore a substantive design problem rather than merely a sequence of coding tasks.\n\nOperational feedback also changes architecture. Capacity measurements can reveal that partitioning is needed; incident analysis can expose a common dependency behind supposedly redundant services; deployment failures can reveal that service boundaries do not align with release independence. Version control preserves implementation history, while decision records and operational evidence explain why structural changes occurred. Together they support reconstruction of both the system’s current organization and the conditions that shaped it."
    },
    {
      "heading": "Organizational boundaries and domain-specific constraints",
      "text": "Architecture both shapes and reflects the organization that builds a system. Melvin Conway’s 1968 paper argued that organizations designing systems are constrained to produce designs reflecting their communication structures, a relationship widely called Conway’s law. This is not a deterministic rule assigning one service to each team. It identifies a recurring influence: frequent cross-team coordination tends to appear where technical responsibilities are tightly coupled, while autonomous teams need boundaries that allow useful work without continuous negotiation.\n\nResponsibility assignment is therefore an architectural concern. A service with no clear operational owner can accumulate defects that fall between teams, while several teams modifying the same shared schema may need coordinated releases despite nominal service independence. Conversely, one team can responsibly own several small components if their combined scope is manageable. The relevant questions concern cognitive load, authority over interfaces and data, incident response, and the amount of communication required to change the system safely.\n\nDomain-driven design, associated with Eric Evans’s 2003 book, emphasizes modeling software around domain knowledge and explicitly bounded models. A bounded context defines where a particular model and vocabulary apply. “Customer,” for example, may have different meanings in billing, support, and shipping. Making these boundaries explicit can prevent a universal shared model from becoming a source of cross-organizational coupling. Bounded contexts can inform module or service boundaries, but they do not require every context to become a separate network service.\n\nDifferent application domains impose different architectural constraints. Real-time embedded systems may require bounded execution times and deterministic resource use, making unrestricted allocation, long garbage-collection pauses, or unpredictable network dependencies unsuitable for critical paths. Scientific computing may prioritize data locality, numerical reproducibility, and parallel computing. Interactive applications emphasize responsiveness and intermittent connectivity, while high-volume transaction systems must coordinate correctness, throughput, and recovery. The same architectural tactic can be beneficial in one setting and unacceptable in another.\n\nSafety- and security-critical systems require stronger treatment of failure consequences and evidence. Partitioning can prevent lower-assurance functions from interfering with critical ones; redundant implementations may reduce some common failure risks, although independence must be demonstrated rather than assumed. Systems handling personal information introduce constraints on collection, access, retention, and geographic placement under applicable data privacy rules. These constraints affect data models, logging, backup design, and replication topology, not merely the wording of a user interface.\n\nSystems incorporating machine learning add dependencies on model versions, input distributions, training pipelines, and evaluation procedures. A model can retain a stable software interface while its behavior changes after retraining or as incoming data changes. Architectural descriptions may therefore include provenance, model-serving boundaries, monitoring, and fallback behavior alongside conventional components. This illustrates a general boundary of the discipline: an architecture must account for the sources of behavior and risk in the actual system, including those that are not captured by ordinary code dependencies."
    }
  ],
  "links": [
    "software-engineering",
    "information-hiding",
    "application-programming-interface",
    "client-server-model",
    "world-wide-web",
    "compiler",
    "event-driven-architecture",
    "message-broker",
    "hexagonal-architecture",
    "authentication",
    "encryption",
    "distributed-computing",
    "database",
    "cap-theorem",
    "relational-database",
    "observability",
    "software-documentation",
    "formal-verification",
    "version-control",
    "parallel-computing",
    "data-privacy",
    "machine-learning"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}