Software Architecture
Software architecture establishes the high-level structure of systems, defining components, their relationships, and how they communicate. Good architecture enables scalability, maintainability, and evolution.
TL;DR
- Architecture decisions have long-term consequences
- No single "best" architecture - choose based on requirements
- Balance complexity with team capabilities
- Design for change and evolution
Architectural Styles
Monolithic Architecture
- Single deployable unit
- Simpler to develop and deploy initially
- Can become complex and hard to scale
Microservices
- Independent, loosely-coupled services
- Enables team autonomy and technology diversity
- Adds operational complexity
Serverless Architecture
- Function-as-a-Service (FaaS)
- Event-driven, auto-scaling
- Pay-per-use pricing model
Event-Driven Architecture
- Asynchronous communication via events
- Loose coupling between services
- Event sourcing and CQRS patterns
Design Principles
SOLID Principles
- Single Responsibility
- Open/Closed
- Liskov Substitution
- Interface Segregation
- Dependency Inversion
Domain-Driven Design (DDD)
- Bounded contexts
- Ubiquitous language
- Aggregates and entities
- Strategic and tactical design
Clean Architecture
- Dependency inversion
- Separation of concerns
- Framework independence
Scalability Patterns
- Horizontal vs vertical scaling
- Load balancing
- Caching strategies
- Database sharding
- Read replicas
- CDN usage
Mini Example: boundaries and dependency direction
One simple “architecture smell” is when business logic imports framework code directly. A cleaner shape is: handlers/controllers call use cases, and use cases depend on interfaces.
Related Topics
- Backend Development - Server architecture
- Databases - Data architecture
- DevOps - Infrastructure and deployment