Principles
Having a common understanding of architecture, whatever form that understanding takes (documents, models, sketches, whiteboards or implicit team knowledge), is described as intentional architecture.
Characteristics of good architecture
Good architecture and design have the following characteristics:
- Intentional structure and behaviour
- Highly modular: separate services with well-designed APIs
- Services are highly cohesive
- Services are loosely coupled
- Services have low algorithmic complexity
- Avoids duplication
- Well-described services: modular elements have simple, expressive, meaningful names so readers can quickly understand their purpose
- Runs and passes all defined tests or acceptance criteria
- Lightweight documentation, with significant decisions recorded (see decision records)
- Uses Infrastructure as Code
Cloud architecture principles
Some additional cloud architecture principles that are often useful:
- Serverless first. Use serverless, event-driven architectures first, drop to PaaS or containers if required, and to IaaS only if strictly necessary (see the mental model).
- Use managed services where possible rather than inventing your own. Spend your effort on what differentiates your business.
- Separate compute and storage, so each can scale, fail and be replaced independently.
- Express services as APIs and events using ubiquitous standards: HTTPS with JSON, described with OpenAPI, and well-defined event schemas for asynchronous integration.
- Use immutable infrastructure. Rebuild the infrastructure when you deploy, instead of editing what’s running.
- Don’t SSH or exec in; build new. Manual changes to running systems are invisible, unrepeatable and a security risk.
- Automate everything. Builds, tests, deployments, security checks and recovery all run through pipelines.
- Design for failure. Assume any component can fail at any time. Use multiple availability zones, retries with backoff, timeouts and graceful degradation.
- Least privilege by default. Every person, service and function gets only the permissions it needs (see shared responsibility).
- Make it observable. Structured logs, metrics and traces are part of the architecture, not an afterthought.
- Cost is an architectural concern. Know what each part of the system costs to run, and treat cost like any other non-functional requirement.
- Prove, don’t guess. When in doubt, spike it and measure.