Athena

Architecture

Athena API layer, driver layer, and backend execution model.

Athena follows a three-tier architecture:

1. API Layer (src/api/)

  • Validates headers and request envelopes.
  • Resolves routing context (X-Athena-Client, optional JDBC/Supabase overrides).
  • Applies response envelope conventions and route-level auth/rights checks.

2. Driver Layer (src/drivers/)

  • Routes calls to PostgreSQL (SQLx/deadpool), Supabase REST/RPC, or Scylla/CQL.
  • Encapsulates backend-specific execution details while preserving a shared contract.

3. Backend Layer

  • Actual database/storage systems and operational dependencies.
  • Includes optional Redis caching and S3-compatible backup targets.

Request Flow

Client -> API route -> client resolution -> backend driver -> response envelope

Configuration Sources

  • File bootstrap: config.yaml
  • Catalog persistence: athena_logging tables (for clients, stats, keys, jobs)
  • Runtime overrides: environment variables and per-client configuration rows