Skip to content

Conversation

@KIRTIKUMARKK21
Copy link

Description

Added a new DATABASE_ID_HEADER_KEY constant (x-database-id) to RequestContextConstants to support database routing decisions in multi-database deployments. This header allows services to specify which database instance should handle a request, enabling database sharding or multi-tenancy at the database level.

The header is:

  • Added to HEADER_PREFIXES_TO_BE_PROPAGATED to ensure it propagates across gRPC service calls
  • Added to CACHE_MEANINGFUL_HEADERS since database selection affects query results and must be considered for cache invalidation

Testing

  • Verified the constant compiles without errors
  • Confirmed the header is included in propagation and cache-meaningful header sets
  • Manual testing required: Deploy and verify the header propagates correctly in a multi-service environment
  • Manual testing required: Verify cache behavior respects the database ID header

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Documentation

No documentation changes required - this is an internal constant addition. Services consuming this library will need to document their own usage of the x-database-id header based on their specific database routing implementation.

@KIRTIKUMARKK21 KIRTIKUMARKK21 requested a review from a team as a code owner November 13, 2025 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant