Skip to content

fix: added redis for collection hierarchy - #911

Open
romitshah02 wants to merge 3 commits into
Sunbird-Knowlg:v1.0.3from
romitshah02:redis-hierarchy
Open

fix: added redis for collection hierarchy#911
romitshah02 wants to merge 3 commits into
Sunbird-Knowlg:v1.0.3from
romitshah02:redis-hierarchy

Conversation

@romitshah02

@romitshah02 romitshah02 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Store collection hierarchy relationship data (leaf nodes, optional nodes, ancestors) in Redis instead of Yugabyte when Redis is enabled, so a companion change in lern-service can read the same keys instead of hitting Yugabyte's hierarchy_relations table directly.

CollectionPublisher.storeRelationshipData now branches on config.redisEnabled: writes SET "${rootId}:${identifier}:${relationshipType}" <json-array-of-node_ids> to a dedicated Redis db index (10, redis.database.hierarchyRelations.id) via a new DataCache wired in CollectionPublishFunction, falling back to the existing Cassandra upsert when Redis is disabled. No behavior change when redis.enabled=false (default).

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • 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

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ba3eae7d-3b7c-4fad-90a2-f25be8ee8f8c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@romitshah02
romitshah02 marked this pull request as ready for review August 3, 2026 12:34
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