Skip to content

Feature/model versioning rate limiting pooling graphql#431

Draft
rachealkenny wants to merge 3 commits into
Traqora:mainfrom
rachealkenny:feature/model-versioning-rate-limiting-pooling-graphql
Draft

Feature/model versioning rate limiting pooling graphql#431
rachealkenny wants to merge 3 commits into
Traqora:mainfrom
rachealkenny:feature/model-versioning-rate-limiting-pooling-graphql

Conversation

@rachealkenny

Copy link
Copy Markdown

Description

This PR introduces foundational backend infrastructure to enhance AstroML's scalability, maintainability, and operational resilience.

  • Model Versioning & Registry: Implements semantic versioning for models, integrated with MLflow for experiment tracking. Adds a dedicated registry (astroml/models/registry.py) to manage metadata, performance metrics, rollback capabilities, and A/B testing support, alongside new REST endpoints for model comparison and management.
  • API Rate Limiting: Adds a Redis-backed sliding window rate limiter to protect the API from abuse. Enforces configurable limits by API key and IP address per endpoint, includes admin override capabilities (whitelist/blacklist), and surfaces standard rate-limit headers in all responses with violation logging.
  • Database Connection Pooling: Optimizes SQLAlchemy connection pools with tuned size settings, automatic recycling, and health checks. Integrates Prometheus metrics to monitor pool health and utilization.
  • GraphQL API: Introduces a GraphQL endpoint as a flexible alternative to REST, allowing clients to fetch precisely the data they need. The schema covers all primary data models with query, mutation, and subscription support, integrated with existing authentication and protected by query complexity analysis and depth limiting.

Motivation & Context: As AstroML scales to handle more users and complex ML workflows, these upgrades are necessary to ensure reliable model governance, API stability, database efficiency, and flexible data access for consumers.

Related Files:

  • Added: astroml/models/registry.py, astroml/api/graphql/, config/api.yaml, config/database.yaml
  • Modified: Database schema (model versions table), FastAPI app configuration, SQLAlchemy engine configuration

Fixes #302
Fixes #299
Fixes #297
Fixes #295

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Closes #302
Closes #299
Closes #297
Closes #295

@rachealkenny rachealkenny marked this pull request as draft June 28, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant