📊 Capítulo 20: Projeto Integrador: API de Alta Vazão
Especialização Backend com Go & Gin Gonic
🗺️ A Arquitetura do Microsserviço Corporativo de Alta Vazão
flowchart TD
CLIENT["Tráfego HTTP Concorrente (10.000+ RPS)"]
--> GIN["Gin Engine + Rate Limiter Token Bucket"]
--> AUTH["Middleware JWT + RBAC"]
--> HANDLERS["Clean Architecture Handlers (DTO Binding)"]
--> SERVICES["Service Layer com context.WithTimeout"]
SERVICES --> CACHE["Cache Distribuído Redis (go-redis)"]
SERVICES --> DB["PostgreSQL Pool Otimizado com GORM"]
SERVICES --> QUEUE["RabbitMQ Producer Assíncrono"]
SERVICES --> TELEMETRY["Métricas Prometheus & Logs Uber Zap"]
style CLIENT fill:#ede7f6,stroke:#512da8,stroke-width:2px
style GIN fill:#fff3e0,stroke:#ff9800,stroke-width:2px
style AUTH fill:#e1f5fe,stroke:#03a9f4,stroke-width:1.5px
style HANDLERS fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
style SERVICES fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px
style CACHE fill:#fff9c4,stroke:#fbc02d,stroke-width:1.5px
style DB fill:#b2dfdb,stroke:#00796b,stroke-width:2px
style QUEUE fill:#ede7f6,stroke:#7e57c2,stroke-width:1.5px
style TELEMETRY fill:#ffebee,stroke:#d32f2f,stroke-width:1.5px
🎯 Slide 1: O Desafio de Engenharia do Projeto Integrador
-
Missão: Desenvolver uma API backend pronta para produção em Go capaz de suportar picos de tráfego de mais de 10.000 requisições por segundo, com tempo de resposta p99 inferior a 15 milissegundos.
- Componentes: Gin Gonic, Clean Architecture, GORM, Redis Caching, JWT, Rate Limiting, Swag Docs e Docker Scratch.
🎯 Slide 2: Padrões de Resiliência Implementados
-
Context Timeout: 100% das chamadas externas e de banco protegidas contra travamentos infinitos.
- Pool de Conexões Ajustado: Conexões com PostgreSQL e Redis balanceadas para evitar contenção de I/O.
🎯 Slide 3: Checklist de Homologação Final
- Clean Code: Handlers desacoplados de regras de negócio via interfaces.
- Segurança: Autenticação JWT com expiração curta e senhas criptografadas com BCrypt.
- Observabilidade: Métricas exportadas no endpoint
/metricse logs JSON estruturados com Zap. - Deploy: Imagem Docker Scratch estática compilada em menos de 15MB.
Slide 1 de 1
Atalhos: ← → Navegar • Espaço Avançar • F Tela Cheia • Home Início • End Fim