# Tech Stack

This is the **DEFINITIVE technology selection** for Fapilog v3. These choices will serve as the single source of truth for all development.

Based on your async-first requirements, performance targets, and enterprise compliance needs, here are my recommendations:

## Technology Stack Table

| Category                | Technology         | Version  | Purpose                              | Rationale                                                        |
| ----------------------- | ------------------ | -------- | ------------------------------------ | ---------------------------------------------------------------- |
| **Language**            | Python             | 3.8+     | Core development language            | Async/await native support, typing, wide enterprise adoption     |
| **Framework**           | FastAPI            | 0.100+   | API framework for integrations       | Async-first, Pydantic v2 integration, excellent performance      |
| **Type System**         | Pydantic           | v2       | Data validation and serialization    | Zero-copy serialization, async validation, enterprise compliance |
| **Async Runtime**       | asyncio            | Built-in | Core async operations                | Native Python async, optimal for pipeline architecture           |
| **Plugin Architecture** | importlib.metadata | Built-in | Plugin discovery and loading         | Standard Python approach, no external dependencies               |
| **Configuration**       | Pydantic Settings  | v2       | Environment-based configuration      | Type-safe, async loading, validation for enterprise compliance   |
| **Testing Framework**   | pytest             | 7.4+     | Core testing framework               | Excellent async support via pytest-asyncio                       |
| **Async Testing**       | pytest-asyncio     | 0.21+    | Async test support                   | Essential for async-first testing strategy                       |
| **Performance Testing** | pytest-benchmark   | 4.0+     | Performance regression testing       | Critical for 500K-2M events/second validation                    |
| **Type Checking**       | mypy               | 1.5+     | Static type analysis                 | 100% async type coverage requirement                             |
| **Linting**             | ruff               | 0.0.280+ | Code quality and formatting          | Fastest Python linter, async-aware                               |
| **Documentation**       | MkDocs Material    | 9.2+     | Documentation generation             | Beautiful docs for community adoption                            |
| **CLI Framework**       | Typer              | 0.9+     | Command line interface               | FastAPI ecosystem, excellent async support                       |
| **Metrics Collection**  | Prometheus Client  | 0.17+    | Performance metrics                  | Industry standard, enterprise SIEM integration                   |
| **Structured Logging**  | fapilog core       | N/A      | Native structured logging pipeline    | Async-first, zero-copy operations without external frameworks    |
| **Plugin Packaging**    | setuptools         | 68.0+    | Plugin distribution                  | Standard Python packaging via PyPI                               |
| **Container Platform**  | Docker             | 24.0+    | Containerization                     | Enterprise deployment requirements                               |
| **CI/CD**               | GitHub Actions     | Latest   | Continuous integration               | Plugin ecosystem automation                                      |
| **Code Coverage**       | coverage.py        | 7.3+     | Test coverage measurement            | 90%+ coverage requirement                                        |
| **Security Scanning**   | bandit             | 1.7+     | Security vulnerability detection     | Enterprise compliance validation                                 |

## Key Architectural Technology Decisions:

**Async-First Stack:** Every component chosen supports native async/await patterns  
**Zero-Copy Focus:** Pydantic v2 and asyncio enable zero-copy operations throughout  
**Enterprise Ready:** All tools support enterprise compliance and audit requirements  
**Plugin Ecosystem:** Standard Python packaging enables community-driven growth  
**Performance Validated:** All choices validated for 500K-2M events/second targets
