Skip to content

Improvement suggestions for ListPublicationsWithGene method #533

@cybersiddhu

Description

@cybersiddhu

Overview

The ListPublicationsWithGene method in the query resolver is well-implemented but could benefit from several improvements to enhance maintainability, reliability, and performance.

Suggested Improvements

  1. Configurable Concurrency Limit

    • Make the concurrency limit (currently hardcoded to 3) configurable via application config
    • Provide sensible defaults based on system resources
  2. Context Timeout Controls

    • Add timeout contexts for publication fetch operations
    • Prevent long-running goroutines from consuming resources indefinitely
  3. Consistent Result Ordering

    • Implement result ordering based on publication date or other relevant criteria
    • Consider preserving original order of publication IDs
  4. Enhanced Error Handling

    • Add metadata to responses to indicate partial results
    • Consider schema changes to communicate fetch completeness
  5. Extract Anonymous Functions

    • Move goroutine logic to named methods for better testing and readability
    • Improve maintainability of concurrent code
  6. Pagination Support

    • Add pagination parameters for genes with many publications
    • Prevent potential memory issues with large result sets
  7. Performance Instrumentation

    • Add telemetry to track fetch latency and success rates
    • Implement metrics for monitoring system performance

Next Steps

These improvements should be implemented incrementally, with priority given to error handling and timeout controls to improve system reliability.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions