LearningTree

Software Architecture Overview

What is software architecture? Why does it matter? How do architects think about structure, trade-offs, quality, and evolution? A concise overview โ€” with links to deep dives.

01
Chapter One ยท Introduction

What Is Software Architecture?

Software architecture is the set of significant design decisions about the organisation of a software system โ€” the major components, their relationships, and the principles guiding their design and evolution.

๐Ÿ—๏ธ

Structure

  • Decomposition into components, modules, and services
  • Responsibilities assigned to each building block
  • Interfaces that define how blocks communicate
โš–๏ธ

Trade-offs

  • Every decision involves trade-offs
  • Consistency vs. availability
  • Simplicity vs. flexibility
  • Performance vs. maintainability
๐Ÿ“ก

Communication

  • How components interact โ€” sync (REST, gRPC) vs. async (events, queues)
  • Protocols, contracts, and data formats
๐Ÿ”„

Evolution

  • Good architecture accommodates change
  • Systems are never "done" โ€” they evolve with requirements
The Role of a Software Architect
The Architect's Core Responsibilities
Software Architect collaborative technical leader ๐Ÿ”ง Technical Decisions Patterns, tools, trade-offs Close to the code Breadth over depth ๐Ÿ’ฌ Communication Bridge business & engineering Translate requirements Document decisions (ADRs) ๐Ÿ“Š Quality & Risk Quality attributes & scenarios Identify & mitigate risks ๐ŸŽฏ Pragmatism "Good enough" over "perfect" Avoid over-engineering
Deep dive โ†’ Fundamentals: Roles, Concepts & Influencing Factors
๐Ÿ“‹ Chapter 1 โ€” Summary
  • Architecture = structure + trade-offs + communication + evolution
  • The architect is a collaborative technical leader โ€” not an ivory-tower decision-maker
  • Every decision is a trade-off โ€” document the rationale, not just the choice
02
Chapter Two ยท Architectural Styles

Architecture Styles & Patterns

An architectural style defines the overall shape of a system. Patterns solve specific recurring problems within that shape. Most real systems combine multiple styles and patterns.

๐Ÿ“ฆ

Monolithic

  • Single deployable unit
  • Simple to develop, test & deploy
  • Best for small teams & MVPs
  • Scaling requires scaling the whole app
๐Ÿงฉ

Microservices

  • Small, independently deployable services
  • Each owns its own data & business logic
  • Independent scaling & team autonomy
  • Distributed system complexity
๐Ÿ“จ

Event-Driven

  • Components communicate via events
  • Loose coupling, high scalability
  • Event Sourcing & CQRS
  • Eventual consistency challenges
๐Ÿ“š

Layered / N-Tier

  • Presentation โ†’ Business โ†’ Data
  • Each layer depends only on layer below
  • Well-understood, good for CRUD
  • Can lead to tight inter-layer coupling
โ˜๏ธ

Serverless

  • Code runs in response to events (Lambda)
  • Zero server management, auto-scaling
  • Pay-per-execution model
  • Cold starts & vendor lock-in
๐Ÿ”—

Pipes & Filters

  • Data flows through a sequence of filters
  • Each filter transforms data independently
  • Great for ETL & data processing
  • Composable & reusable
Monolith โ†’ Microservices: When to Choose What
Monolith Small team ยท MVP Simple operations Modular Monolith Growing team Clear module boundaries Microservices Multiple teams Independent scaling โœ“ Start simple โ€” move right only when you have a clear need โ† Simpler ops ยทยทยทยทยทยทยทยทยทยท Independent deployment โ†’
Deep dive โ†’ Architecture Patterns (Layers, MVC, Pipes & Filters, Microservices)
๐Ÿ“‹ Chapter 2 โ€” Summary
  • Monolith: Start here โ€” simple, low overhead, good for small teams
  • Microservices: Independent deployment & scaling โ€” but adds distributed system complexity
  • Event-Driven: Loose coupling via events โ€” eventual consistency trade-off
  • Layered: Well-understood separation of concerns โ€” prone to cascade coupling
  • Most real systems combine multiple styles and patterns
03
Chapter Three ยท Design Principles

Core Design Principles

These principles guide good software design across all architectural styles โ€” from monoliths to microservices, from classes to services.

SOLID Principles
S โ€” Single Responsibility

A class should have only one reason to change. Separate concerns into focused units.

O โ€” Open/Closed

Open for extension, closed for modification. Add behaviour via new classes, not changing existing code.

L โ€” Liskov Substitution

Subtypes must be substitutable for their base types without altering correctness.

I โ€” Interface Segregation

Prefer many specific interfaces over one general-purpose interface. Clients shouldn't depend on methods they don't use.

D โ€” Dependency Inversion

High-level modules depend on abstractions, not concrete implementations. The foundation of testability.

Deep dive โ†’ SOLID, Coupling, Cohesion, DRY, KISS & more
CAP Theorem & Data Consistency
CAP Theorem โ€” Pick Two (in practice: CP or AP)
C Consistency Every read gets the latest write A Availability Every request gets a response P Partition Tol. Works despite network splits CP: ZooKeeper, HBase AP: Cassandra, DynamoDB CA: Single-node RDBMS (no partition)
ACID (Traditional)
  • Atomicity โ€” all or nothing
  • Consistency โ€” valid state to valid state
  • Isolation โ€” concurrent txns don't interfere
  • Durability โ€” committed data survives crashes

Use for: financial transactions, inventory

BASE (Distributed)
  • Basically Available โ€” system stays up
  • Soft State โ€” state may change over time
  • Eventual Consistency โ€” replicas converge

Use for: social feeds, analytics, caching

Domain-Driven Design (DDD) โ€” Key Concepts
Ubiquitous Language

Shared vocabulary between devs and business โ€” used in code, docs, and conversations

Bounded Context

Explicit boundary within which a domain model applies. "Order" means different things in Sales vs. Shipping

Aggregates

Cluster of entities treated as a single unit for data changes. One entity is the Aggregate Root

๐Ÿ“‹ Chapter 3 โ€” Summary
  • SOLID โ€” five principles for maintainable, extensible code at any scale
  • CAP theorem โ€” in distributed systems, choose between CP (consistency) and AP (availability)
  • ACID for strong consistency; BASE for distributed, eventually-consistent systems
  • DDD โ€” model complex domains with bounded contexts, ubiquitous language, and aggregates
04
Chapter Four ยท System Design

Designing Systems

Practical patterns and strategies for building scalable, reliable, and maintainable systems โ€” from caching to consistency.

๐Ÿ“ˆ

Scaling

  • Vertical: bigger machine (simple, has limits)
  • Horizontal: more machines + load balancer
  • Read replicas, sharding, auto-scaling
โš–๏ธ

Load Balancing

  • Distributes traffic across healthy instances
  • L4 (TCP) fast; L7 (HTTP) content-aware
  • API Gateway for auth, rate-limiting, routing
๐Ÿ’พ

Caching

  • Cache-Aside: check cache โ†’ miss โ†’ load from DB
  • Write-Through: write to both simultaneously
  • TTL, eviction (LRU/LFU), CDN for static
Data Consistency Patterns
PatternHow It WorksTrade-off
Strong ConsistencyEvery read returns the latest writeLimits availability & performance
Eventual ConsistencyReads may be temporarily stale โ€” replicas convergeSimpler, faster โ€” but stale reads possible
Saga PatternSequence of local transactions + compensating actionsComplex failure modes; no distributed txn
Outbox PatternWrite event to outbox table in same DB transactionGuarantees atomicity โ€” needs separate publisher
Deep dive โ†’ Quality Goal Tactics (Performance, Adaptability, Availability)
Deep dive โ†’ Reducing Coupling (Structural, Instantiation, Call Dependencies)
๐Ÿ“‹ Chapter 4 โ€” Summary
  • Scale horizontally with stateless services behind a load balancer
  • Cache aggressively โ€” Cache-Aside is the most common pattern
  • Saga replaces distributed transactions in microservices
  • Outbox pattern guarantees atomicity between state change and event publishing
05
Chapter Five ยท Quality Attributes

Quality Attributes โ€” The "-ilities"

Non-functional requirements that define how well a system performs โ€” often more important than features, and much harder to retrofit.

๐Ÿ“ˆ

Scalability

  • Handle increased load by adding resources
  • Horizontal (more instances) vs. vertical (bigger hardware)
  • Measure: requests/sec, concurrent users under target latency
๐Ÿ›ก๏ธ

Reliability & Availability

  • 99.9% uptime = 8.76 hours downtime/year
  • Redundancy, graceful degradation, chaos engineering
  • Multi-AZ, replicas, health checks, circuit breakers
๐Ÿ”’

Security

  • Defence in depth โ€” network, app, data layers
  • AuthN (OAuth2/JWT), AuthZ (RBAC/ABAC)
  • Encryption in transit (TLS) & at rest (AES-256)
  • Input validation, least privilege, OWASP Top 10
๐Ÿ”

Observability

  • Three pillars: Metrics, Logs, Traces
  • Distributed tracing with correlation IDs
  • SLOs, SLIs, alerting on threshold breaches
  • Grafana + Prometheus / CloudWatch
Deep dive โ†’ Quality Modeling, ISO 25010, ATAM, Metrics & Fitness Functions
๐Ÿ“‹ Chapter 5 โ€” Summary
  • Quality attributes are designed in by architecture โ€” not tested in later
  • Scalability: stateless services + horizontal scaling
  • Reliability: redundancy, graceful degradation, chaos engineering
  • Security: defence in depth, least privilege
  • Observability: metrics + logs + traces โ€” the three pillars
06
Chapter Six ยท Real World

Architecture Case Studies

How major companies solve complex architectural challenges at scale โ€” and what we can learn from their decisions.

Netflix โ€” Global Streaming
  • Microservices on AWS โ€” hundreds of services via REST & event streams
  • Open Connect CDN โ€” custom edge servers at ISPs
  • Resilience: Hystrix (circuit breaker), Chaos Monkey (fault injection)
  • Data: Cassandra + EVCache + Kafka
  • Lesson: Design for failure โ€” every component has fallback behaviour
Google โ€” Search & Infrastructure
  • MapReduce โ€” distributed data processing at massive scale
  • Spanner โ€” globally distributed SQL with strong consistency (TrueTime)
  • Borg โ†’ Kubernetes โ€” internal orchestration โ†’ open source
  • Lesson: Build infrastructure abstractions that scale. Invest in platforms
Twitter โ€” Real-Time Feeds
  • Fan-out problem: celebrity tweet โ†’ millions of timelines
  • Hybrid: fan-out on write for most; fan-out on read for celebrities
  • Stack: Scala/JVM, Redis, Kafka, Manhattan (K/V store)
  • Lesson: Hybrid strategies beat pure approaches โ€” optimise for the common case
Spotify โ€” Microservices at Scale
  • Squad model: autonomous cross-functional teams own services end-to-end
  • Backstage: internal dev portal for service catalogue (now open-source)
  • Data: Kafka + Dataflow + BigQuery for recommendations
  • Lesson: Conway's Law in action โ€” org structure shapes system architecture
Deep dive โ†’ Examples & Case Studies (Reference Architectures, Strangler Fig)
๐Ÿ“‹ Chapter 6 โ€” Summary
  • Netflix: design for failure โ€” circuit breakers, chaos engineering
  • Google: invest in infrastructure abstractions that scale
  • Twitter: hybrid strategies beat pure approaches
  • Spotify: org structure mirrors system architecture (Conway's Law)
Go deeper โ†’ Software Architecture Foundation โ€” 12 in-depth pages covering fundamentals, design principles, patterns, interfaces, quality tactics, coupling, data modeling, communication, documentation, quality evaluation, examples, and reference materials.
Summary โ€” Software Architecture at a Glance
01 ยท Introduction

What Is Architecture?

  • Structure + trade-offs + communication + evolution
  • Architect = collaborative technical leader
  • Every decision is a documented trade-off
02 ยท Styles

Architecture Styles

  • Monolith โ†’ Modular โ†’ Service-Based โ†’ Microservices
  • Event-Driven for loose coupling
  • Start simple, evolve when needed
03 ยท Principles

Design Principles

  • SOLID โ€” SRP, OCP, LSP, ISP, DIP
  • CAP: choose CP or AP in distributed systems
  • DDD: bounded contexts, ubiquitous language
04 ยท System Design

Designing Systems

  • Scale horizontally with stateless services
  • Cache-Aside, Write-Through, CDN
  • Saga & Outbox for data consistency
05 ยท Quality

Quality Attributes

  • Scalability, reliability, security, observability
  • Quality is designed in, not tested in
  • Metrics + Logs + Traces = observability
06 ยท Case Studies

Real-World Lessons

  • Netflix: design for failure
  • Google: infrastructure abstractions
  • Twitter: hybrid fan-out strategies