API Gateway (Swift)
Design API gateway and BFF design for a Swift Vapor system.
Parameters
| Name | Label | Required | Default |
|---|---|---|---|
| requirements | Requirements | Yes | - |
| constraints | Constraints | No | - |
| scale | Scale | No | medium |
Prompt Template
Example
Tips
- ✦Start with requirements and constraints — architecture without constraints is fantasy.
- ✦Document trade-offs explicitly — every decision has a downside, hiding it creates technical debt.
- ✦Design for the stated scale, not 10x — over-engineering wastes time and money.
Why
According to the GitHub 2024 survey, 97% of developers use AI tools and AI-assisted architecture design reduces rework by 35% for API gateway and BFF design. API Gateway ensures the system meets its requirements for API gateway and BFF design without over-engineering or under-engineering. Stack Overflow 2024 reports 76% of developers plan to use AI for system design, making AI-assisted architecture a baseline practice.
When
When starting a new system, planning a major refactor, or scaling an existing system beyond its current architecture. Do not use this prompt for minor feature additions or when the architecture is already well-established and stable.
Common Problems
- ⚠Error: designing for hypothetical scale — "built for 1M RPS but actual is 100 RPS, complexity wasted". Fix: design for stated scale with a clear path to 10x.
- ⚠Error: no trade-off documentation — "future architect asks why CQRS was chosen, no answer". Fix: record ADRs with context, decision, and consequences.
- ⚠Error: ignoring constraints — "architecture is perfect but budget allows 2 servers, not 20". Fix: start from constraints and budget, not from ideal.
Best Practices
- ✓Document decisions as ADRs (Architecture Decision Records) with context, decision, and consequences.
- ✓Design for the stated scale with a clear path to the next order of magnitude.
- ✓Involve the team in design reviews — the best architecture is one the team can build and maintain.
FAQ
What is this prompt for and why use it?
Design API gateway and BFF design for a Swift Vapor system. According to the GitHub 2024 survey, 97% of developers use AI tools and AI-assisted architecture design reduces rework by 35% for API gateway and BFF design. API Gateway ensures the system meets its requirements for API gateway and BFF design without over-engi
When should I use this prompt?
When starting a new system, planning a major refactor, or scaling an existing system beyond its current architecture. Do not use this prompt for minor feature additions or when the architecture is already well-establishe
How do I get the best results with this prompt?
Key tips: Start with requirements and constraints — architecture without constraints is fantasy.; Document trade-offs explicitly — every decision has a downside, hiding it creates technical debt.; Design for the stated scale, not 10x — over-engineering wastes time and money..
What common problems should I watch for?
Common problems: Error: designing for hypothetical scale — "built for 1M RPS but actual is 100 RPS, complexity wasted". Fix: design for stated scale with a clear path to 10x.; Error: no trade-off documentation — "future architect asks why CQRS was chosen, no answer". Fix: record ADRs with context, decision, and consequences.; Error: ignoring constraints — "architecture is perfect but budget allows 2 servers, not 20". Fix: start from constraints and budget, not from ideal..
What are the best practices?
Recommended: Document decisions as ADRs (Architecture Decision Records) with context, decision, and consequences.; Design for the stated scale with a clear path to the next order of magnitude.; Involve the team in design reviews — the best architecture is one the team can build and maintain..