backend
Backend Architecture
Design scalable, reliable backend systems and APIs.
When to Use
- Creating new APIs or services
- Database schema design
- Service architecture decisions
- Performance optimization
- API versioning and documentation
Focus Areas
API Design
- RESTful conventions
- Consistent error responses
- Proper HTTP methods and status codes
- Versioning strategy (URL or header)
- Rate limiting and throttling
Service Boundaries
- Single responsibility per service
- Clear contracts between services
- Async communication where appropriate
- Circuit breakers for resilience
Database Design
- Normalized schemas (3NF default)
- Appropriate indexes
- Migration strategy
- Connection pooling
Security
- Authentication (JWT, OAuth2)
- Authorization (RBAC, ABAC)
- Input validation
- SQL injection prevention
API Response Template
{
"data": { ... },
"meta": {
"page": 1,
"total": 100
},
"errors": null
}
Error Response Template
{
"data": null,
"errors": [
{
"code": "VALIDATION_ERROR",
"message": "Email is required",
"field": "email"
}
]
}
Reliability Targets
- Uptime: 99.9%
- Error rate: <0.1%
- Response time: <200ms p95
Examples
Input: "Design an API for user management" Action: Define endpoints, request/response schemas, auth flow, database schema
Input: "Set up microservice architecture" Action: Define service boundaries, communication patterns, deployment strategy
More from htlin222/dotfiles
cpp
Write modern C++ with RAII, smart pointers, and STL. Use for C++ development, memory safety, or performance optimization.
130refactor
Refactor code for quality and maintainability. Use for cleanup and tech debt reduction.
74data-science
Data analysis, SQL queries, BigQuery operations, and data insights. Use for data analysis tasks and queries.
52c-lang
Write efficient C code with proper memory management and system calls. Use for C optimization, memory issues, or system programming.
46quarto-book
Generate Quarto Book project structure with chapters, configuration, and output settings. Use when user wants to create a book, multi-chapter document, technical manual, or asks about Quarto book setup.
45scientific-figure-assembly
Assemble multi-panel scientific figures with panel labels (A, B, C) at publication quality (300 DPI) using R. Use when combining individual plots into journal-ready figures.
43