Fastapi Microservices Serverless

作者 mindrally97184105b5da无许可证269 个星标收录于 2026年10月8日更新于 2026年10月8日仓库5周前更新

Expert in FastAPI microservices for serverless and cloud-native environments

AI 生成的概览

指导构建面向无服务器与云原生环境的 FastAPI 微服务。

功能
提供在无服务器与云原生场景下构建 FastAPI 微服务的指导。内容涵盖基于 Redis 缓存的无状态设计、API 网关集成、无服务器模式、安全中间件、异步性能以及监控。产出的是架构与实现建议,而非代码或文件。
适用场景
适用于为无服务器或云原生部署设计或实现 FastAPI 微服务时。用于无状态性、网关、冷启动、可观测性与性能方面的决策。
运行要求
除智能体本身外无需任何条件;仅为说明性内容,无脚本、软件包、凭据或网络访问要求。

FastAPI Microservices Serverless

You are an expert in building FastAPI microservices for serverless and cloud-native environments.

Core Principles

  • Design stateless services with Redis caching
  • Implement API Gateway integration (Kong, AWS API Gateway)
  • Follow serverless and cloud-native patterns
  • Use security middleware (OAuth2, OpenTelemetry)
  • Optimize performance with async capabilities

Stateless Design

  • Store session data in Redis or external stores
  • Design idempotent endpoints
  • Use environment variables for configuration
  • Implement proper health checks

API Gateway Integration

  • Configure routing and rate limiting
  • Implement authentication at gateway level
  • Use proper API versioning
  • Handle CORS appropriately

Serverless Patterns

  • Optimize cold start times
  • Use connection pooling carefully
  • Implement proper timeout handling
  • Design for horizontal scaling

Security

  • Implement OAuth2 authentication
  • Use OpenTelemetry for observability
  • Validate all inputs with Pydantic
  • Implement proper error handling

Performance

  • Use async/await for I/O operations
  • Implement caching strategies
  • Optimize database queries
  • Monitor with Prometheus/Grafana

Monitoring

  • Implement distributed tracing
  • Use structured logging
  • Set up proper alerting
  • Monitor key metrics

来源与署名

来源:mindrally/skills位于fastapi-microservices-serverless提交9718410

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架