
Architecture Design
- 31 installs
- 14 repo stars
- Updated January 23, 2026
- dauquangthanh/hanoi-rainbow
Architecture Design is an agent skill that produces solution architectures, diagrams, and ADRs so developers can align technology choices before coding.
About
The architecture-design skill designs full software solutions: components, stacks, integration patterns, scalability, and deployment models. It outputs diagrams, technical specifications, ADRs, and roadmaps following a structured workflow. Reach for it when planning new systems, modernizing legacy apps, or deciding microservices versus monolith with documented tradeoffs.
- C4 and Mermaid architecture diagrams
- Microservices, event-driven, and serverless styles
- Technology stack selection with ADRs
- Scalability, security, and resilience patterns
Architecture Design by the numbers
- 31 all-time installs (skills.sh)
- Ranked #1,840 of 3,282 Productivity & Planning skills by installs in the Skillselion catalog
- Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/dauquangthanh/hanoi-rainbow --skill architecture-designAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 31 |
|---|---|
| repo stars | ★ 14 |
| Last updated | January 23, 2026 |
| Repository | dauquangthanh/hanoi-rainbow ↗ |
How do you document a scalable, secure system design with justified stack and integration decisions?
Design system architecture, stacks, integration patterns, scalability, and ADRs before implementation starts.
Who is it for?
Developers planning greenfield or modernization efforts who need C4 diagrams, ADRs, and NFR-driven architecture.
Skip if: Tasks limited to reviewing an existing design doc without creating new architecture artifacts.
When should I use this skill?
Users mention system design, architecture patterns, scalability planning, microservices, or technical architecture decisions.
What you get
Architecture diagrams, ADRs, technical specifications, API contracts, and implementation roadmaps.
Files
Architecture Design
Overview
This skill enables you to design comprehensive software solution architectures including system components, technology stacks, integration patterns, scalability strategies, and deployment models.
Core Capabilities
When activated, this skill provides:
1. Requirements Analysis & Architecture Planning
- Analyze functional and non-functional requirements
- Identify architectural drivers (scalability, security, performance)
- Define system boundaries and constraints
- Establish architecture goals and success criteria
2. System Architecture Design
- Design layered/tiered architectures
- Create microservices and domain-driven designs
- Design event-driven and message-based systems
- Plan serverless and cloud-native architectures
- Design monolithic, modular monolithic, or distributed systems
3. Technology Stack Selection
- Evaluate and justify programming languages and frameworks
- Select databases with rationale (SQL, NoSQL, time-series, graph)
- Choose middleware and integration platforms (message queues, API gateways)
- Select infrastructure and cloud platforms (assess vendor lock-in)
- Recommend CI/CD and DevOps tools
- Document technology decisions in ADRs with alternatives considered
- Assess team skills and training needs for new technologies
4. Architecture Patterns & Best Practices
- Apply design patterns (MVC, MVVM, Clean Architecture, Hexagonal)
- Implement integration patterns (REST, GraphQL, gRPC, message queues)
- Design for scalability (horizontal/vertical, caching, CDN)
- Implement security patterns (OAuth, JWT, zero-trust)
- Apply resilience patterns (circuit breakers, retries, bulkheads)
5. Documentation & Deliverables
- Create C4 model diagrams in Mermaid format (Context, Container, Component, Code)
- Generate Mermaid diagrams (class, sequence, deployment)
- Produce architecture decision records (ADRs)
- Write technical specifications and API contracts
- Create implementation roadmaps and migration plans
Architecture Design Workflow
Follow this systematic process:
Step 1: Discovery & Requirements
1. Gather Requirements
- Functional requirements (features, use cases)
- Non-functional requirements (performance, scalability, security)
- Business constraints (budget, timeline, compliance)
- Technical constraints (existing systems, team skills)
2. Analyze Architecture Drivers
- Performance: latency, throughput targets
- Scalability: user growth, data volume projections
- Availability: uptime SLA, disaster recovery needs
- Security: authentication, authorization, compliance requirements
- Maintainability: testability, modularity goals
3. Define System Context
- Identify stakeholders and their needs
- Map external systems and dependencies
- Define system boundaries
- Identify integration points
Step 2: Architecture Design
1. Choose Architecture Style
Select based on requirements and constraints:
Monolithic
- Use for: Simple applications, MVPs, small teams, tight deadlines
- Benefits: Simple deployment, strong consistency, no network overhead
- Trade-offs: Scaling limitations, technology lock-in
Modular Monolithic
- Use for: Medium complexity, clear domain boundaries
- Benefits: Better organization, some isolation, shared infrastructure
- Trade-offs: Still single deployment, limited independent scaling
Microservices
- Use for: Large scale, multiple teams, different tech stacks
- Benefits: Independent scaling/deployment, technology flexibility
- Trade-offs: Distributed complexity, network overhead, eventual consistency
Serverless
- Use for: Event-driven, variable load, rapid development
- Benefits: Auto-scaling, pay-per-use, no infrastructure management
- Trade-offs: Cold starts, vendor lock-in, debugging complexity
Event-Driven
- Use for: Real-time processing, loose coupling, high throughput
- Benefits: Scalability, flexibility, asynchronous processing
- Trade-offs: Complexity, eventual consistency, debugging challenges
1. Design System Components
Define key layers and components:
┌─────────────────────────────────┐
│ Presentation Layer │ UI, Controllers, APIs
├─────────────────────────────────┤
│ Application Layer │ Use Cases, Orchestration
├─────────────────────────────────┤
│ Domain Layer │ Business Logic, Entities
├─────────────────────────────────┤
│ Data Layer │ Databases, Caches
├─────────────────────────────────┤
│ Infrastructure Layer │ External APIs, Services
└─────────────────────────────────┘1. Define Data Architecture
- Design data models and schemas
- Choose database types (relational, document, graph, time-series)
- Plan data partitioning and sharding strategies
- Design caching layers (Redis, Memcached)
- Define data flows and ETL processes
2. Design Integration Points
- API design (REST, GraphQL, gRPC)
- Message queues (Kafka, RabbitMQ, SQS)
- Event streaming architectures
- Authentication and authorization flows
- Rate limiting and throttling strategies
Step 3: Document Architecture
1. Create Architecture Diagrams
Use C4 model in Mermaid format for comprehensive documentation:
- Context: System in environment with users and external systems (use Mermaid C4Context)
- Container: High-level technology choices and communication (use Mermaid C4Container)
- Component: Internal structure of containers (use Mermaid C4Component)
- Code: Class diagrams for complex components (use Mermaid classDiagram)
All diagrams should use Mermaid syntax for easy versioning and rendering in markdown.
1. Write Architecture Decision Records (ADRs)
Document all significant decisions using structured ADRs:
# ADR-001: [Decision Title]
## Status
Proposed | Accepted | Deprecated | Superseded
## Context
[Problem and constraints requiring decision]
## Decision
[Chosen solution and approach]
## Consequences
[Benefits and trade-offs]Full ADR Template: See adr-template.md for complete structure with examples
1. Produce Technical Specifications
- System overview and objectives
- Component descriptions and responsibilities
- API contracts and interfaces
- Data models and schemas
- Security and compliance measures
- Deployment and operations guidelines
Step 4: Validate & Review
1. Quality Attributes Assessment
- Performance: Response time, throughput
- Scalability: Horizontal/vertical scaling capabilities
- Availability: Fault tolerance, disaster recovery
- Security: Authentication, authorization, encryption
- Maintainability: Code organization, testability
- Cost: Infrastructure and operational expenses
2. Design Validation Checklist
Ensure architecture is review-ready:
- [ ] All functional and non-functional requirements addressed
- [ ] Architecture style justified with trade-offs documented
- [ ] Scalability strategy defined (horizontal/vertical, capacity planning)
- [ ] Security measures implemented (authentication, authorization, encryption)
- [ ] Data architecture validated (storage, consistency, replication)
- [ ] Integration patterns specified (sync/async, APIs, events)
- [ ] Monitoring and observability planned (metrics, logs, traces, alerts)
- [ ] Disaster recovery and backup strategy documented (RPO/RTO)
- [ ] Cost estimates provided (infrastructure, operations, scaling)
- [ ] Architecture Decision Records (ADRs) created for major decisions
Reference Files
Load reference files based on specific needs:
- Architecture Design Process: See architecture-design-process.md when:
- Need detailed step-by-step guidance for complex architectures
- Working through each phase systematically
- Require comprehensive checklists and considerations
- Architecture Patterns: See architecture-patterns.md when:
- Need detailed pattern descriptions with benefits and trade-offs
- Comparing multiple architecture styles
- Looking for specific pattern implementations and examples
- Technology Stack Guide: See technology-stack-guide.md when:
- Evaluating specific technologies or frameworks
- Need recommendations for databases, languages, or cloud platforms
- Comparing technology options for specific requirements
- Best Practices: See best-practices.md when:
- Need design principles and guidelines
- Looking for API design standards
- Require security or operational best practices
- Design Considerations: See design-considerations.md when:
- Evaluating quality attributes (performance, scalability, security)
- Need guidance on specific architectural concerns
- Planning for observability, resilience, or cost optimization
- Common Anti-Patterns: See common-anti-patterns-to-avoid.md when:
- Reviewing existing architectures for issues
- Validating design decisions
- Need examples of what NOT to do
- Migration Patterns: See migration-patterns.md when:
- Modernizing legacy applications
- Planning migration strategies
- Need patterns for phased migrations or strangler fig approaches
- Examples: See examples.md when:
- Need complete architecture examples for common scenarios
- Looking for real-world reference implementations
- Want to see how patterns are applied in practice
- Resources and References: See resources-and-references.md when:
- Need external documentation links
- Looking for additional learning resources
- Require specifications or standards references
Output Format
Produce clear, comprehensive architecture documentation:
1. Architecture Overview
- System purpose and scope
- Key architecture decisions and rationale
- High-level component diagram
2. Detailed Design
- Component descriptions and responsibilities
- Data models and schemas
- API specifications
- Integration patterns
3. Diagrams (All in Mermaid format)
- C4 Context diagram (Mermaid C4Context)
- C4 Container diagram (Mermaid C4Container)
- Sequence diagrams for key flows (Mermaid sequenceDiagram)
- Deployment diagram (Mermaid flowchart or C4Deployment)
4. Implementation Roadmap
- Phase breakdown with milestones
- Dependencies and sequencing
- Resource requirements
- Risk mitigation strategies
5. Architecture Decision Records
- Document all significant decisions
- Include context, alternatives, and trade-offs
Architecture Decision Records (ADR) Template
Use this template to document important architecture decisions.
ADR Format
# ADR-{NUMBER}: {TITLE}
## Status
{PROPOSED | ACCEPTED | DEPRECATED | SUPERSEDED}
## Date
{YYYY-MM-DD}
## Context
What is the issue that we're seeing that is motivating this decision or change?
- Describe the forces at play (technical, business, political, social)
- Include requirements that are driving the decision
- Mention constraints or assumptions
## Decision
What is the change that we're proposing and/or doing?
- Be specific and describe what will be implemented
- Include concrete examples if helpful
- Reference alternative solutions considered
## Consequences
What becomes easier or more difficult to do because of this change?
## Positive
- Benefit 1
- Benefit 2
### Negative
- Trade-off 1
- Trade-off 2
### Risks
- Risk 1 and mitigation approach
- Risk 2 and mitigation approach
## Alternatives Considered
What other options were evaluated?
### Alternative 1: {NAME}
- Description
- Pros
- Cons
- Why rejected
### Alternative 2: {NAME}
- Description
- Pros
- Cons
- Why rejected
## Implementation Notes (Optional)
- Technical details about how to implement
- Migration strategy
- Dependencies
- Timeline
## References (Optional)
- Links to relevant documentation
- Related ADRs
- External resources---
Example ADRs
Example 1: Database Selection
# ADR-001: Use PostgreSQL as Primary Database
## Status
ACCEPTED
## Date
2026-01-14
## Context
We need to select a database for our e-commerce platform that will:
- Handle transactional data (orders, payments, inventory)
- Support complex queries for reporting and analytics
- Scale to 100K daily active users
- Provide strong data consistency
- Support both structured and semi-structured data (product attributes)
Our team has SQL experience but limited NoSQL experience.
Budget is limited, so we prefer open-source solutions.
## Decision
We will use PostgreSQL as our primary database for all transactional and analytical data.
Implementation approach:
- PostgreSQL 15+ for ACID transactions
- Use JSONB columns for flexible product attributes
- Implement read replicas for read-heavy queries
- Use connection pooling (PgBouncer)
- Schedule for partitioning large tables (orders, logs)
## Consequences
### Positive
- Strong ACID guarantees for financial transactions
- Rich query capabilities with SQL
- JSONB support provides schema flexibility where needed
- Mature ecosystem with good tooling
- Excellent documentation and community support
- Team already knows SQL
- Lower total cost of ownership (open-source)
- Proven scalability for our expected load
### Negative
- Vertical scaling limitations (though not an issue at our scale)
- Manual sharding required for extreme scale
- More complex to operate than managed NoSQL solutions
- JSONB queries are less performant than native document stores
### Risks
- **Risk**: Write bottlenecks as we scale
- **Mitigation**: Implement caching layer (Redis), database connection pooling, and optimize queries
- **Risk**: Running out of primary database capacity
- **Mitigation**: Set up monitoring and alerting, plan for read replicas early
- **Risk**: Complex migration if we need to move to distributed database later
- **Mitigation**: Design data access layer with abstraction to minimize coupling
## Alternatives Considered
### Alternative 1: MongoDB
- **Description**: Use MongoDB for flexible schema and horizontal scalability
- **Pros**: Flexible schema, horizontal scaling, simpler sharding
- **Cons**: Weaker consistency guarantees, team less familiar, transaction limitations across collections
- **Why Rejected**: Our use case requires strong consistency for financial data, and we don't need the extreme horizontal scalability that MongoDB provides
### Alternative 2: MySQL
- **Description**: Use MySQL as a widely-adopted relational database
- **Pros**: Widely used, good performance, familiar to team
- **Cons**: Less feature-rich than PostgreSQL, weaker JSON support
- **Why Rejected**: PostgreSQL offers better JSON support and more advanced features (CTEs, window functions) that we need for analytics
### Alternative 3: Amazon Aurora
- **Description**: Use AWS Aurora for managed PostgreSQL with auto-scaling
- **Pros**: Managed service, auto-scaling, high availability
- **Cons**: Higher cost, AWS vendor lock-in, limited control
- **Why Rejected**: Current budget constraints and desire to avoid vendor lock-in. We can revisit this as a managed option later
## Implementation Notes
- Start with single PostgreSQL instance
- Set up automated backups (daily full, hourly incremental)
- Implement monitoring from day one (query performance, connection pool, disk usage)
- Phase 2: Add read replica for analytics queries
- Phase 3: Implement table partitioning for order history
## References
- [PostgreSQL Official Documentation](https://www.postgresql.org/docs/)
- [Designing Data-Intensive Applications by Martin Kleppmann](https://dataintensive.net/)
- Performance benchmarks: [Link to internal benchmarks]---
Example 2: Microservices Decomposition
# ADR-002: Adopt Microservices Architecture with Domain-Driven Design
## Status
ACCEPTED
## Date
2026-01-14
## Context
Our monolithic e-commerce application has grown to 200K lines of code with:
- 3 development teams working on different features
- Frequent deployment conflicts and coordination overhead
- Scaling challenges (can only scale entire application)
- Technology lock-in (everything must be in Java/Spring)
- Increasing build and deployment times (15+ minutes)
Business requirements:
- Support for 500K daily active users (5x current)
- Faster feature delivery (weekly deployments per team)
- Ability to experiment with new technologies (e.g., Node.js for real-time features)
## Decision
We will decompose the monolith into microservices using Domain-Driven Design principles.
Service boundaries:
1. **User Service**: Authentication, profiles, preferences
2. **Product Catalog Service**: Products, categories, search
3. **Order Service**: Order management, cart
4. **Payment Service**: Payment processing, refunds
5. **Inventory Service**: Stock management, reservations
6. **Notification Service**: Emails, SMS, push notifications
Communication:
- Synchronous: REST APIs for query operations
- Asynchronous: Kafka for events (OrderCreated, PaymentProcessed, etc.)
- API Gateway: Kong for routing, authentication, rate limiting
Data:
- Each service owns its database (database per service pattern)
- Event-driven data synchronization where needed
- Saga pattern for distributed transactions
## Consequences
### Positive
- **Team Autonomy**: Each team can work independently with fewer conflicts
- **Independent Scaling**: Scale services based on actual load (e.g., Product Catalog gets 80% of traffic)
- **Technology Flexibility**: Can use different languages (Node.js for Notification Service)
- **Faster Deployments**: Deploy services independently, multiple times per day
- **Fault Isolation**: Issues in one service don't bring down entire system
- **Better Organization**: Clear service boundaries align with business domains
### Negative
- **Increased Complexity**: Distributed system challenges (network, consistency)
- **Operational Overhead**: More deployments, more monitoring, more infrastructure
- **Data Consistency**: Need to handle eventual consistency
- **Testing Complexity**: More complex integration and end-to-end testing
- **Initial Development Slowdown**: Time needed for decomposition
- **Network Latency**: Inter-service calls add latency
### Risks
- **Risk**: Distributed transactions fail (e.g., order created but payment fails)
- **Mitigation**: Implement Saga pattern with compensating transactions
- **Risk**: Service dependencies create cascading failures
- **Mitigation**: Implement circuit breakers, timeouts, fallbacks
- **Risk**: Increased operational complexity overwhelms team
- **Mitigation**: Invest in DevOps automation, monitoring, and training
- **Risk**: Poor service boundaries lead to chatty services
- **Mitigation**: Use DDD to identify proper boundaries, monitor inter-service calls
## Alternatives Considered
### Alternative 1: Modular Monolith
- **Description**: Refactor existing monolith into clear modules with strong boundaries
- **Pros**: Simpler deployment, no distributed system complexity, lower overhead
- **Cons**: Still single deployment unit, can't scale independently, technology lock-in remains
- **Why Rejected**: Doesn't address independent scaling and technology flexibility needs
### Alternative 2: Two-Phase Migration (Modular Monolith → Microservices)
- **Description**: First create modular monolith, then extract services gradually
- **Pros**: Lower risk, incremental approach, learn boundaries before splitting
- **Cons**: Longer timeline, multiple migrations
- **Why Rejected**: Business pressure for faster delivery makes two-phase approach too slow
### Alternative 3: Serverless Functions
- **Description**: Use AWS Lambda functions instead of containerized microservices
- **Pros**: No server management, automatic scaling, pay-per-use
- **Cons**: Cold starts, vendor lock-in, 15-minute execution limit, stateless constraints
- **Why Rejected**: Some of our workflows exceed Lambda limits, and we want to avoid AWS lock-in
## Implementation Notes
### Phase 1: Foundation (Months 1-2)
- Set up Kubernetes cluster
- Implement API Gateway (Kong)
- Set up Kafka cluster
- Create service templates and CI/CD pipelines
- Establish monitoring (Prometheus, Grafana, Jaeger)
### Phase 2: Extract First Service (Month 3)
- Start with Notification Service (lowest risk, fewer dependencies)
- Validate architecture and tooling
- Learn lessons before extracting more services
### Phase 3: Extract Core Services (Months 4-8)
- User Service
- Product Catalog Service
- Order Service
- Payment Service
- Inventory Service
### Phase 4: Decommission Monolith (Month 9)
- Redirect all traffic to microservices
- Turn off monolith
### Migration Strategy: Strangler Fig Pattern
- Keep monolith running during migration
- Route specific features to new services incrementally
- Gradually "strangle" the monolith
- No big-bang cutover
## References
- [Building Microservices by Sam Newman](https://samnewman.io/books/building_microservices/)
- [Domain-Driven Design by Eric Evans](https://www.domainlanguage.com/ddd/)
- [Microservices Patterns by Chris Richardson](https://microservices.io/)
- Internal: Service Boundary Analysis Document---
Example 3: API Design Decision
# ADR-003: Use REST APIs for Synchronous Communication
## Status
ACCEPTED
## Date
2026-01-14
## Context
Our microservices need to communicate synchronously for query operations (e.g., getting user profile, product details).
Requirements:
- Client needs to fetch data from multiple services
- Need to support web, mobile, and third-party integrations
- Team has strong HTTP/REST experience
- Need good tooling and documentation
Technology options: REST, GraphQL, gRPC
## Decision
We will use REST APIs with OpenAPI (Swagger) specifications for all synchronous service-to-service and client-to-service communication.
Standards:
- RESTful conventions (proper HTTP verbs, status codes)
- JSON for request/response bodies
- Versioning via URL path (/v1/users, /v2/users)
- OpenAPI 3.0 specs for all APIs
- Consistent error response format
- API Gateway for routing, authentication, rate limiting
## Consequences
### Positive
- Team already experienced with REST
- Excellent tooling (Postman, Swagger UI, API clients)
- Human-readable (JSON over HTTP)
- Works well with all client types (web, mobile, third-party)
- Wide adoption and community support
- Easy to cache (standard HTTP caching)
- Simple to debug (browser, curl)
### Negative
- Over-fetching/under-fetching compared to GraphQL
- Multiple API calls needed for complex data (N+1 problem)
- Less efficient than gRPC for high-performance needs
- Versioning can be challenging
### Risks
- **Risk**: API changes break clients
- **Mitigation**: Use API versioning, maintain backward compatibility, communicate changes
- **Risk**: Performance issues with multiple round trips
- **Mitigation**: Implement BFF (Backend for Frontend) pattern for complex client needs
- **Risk**: Inconsistent API design across services
- **Mitigation**: Establish API design guidelines, code reviews, linting
## Alternatives Considered
### Alternative 1: GraphQL
- **Description**: Single GraphQL endpoint for all data queries
- **Pros**: Solves over-fetching, single round trip, strong typing, excellent developer experience
- **Cons**: Team learning curve, caching complexity, query complexity attacks, less mature in microservices
- **Why Rejected**: Team lacks GraphQL experience, adds complexity for our needs
### Alternative 2: gRPC
- **Description**: Protocol Buffers over HTTP/2
- **Pros**: Better performance, streaming, strong typing, efficient binary protocol
- **Cons**: Not browser-friendly, requires special tooling, team learning curve, harder to debug
- **Why Rejected**: Web client support is important, and we don't have extreme performance requirements that justify gRPC complexity
### Alternative 3: Hybrid (REST + GraphQL BFF)
- **Description**: REST for service-to-service, GraphQL BFF for clients
- **Pros**: Flexibility, optimized for each use case
- **Cons**: Maintaining two API styles, increased complexity
- **Why Rejected**: Added complexity not justified at our current scale
## Implementation Notes
- Use OpenAPI 3.0 for all API specifications
- Generate client libraries from OpenAPI specs
- Implement API Gateway (Kong) for cross-cutting concerns
- Standard error response format: `{"error": {"code": "ERROR_CODE", "message": "Human readable message"}}`
- Use HAL or JSON:API for hypermedia (future consideration)
## References
- [OpenAPI Specification](https://swagger.io/specification/)
- [REST API Design Rulebook](https://www.oreilly.com/library/view/rest-api-design/9781449317904/)
- Internal API Design Guidelines: [Link]---
Tips for Writing Effective ADRs
1. Write When the Decision is Made: Document while context is fresh 2. Be Specific: Avoid vague statements; include concrete details 3. Show Your Work: Explain alternatives and why they were rejected 4. Think Long-Term: Consider how this decision affects future decisions 5. Update Status: Mark as SUPERSEDED when decision changes 6. Link Related ADRs: Create a decision chain 7. Keep It Concise: Aim for 1-2 pages; link to detailed docs 8. Use Simple Language: Write for future team members who weren't part of the decision
When to Write an ADR
Write an ADR for:
- Architectural style decisions (monolith vs microservices)
- Technology selections (database, frameworks)
- Significant pattern adoptions (CQRS, event sourcing)
- Infrastructure decisions (cloud provider, Kubernetes)
- Major refactoring decisions
- Security architecture choices
- Data architecture decisions
- Integration pattern selections
Don't write an ADR for:
- Minor implementation details
- Easily reversible decisions
- Team process decisions (usually)
- Routine technology updates
Architecture Design Process
Follow this systematic approach when designing software architectures:
Phase 1: Discovery & Requirements
1. Gather Requirements
- Functional requirements (features, use cases)
- Non-functional requirements (performance, scalability, security)
- Business constraints (budget, timeline, compliance)
- Technical constraints (existing systems, team skills)
2. Analyze Architecture Drivers
- Performance requirements (latency, throughput)
- Scalability needs (user growth, data volume)
- Availability targets (uptime SLA, disaster recovery)
- Security requirements (authentication, authorization, compliance)
- Maintainability goals (testability, modularity)
3. Define System Context
- Identify stakeholders
- Map external systems and dependencies
- Define system boundaries
- Identify integration points
Phase 2: Architecture Design
1. Choose Architecture Style
- Monolithic: Single deployable unit, shared database
- Use for: Simple applications, MVPs, small teams
- Modular Monolithic: Organized modules, single deployment
- Use for: Medium complexity, clear domain boundaries
- Microservices: Independent services, separate databases
- Use for: Large scale, team autonomy, different tech stacks
- Serverless: Function-based, managed infrastructure
- Use for: Event-driven, variable load, cost optimization
- Event-Driven: Asynchronous communication, event streams
- Use for: Real-time processing, loose coupling, scalability
2. Design System Components
- Presentation Layer: Web, mobile, desktop interfaces
- API Layer: REST, GraphQL, gRPC endpoints
- Application Layer: Business logic, orchestration
- Domain Layer: Core business entities and rules
- Data Layer: Databases, caches, data stores
- Integration Layer: External APIs, message brokers
3. Define Data Architecture
- Data models and schemas
- Database selection (transactional, analytical, operational)
- Data flow and transformation pipelines
- Caching strategies (in-memory, distributed)
- Data consistency models (eventual, strong)
4. Design Integration Patterns
- Synchronous: REST APIs, GraphQL, gRPC
- Asynchronous: Message queues (Kafka, RabbitMQ), event streams
- Batch: ETL processes, scheduled jobs
- Real-time: WebSockets, Server-Sent Events
Phase 3: Quality Attributes
Address key quality attributes in your design:
1. Scalability
- Horizontal scaling: Load balancers, stateless services
- Vertical scaling: Resource optimization
- Database scaling: Read replicas, sharding, partitioning
- Caching: Redis, Memcached, CDN
- Auto-scaling: Cloud-native scaling policies
2. Performance
- Response time optimization
- Throughput maximization
- Resource utilization efficiency
- Database query optimization
- Caching strategies
- Asynchronous processing
3. Security
- Authentication: OAuth 2.0, OpenID Connect, SAML
- Authorization: RBAC, ABAC, policy-based
- Data encryption: At rest, in transit (TLS/SSL)
- API security: API keys, rate limiting, WAF
- Network security: VPC, firewalls, security groups
- Compliance: GDPR, HIPAA, PCI-DSS
4. Reliability & Availability
- Fault tolerance: Redundancy, failover
- Resilience patterns: Circuit breakers, retries, timeouts
- Health monitoring: Liveness, readiness probes
- Disaster recovery: Backups, replication, multi-region
- SLA targets: 99.9%, 99.99%, 99.999%
5. Maintainability
- Code organization: Clean architecture, SOLID principles
- Modularity: Domain-driven design, bounded contexts
- Testability: Unit, integration, e2e tests
- Documentation: Code comments, API docs, architecture docs
- Monitoring: Logging, metrics, tracing
Phase 4: Technology Selection
Recommend appropriate technologies based on requirements:
1. Backend Technologies
- Java/Spring Boot: Enterprise, microservices, strong typing
- Node.js/Express: JavaScript, async I/O, real-time
- Python/Django/FastAPI: Rapid development, data science, ML
- .NET Core: Microsoft ecosystem, enterprise
- Go: High performance, concurrency, cloud-native
- Rust: System programming, performance-critical
2. Frontend Technologies
- React: Component-based, large ecosystem, SPA
- Vue.js: Progressive, flexible, easy learning curve
- Angular: Full framework, TypeScript, enterprise
- Next.js: React SSR, static generation, full-stack
- Mobile: React Native, Flutter, native (Swift/Kotlin)
3. Databases
- Relational: PostgreSQL, MySQL, Oracle (ACID, complex queries)
- NoSQL Document: MongoDB, CouchDB (flexible schema, JSON)
- NoSQL Key-Value: Redis, DynamoDB (caching, sessions)
- NoSQL Column: Cassandra, HBase (time-series, high write)
- NoSQL Graph: Neo4j, Amazon Neptune (relationships, networks)
- Search: Elasticsearch, Solr (full-text search, analytics)
4. Cloud Platforms
- AWS: Comprehensive services, market leader
- Azure: Microsoft integration, enterprise
- GCP: Data analytics, machine learning, Kubernetes
- Multi-cloud: Avoid vendor lock-in, regional presence
5. DevOps & Infrastructure
- Containers: Docker, Kubernetes, ECS, AKS
- CI/CD: GitHub Actions, GitLab CI, Jenkins, CircleCI
- IaC: Terraform, CloudFormation, Pulumi
- Monitoring: Prometheus, Grafana, DataDog, New Relic
- Logging: ELK Stack, Splunk, CloudWatch
Phase 5: Documentation
Produce comprehensive architecture documentation:
1. Architecture Diagrams (All in Mermaid format)
- C4 Context Diagram: System in its environment (use Mermaid C4Context)
- C4 Container Diagram: High-level technology choices (use Mermaid C4Container)
- C4 Component Diagram: Components within containers (use Mermaid C4Component)
- Sequence Diagrams: Interaction flows (use Mermaid sequenceDiagram)
- Deployment Diagram: Infrastructure and deployment (use Mermaid flowchart or C4Deployment)
2. Architecture Decision Records (ADRs)
# ADR-001: Use Microservices Architecture
## Status
Accepted
## Context
The system needs to support multiple development teams, different
technology stacks, and independent scaling of components.
## Decision
We will implement a microservices architecture with separate services
for user management, ordering, payment, and inventory.
## Consequences
- Positive: Team autonomy, independent scaling, technology flexibility
- Negative: Increased complexity, distributed system challenges
- Risks: Network latency, data consistency, operational overhead3. Technical Specifications
- System overview and goals
- Architecture patterns and principles
- Component descriptions and responsibilities
- Data models and schemas
- API contracts (OpenAPI/Swagger)
- Infrastructure requirements
- Security controls
- Monitoring and observability strategy
4. Implementation Roadmap
- Phase 1: Foundation (core services, infrastructure)
- Phase 2: Core features (business logic, APIs)
- Phase 3: Integration (external systems, third-party)
- Phase 4: Advanced features (analytics, ML)
- Migration strategy (if applicable)
- Risk mitigation plans
Architecture Patterns Reference
Detailed descriptions of common architecture patterns with use cases, benefits, and trade-offs.
Visual Overview
Layered Architecture
┌─────────────────────────────────┐
│ Presentation Layer │ (UI, Controllers)
├─────────────────────────────────┤
│ Application Layer │ (Use Cases, Orchestration)
├─────────────────────────────────┤
│ Domain Layer │ (Business Logic, Entities)
├─────────────────────────────────┤
│ Infrastructure Layer │ (DB, External APIs)
└─────────────────────────────────┘Microservices Architecture
┌──────────┐ ┌──────────┐ ┌──────────┐
│ API │────▶│ Service │────▶│ Service │
│ Gateway │ │ A │ │ B │
└──────────┘ └─────┬────┘ └─────┬────┘
│ │
┌────▼────┐ ┌───▼────┐
│ DB │ │ DB │
└─────────┘ └────────┘Event-Driven Architecture
┌─────────┐ ┌─────────────┐ ┌─────────┐
│Producer │──────▶│ Event Bus/ │──────▶│Consumer │
│Service │ │Message Queue│ │Service │
└─────────┘ └─────────────┘ └─────────┘Hexagonal Architecture (Clean Architecture)
┌────────────────────────┐
│ UI / Controllers │
└───────────┬────────────┘
│
┌───────────▼────────────┐
│ Application Layer │
│ (Use Cases/Ports) │
└───────────┬────────────┘
│
┌───────────▼────────────┐
│ Domain Layer │
│ (Business Rules) │
└───────────┬────────────┘
│
┌───────────▼────────────┐
│ Adapters (DB, API) │
└────────────────────────┘---
1. Monolithic Architecture
Description
All application components are packaged and deployed as a single unit.
When to Use
- Small to medium applications
- Simple business domain
- Small development team
- MVP or prototypes
- Tight deadlines
Benefits
- Simple to develop and deploy
- Easy to test end-to-end
- Simple debugging
- No network overhead
- Strong consistency
Trade-offs
- Scaling limitations (must scale entire app)
- Technology lock-in
- Longer build and deployment times
- Difficult to maintain as size grows
- Team coordination challenges
Example Stack
- Backend: Spring Boot monolith
- Database: PostgreSQL
- Deployment: Single JAR/WAR on server
---
2. Microservices Architecture
Description
Application is composed of small, independently deployable services organized around business capabilities.
When to Use
- Large, complex applications
- Multiple development teams
- Need for independent scaling
- Different technology requirements
- Long-term projects
Benefits
- Independent deployment and scaling
- Technology diversity
- Fault isolation
- Team autonomy
- Easier to understand individual services
Trade-offs
- Increased complexity
- Distributed system challenges
- Network latency
- Data consistency challenges
- Higher operational overhead
- Testing complexity
Key Components
- API Gateway
- Service Discovery (Consul, Eureka)
- Configuration Management
- Circuit Breakers
- Distributed Tracing
Example Stack
- Services: Node.js, Python, Go
- Communication: REST, gRPC, Kafka
- Service Mesh: Istio, Linkerd
- Container Orchestration: Kubernetes
---
3. Event-Driven Architecture
Description
Services communicate through events, promoting loose coupling and asynchronous processing.
When to Use
- Real-time data processing
- Loose coupling requirements
- High scalability needs
- Complex workflows
- Integration with multiple systems
Benefits
- Loose coupling
- High scalability
- Asynchronous processing
- Event replay capability
- Better fault tolerance
Trade-offs
- Eventual consistency
- Debugging complexity
- Message ordering challenges
- Infrastructure complexity
- Duplicate message handling
Key Patterns
- Event Sourcing
- CQRS (Command Query Responsibility Segregation)
- Saga Pattern for distributed transactions
Example Stack
- Message Broker: Kafka, RabbitMQ, AWS SNS/SQS
- Event Store: EventStoreDB, Kafka
- Processing: Apache Flink, Kafka Streams
---
4. Serverless Architecture
Description
Application logic runs in stateless compute containers that are event-triggered and managed by cloud provider.
When to Use
- Variable or unpredictable workloads
- Event-driven workflows
- Rapid prototyping
- Cost optimization
- Infrequent processing
Benefits
- No server management
- Automatic scaling
- Pay per execution
- Built-in high availability
- Fast time to market
Trade-offs
- Cold start latency
- Vendor lock-in
- Limited execution time
- Stateless constraints
- Testing challenges
Example Stack
- Functions: AWS Lambda, Azure Functions, Google Cloud Functions
- API: API Gateway
- Storage: S3, DynamoDB
- Events: EventBridge, SQS
---
5. Layered (N-Tier) Architecture
Description
Organizes application into horizontal layers, each with specific responsibility.
Typical Layers
1. Presentation Layer: UI, API controllers 2. Application Layer: Business workflows, use cases 3. Domain Layer: Core business logic and entities 4. Data Access Layer: Database operations 5. Infrastructure Layer: External services, utilities
When to Use
- Traditional web applications
- Enterprise applications
- Clear separation of concerns needed
- Team specialization by layer
Benefits
- Clear separation of concerns
- Easy to understand
- Testability
- Team organization
- Reusable components
Trade-offs
- Can become monolithic
- Changes may ripple across layers
- Potentially over-engineered for simple apps
- Layer coupling risks
---
6. Hexagonal Architecture (Ports and Adapters)
Description
Places business logic at the center, with external concerns (UI, database) as adapters connected through ports.
Core Concepts
- Domain Core: Business logic independent of external concerns
- Ports: Interfaces defining communication
- Adapters: Implementations of ports for specific technologies
When to Use
- Domain-driven design
- Test-driven development
- Technology-agnostic business logic
- Long-term maintainability
Benefits
- Technology independence
- Excellent testability
- Clear boundaries
- Easy to swap implementations
- Business logic isolation
Trade-offs
- Initial complexity
- More abstractions
- Learning curve
- Overhead for simple apps
---
7. CQRS (Command Query Responsibility Segregation)
Description
Separates read and write operations into different models.
When to Use
- Complex domain logic
- Different read/write patterns
- High read/write ratio disparity
- Event-sourced systems
- Need for different data representations
Benefits
- Optimized read and write models
- Independent scaling
- Better performance
- Simplified queries
- Event-driven integration
Trade-offs
- Increased complexity
- Eventual consistency
- Data synchronization
- More infrastructure
- Learning curve
---
8. Service-Oriented Architecture (SOA)
Description
Services communicate through an Enterprise Service Bus (ESB), providing shared business functionality.
When to Use
- Enterprise integration
- Legacy system integration
- Shared services across organization
- Complex protocols and transformations
Benefits
- Service reuse
- Enterprise integration
- Protocol flexibility
- Centralized governance
Trade-offs
- ESB as single point of failure
- Performance overhead
- Complexity
- Vendor lock-in risks
---
9. Space-Based Architecture
Description
Minimizes database bottlenecks by using in-memory data grids and distributed caching.
When to Use
- High scalability requirements
- Elastic scaling needs
- Variable user loads
- Read/write intensive applications
Benefits
- Near-linear scalability
- High availability
- Elastic scalability
- Reduced database load
Trade-offs
- Complex implementation
- Data consistency challenges
- Expensive infrastructure
- Specialized expertise needed
---
10. Micro-Frontend Architecture
Description
Frontend application is composed of independent, loosely coupled micro-apps.
When to Use
- Large frontend applications
- Multiple frontend teams
- Different framework requirements
- Independent deployment needs
Benefits
- Team autonomy
- Technology diversity
- Independent deployment
- Parallel development
Trade-offs
- Increased complexity
- Code duplication risks
- Performance overhead
- Consistent UX challenges
Implementation Approaches
- Server-side composition
- Client-side composition (Module Federation)
- Web Components
- iFrame-based
---
Pattern Selection Matrix
| Pattern | Complexity | Scalability | Team Size | Cost |
|---|---|---|---|---|
| Monolithic | Low | Limited | Small | Low |
| Microservices | High | Excellent | Large | High |
| Event-Driven | High | Excellent | Medium-Large | Medium-High |
| Serverless | Medium | Excellent | Any | Variable |
| Layered | Low-Medium | Medium | Any | Low-Medium |
| Hexagonal | Medium | Medium | Any | Medium |
| CQRS | High | Excellent | Medium-Large | High |
| SOA | High | Good | Large | High |
Combining Patterns
Patterns are not mutually exclusive. Common combinations:
- Microservices + Event-Driven: Services communicate via events
- CQRS + Event Sourcing: Commands create events, queries read projections
- Hexagonal + Microservices: Each microservice uses hexagonal internally
- Layered + CQRS: Separate layers for commands and queries
- Serverless + Event-Driven: Lambda functions triggered by events
Anti-Patterns to Avoid
1. Distributed Monolith: Microservices with tight coupling 2. Anemic Domain Model: Domain objects with no business logic 3. God Service: Service that does too much 4. Chatty Services: Too many fine-grained service calls 5. Shared Database: Multiple services accessing same database tables 6. Premature Distribution: Splitting into services too early
Best Practices
1. Design Principles
- SOLID principles for object-oriented design
- DRY (Don't Repeat Yourself)
- KISS (Keep It Simple, Stupid)
- YAGNI (You Aren't Gonna Need It)
- Separation of concerns
- Loose coupling, high cohesion
2. API Design
- RESTful conventions (proper HTTP verbs, status codes)
- Consistent naming and formatting
- Versioning strategy
- Pagination for large datasets
- Rate limiting and throttling
- Comprehensive documentation (OpenAPI)
3. Security First
- Defense in depth
- Principle of least privilege
- Input validation and sanitization
- Secure authentication and authorization
- Encryption at rest and in transit
- Regular security audits
4. Operational Excellence
- Infrastructure as Code
- Automated testing (unit, integration, e2e)
- Continuous integration and deployment
- Comprehensive monitoring and alerting
- Distributed tracing
- Disaster recovery planning
5. Cost Optimization
- Right-size resources
- Use auto-scaling
- Leverage spot instances (where appropriate)
- Implement caching effectively
- Optimize database queries
- Monitor and analyze costs regularly
Common Anti-Patterns to Avoid
1. Big Ball of Mud: Unstructured, tangled architecture 2. Golden Hammer: Using same solution for all problems 3. Premature Optimization: Optimizing before measuring 4. God Object: Single class/service doing too much 5. Distributed Monolith: Microservices with tight coupling 6. Database as Integration Point: Services sharing database 7. Chatty Interfaces: Too many small network calls 8. Ignoring Non-Functional Requirements: Focusing only on features
Design Considerations
For Different Scale Levels
Small Scale (< 1K users)
- Monolithic architecture
- Single database instance
- Simple deployment (VM or PaaS)
- Basic monitoring
- Manual scaling
Medium Scale (1K - 100K users)
- Modular monolithic or early microservices
- Database read replicas
- Load balancing
- Caching layer
- Container orchestration
- Auto-scaling
Large Scale (100K - 1M+ users)
- Full microservices architecture
- Distributed data stores
- Multiple caching layers
- CDN for static content
- Multi-region deployment
- Advanced monitoring and observability
- Chaos engineering
For Different Domains
E-Commerce
- Product catalog service
- Shopping cart and order management
- Payment processing integration
- Inventory management
- Search and recommendation
- User reviews and ratings
Financial Services
- Account management
- Transaction processing
- Fraud detection
- Regulatory compliance
- Audit logging
- High security requirements
SaaS Applications
- Multi-tenancy architecture
- Subscription management
- Usage metering and billing
- User onboarding
- Analytics and reporting
IoT/Real-Time Systems
- Time-series data storage
- Event streaming
- Edge computing
- Device management
- Real-time analytics
Examples
Example 1: E-Commerce Platform
Requirements: Build a scalable e-commerce platform handling 100K daily active users
Architecture Design:
- Style: Microservices with event-driven communication
- Services: Product Catalog, User Service, Order Management, Payment Processing, Inventory
- Technology: Node.js/Express, React, PostgreSQL, MongoDB, Redis, Kafka
- Infrastructure: AWS with EKS, RDS, ElastiCache, S3, CloudFront
- Key Patterns: API Gateway, CQRS for orders, Event Sourcing for inventory
Example 2: Real-Time Analytics Dashboard
Requirements: Process and visualize millions of events per minute
Architecture Design:
- Style: Event-driven, Lambda architecture
- Components: Event ingestion, stream processing, batch processing, query layer
- Technology: Kafka, Apache Flink, Elasticsearch, React, WebSocket
- Infrastructure: AWS with MSK, EMR, OpenSearch, Lambda
- Key Patterns: Event streaming, CQRS, real-time aggregation
Migration Patterns
When migrating from legacy systems:
Strangler Fig Pattern
- Gradually replace legacy functionality
- Run old and new systems in parallel
- Route traffic incrementally to new system
- Decommission old components progressively
Anti-Corruption Layer
- Create abstraction layer between old and new
- Translate between different models
- Protect new system from legacy complexity
Database Migration Strategies
- Big Bang: Complete cutover (high risk, minimal complexity)
- Trickle Migration: Gradual data migration (lower risk, higher complexity)
- Change Data Capture: Real-time synchronization during migration
Resources and References
For additional guidance:
- Books: "Designing Data-Intensive Applications", "Software Architecture Patterns", "Building Microservices"
- Frameworks: AWS Well-Architected Framework, Azure Architecture Center, Google Cloud Architecture Framework
- Patterns: Enterprise Integration Patterns, Cloud Design Patterns
- Standards: ISO 25010 (Software Quality), ISO 27001 (Security)
Technology Stack Selection Guide
Comprehensive guide for selecting appropriate technologies for different architectural components.
Backend Technologies
Java Ecosystem
Spring Boot
- Best For: Enterprise applications, microservices, REST APIs
- Strengths: Mature ecosystem, dependency injection, comprehensive features
- Weaknesses: Slower startup, higher memory usage
- Use Cases: Financial services, enterprise systems, complex business logic
- When to Choose: Large teams, long-term maintenance, strong typing needs
Quarkus
- Best For: Cloud-native, serverless, microservices
- Strengths: Fast startup, low memory footprint, Kubernetes-native
- Weaknesses: Smaller ecosystem than Spring
- Use Cases: Containerized applications, serverless functions
- When to Choose: Cloud-native applications, resource efficiency important
JavaScript/TypeScript
Node.js + Express
- Best For: APIs, real-time applications, microservices
- Strengths: Async I/O, JavaScript everywhere, large ecosystem
- Weaknesses: Single-threaded, callback complexity
- Use Cases: Real-time apps, APIs, streaming services
- When to Choose: JavaScript team, I/O-heavy workloads
NestJS
- Best For: Enterprise Node.js applications
- Strengths: TypeScript, structured, Angular-like, built-in features
- Weaknesses: Learning curve, opinionated
- Use Cases: Large Node.js applications, microservices
- When to Choose: Need structure, TypeScript preference, large teams
Fastify
- Best For: High-performance APIs
- Strengths: Very fast, low overhead, schema validation
- Weaknesses: Smaller ecosystem than Express
- Use Cases: Performance-critical APIs
- When to Choose: Speed is priority
Python
Django
- Best For: Full-featured web applications
- Strengths: Batteries included, ORM, admin interface, rapid development
- Weaknesses: Monolithic, opinionated, slower performance
- Use Cases: Content management, admin dashboards, MVP
- When to Choose: Rapid development, full-stack framework needed
FastAPI
- Best For: Modern APIs, microservices
- Strengths: Fast, async, automatic API docs, type hints
- Weaknesses: Newer, smaller ecosystem
- Use Cases: REST APIs, microservices, ML model serving
- When to Choose: Modern Python API, async support, automatic docs
Flask
- Best For: Lightweight APIs, microservices
- Strengths: Minimal, flexible, easy to learn
- Weaknesses: Less built-in features, more setup needed
- Use Cases: Simple APIs, microservices, prototypes
- When to Choose: Minimal framework, full control needed
Go
Gin / Echo / Fiber
- Best For: High-performance APIs, microservices
- Strengths: Fast, concurrent, compiled, low memory
- Weaknesses: Verbose error handling, fewer libraries
- Use Cases: Cloud-native services, high-throughput APIs
- When to Choose: Performance critical, concurrent workloads
.NET
ASP.NET Core
- Best For: Enterprise applications, Windows integration
- Strengths: High performance, cross-platform, strong typing
- Weaknesses: Windows-centric historically
- Use Cases: Enterprise systems, Microsoft stack
- When to Choose: C# team, Microsoft ecosystem, enterprise needs
Ruby
Ruby on Rails
- Best For: Web applications, MVPs
- Strengths: Convention over configuration, rapid development
- Weaknesses: Performance, monolithic
- Use Cases: Startups, MVP, content-driven sites
- When to Choose: Speed to market, developer happiness
---
Frontend Technologies
React
- Best For: SPAs, complex UIs, component reusability
- Strengths: Large ecosystem, flexible, virtual DOM, strong community
- Weaknesses: Just a library, boilerplate, rapid changes
- Use Cases: Dashboards, social apps, e-commerce
- When to Choose: Large community, flexibility, component focus
Vue.js
- Best For: Progressive enhancement, SPAs
- Strengths: Easy to learn, flexible, good docs, gradual adoption
- Weaknesses: Smaller ecosystem, less corporate backing
- Use Cases: Small to medium apps, progressive enhancement
- When to Choose: Easy learning, gradual migration
Angular
- Best For: Enterprise SPAs
- Strengths: Complete framework, TypeScript, opinionated, structured
- Weaknesses: Steep learning curve, verbose, heavy
- Use Cases: Large enterprise applications
- When to Choose: Enterprise, TypeScript, full framework
Next.js (React)
- Best For: SSR, SSG, full-stack React
- Strengths: SEO, fast initial load, API routes, hybrid rendering
- Weaknesses: Vendor lock-in (Vercel), complexity
- Use Cases: Marketing sites, e-commerce, blogs
- When to Choose: SEO important, static + dynamic content
Svelte/SvelteKit
- Best For: Modern web apps, performance-critical UIs
- Strengths: No virtual DOM, small bundle size, fast, easy syntax
- Weaknesses: Smaller ecosystem, fewer jobs
- Use Cases: Performance-critical apps, modern projects
- When to Choose: Performance priority, fresh start
Mobile: React Native
- Best For: Cross-platform mobile apps
- Strengths: Code sharing, hot reload, native performance
- Weaknesses: Native bridge overhead, platform differences
- Use Cases: iOS + Android apps with shared codebase
- When to Choose: React team, cross-platform target
Mobile: Flutter
- Best For: High-performance cross-platform apps
- Strengths: Beautiful UI, fast, hot reload, single codebase
- Weaknesses: Dart language, large app size
- Use Cases: Feature-rich mobile apps
- When to Choose: UI quality priority, cross-platform
---
Databases
Relational (SQL)
PostgreSQL
- Best For: General-purpose, complex queries, data integrity
- Strengths: ACID, JSON support, extensions, reliability
- Weaknesses: Vertical scaling limits
- Use Cases: OLTP, complex queries, data warehousing
- When to Choose: Default choice for relational needs
MySQL / MariaDB
- Best For: Web applications, read-heavy workloads
- Strengths: Fast reads, widespread adoption, simple replication
- Weaknesses: Less feature-rich than PostgreSQL
- Use Cases: WordPress, web apps, read-heavy
- When to Choose: Simple relational needs, wide compatibility
Oracle
- Best For: Enterprise, mission-critical
- Strengths: Feature-rich, scalability, support
- Weaknesses: Expensive, complex, vendor lock-in
- Use Cases: Large enterprises, financial systems
- When to Choose: Enterprise requirements, budget available
NoSQL Document
MongoDB
- Best For: Flexible schemas, rapid development
- Strengths: JSON documents, flexible schema, easy to scale
- Weaknesses: No ACID across documents (traditionally)
- Use Cases: Content management, catalogs, user profiles
- When to Choose: Flexible schema, rapid iteration
CouchDB
- Best For: Offline-first applications
- Strengths: Multi-master replication, HTTP API, conflicts handling
- Weaknesses: Less adoption, performance
- Use Cases: Mobile sync, distributed apps
- When to Choose: Offline-first, conflict resolution
NoSQL Key-Value
Redis
- Best For: Caching, sessions, real-time analytics
- Strengths: In-memory, fast, data structures, pub/sub
- Weaknesses: Data must fit in memory, persistence limitations
- Use Cases: Cache, sessions, leaderboards, queues
- When to Choose: Speed critical, caching layer
Amazon DynamoDB
- Best For: Serverless, predictable performance
- Strengths: Fully managed, auto-scaling, low latency
- Weaknesses: AWS lock-in, query limitations, cost
- Use Cases: Serverless apps, user sessions, IoT
- When to Choose: AWS environment, serverless architecture
NoSQL Column-Family
Apache Cassandra
- Best For: Time-series, high write throughput
- Strengths: Linear scalability, high availability, distributed
- Weaknesses: Eventual consistency, complex operations
- Use Cases: Time-series, IoT, activity logs
- When to Choose: Massive scale, write-heavy, always available
Apache HBase
- Best For: Big data analytics
- Strengths: Hadoop integration, consistency, scale
- Weaknesses: Complex, operational overhead
- Use Cases: Large analytics, Hadoop ecosystem
- When to Choose: Hadoop stack, consistency + scale
NoSQL Graph
Neo4j
- Best For: Relationship-heavy data
- Strengths: Relationship queries, Cypher language, performance
- Weaknesses: Scaling challenges, cost
- Use Cases: Social networks, recommendations, fraud detection
- When to Choose: Many relationships, graph queries
Search Engines
Elasticsearch
- Best For: Full-text search, log analytics
- Strengths: Fast search, analytics, scalable, ecosystem (ELK)
- Weaknesses: Memory-hungry, operational complexity
- Use Cases: Search, log analysis, metrics
- When to Choose: Full-text search, log aggregation
Apache Solr
- Best For: Enterprise search
- Strengths: Mature, feature-rich, faceted search
- Weaknesses: Complex configuration
- Use Cases: E-commerce search, document search
- When to Choose: Enterprise search requirements
Time-Series
InfluxDB
- Best For: Time-series data, metrics
- Strengths: Optimized for time-series, retention policies, SQL-like
- Weaknesses: Limited query capabilities
- Use Cases: Monitoring, IoT, analytics
- When to Choose: Time-series workload, metrics storage
TimescaleDB
- Best For: Time-series with SQL
- Strengths: PostgreSQL extension, SQL support, reliability
- Weaknesses: Not as optimized as specialized databases
- Use Cases: Time-series with relational needs
- When to Choose: Need SQL, PostgreSQL ecosystem
---
Message Brokers & Event Streaming
Apache Kafka
- Best For: Event streaming, high throughput
- Strengths: High throughput, durable, scalable, replay
- Weaknesses: Complex setup, operational overhead
- Use Cases: Event streaming, log aggregation, CDC
- When to Choose: Event streaming, high volume, replay needed
RabbitMQ
- Best For: Traditional messaging, task queues
- Strengths: Flexible routing, reliable, protocols support
- Weaknesses: Lower throughput than Kafka
- Use Cases: Task queues, RPC, routing
- When to Choose: Complex routing, traditional messaging
AWS SQS/SNS
- Best For: Serverless, AWS environments
- Strengths: Fully managed, scalable, reliable
- Weaknesses: AWS lock-in, costs
- Use Cases: Serverless, decoupling services
- When to Choose: AWS environment, managed service
NATS
- Best For: Lightweight messaging, microservices
- Strengths: Simple, fast, lightweight
- Weaknesses: Fewer features, less adoption
- Use Cases: Microservices communication, IoT
- When to Choose: Simplicity, performance, lightweight
---
Cloud Platforms
AWS (Amazon Web Services)
- Strengths: Most mature, comprehensive services, market leader
- Best For: Full cloud adoption, diverse workloads
- Key Services: EC2, S3, RDS, Lambda, EKS, DynamoDB
- When to Choose: Need most services, largest ecosystem
Microsoft Azure
- Strengths: Microsoft integration, hybrid cloud, enterprise
- Best For: Microsoft shops, hybrid cloud, enterprise
- Key Services: VMs, Blob Storage, SQL Database, Functions, AKS
- When to Choose: Microsoft ecosystem, hybrid needs
Google Cloud Platform (GCP)
- Strengths: Data analytics, ML, Kubernetes
- Best For: Data science, ML, Kubernetes
- Key Services: Compute Engine, Cloud Storage, BigQuery, GKE
- When to Choose: Data/ML focus, Kubernetes expertise
---
Container & Orchestration
Docker
- Purpose: Containerization
- When to Use: All modern applications
- Alternatives: Podman, containerd
Kubernetes (K8s)
- Purpose: Container orchestration
- Best For: Microservices, cloud-native, production-grade
- When to Use: Multiple containers, auto-scaling, self-healing
- Alternatives: Docker Swarm (simpler), ECS, Nomad
Docker Compose
- Purpose: Local development, simple deployments
- Best For: Development, small deployments
- When to Use: Local multi-container apps, simple production
---
CI/CD Tools
GitHub Actions
- Best For: GitHub repos, integrated experience
- Strengths: GitHub integration, free for public repos
- When to Choose: Using GitHub, simple workflows
GitLab CI
- Best For: GitLab users, full DevOps platform
- Strengths: Integrated with GitLab, powerful features
- When to Choose: Using GitLab, comprehensive DevOps
Jenkins
- Best For: Complex pipelines, self-hosted
- Strengths: Mature, flexible, extensible
- When to Choose: Complex needs, self-hosted, legacy
CircleCI / Travis CI
- Best For: Cloud-based CI/CD
- Strengths: Easy setup, cloud-hosted
- When to Choose: Quick setup, no maintenance
---
Monitoring & Observability
Prometheus + Grafana
- Best For: Metrics, Kubernetes monitoring
- Strengths: Open-source, powerful, flexible
- When to Choose: Self-hosted, Kubernetes, open-source
Datadog
- Best For: Full-stack monitoring
- Strengths: Comprehensive, easy setup, integrations
- When to Choose: Budget available, want comprehensive monitoring
New Relic
- Best For: APM, full-stack observability
- Strengths: APM, easy integration, detailed insights
- When to Choose: APM focus, managed solution
ELK Stack (Elasticsearch, Logstash, Kibana)
- Best For: Log aggregation and analysis
- Strengths: Powerful search, visualization, open-source
- When to Choose: Log-centric, search capabilities
---
Decision Matrix
For Different Project Sizes
Startup / MVP
- Backend: Node.js/Express, Python/FastAPI
- Frontend: Next.js, React
- Database: PostgreSQL, MongoDB
- Hosting: Vercel, Heroku, AWS Amplify
- Why: Speed to market, flexibility, cost
Small Business
- Backend: Ruby on Rails, Django, Laravel
- Frontend: Vue.js, React
- Database: PostgreSQL, MySQL
- Hosting: DigitalOcean, AWS
- Why: All-in-one frameworks, simplicity
Enterprise
- Backend: Java/Spring, .NET Core
- Frontend: Angular, React
- Database: PostgreSQL, Oracle
- Hosting: AWS, Azure, private cloud
- Why: Stability, support, compliance
High Scale
- Backend: Go, Java, Node.js microservices
- Frontend: React, Next.js with CDN
- Database: PostgreSQL + Redis + DynamoDB
- Hosting: Kubernetes on AWS/GCP
- Why: Performance, scalability, flexibility
Related skills
FAQ
What deliverables does it produce?
C4 Mermaid diagrams, ADRs, specs, API contracts, and implementation roadmaps.
Does it cover non-functional requirements?
Yes; it analyzes performance, scalability, availability, and security drivers.
Which architecture styles are supported?
Layered, microservices, event-driven, serverless, and modular monolith patterns.