Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broker: Consolidate opportunityItemRowCache and opportunityCache to reduce memory usage & simplify code #669

Open
lukehesluke opened this issue Mar 25, 2024 · 0 comments

Comments

@lukehesluke
Copy link
Contributor

Broker uses two strategies to cache full opportunity data: opportunityItemRowCache and opportunityCache (see their documentation in packages/openactive-broker-microservice/src/state.js).

In both cases, at least for "child" Opportunities e.g. Slots and ScheduledSessions, the full opportunity data is stored once in both caches.

For this issue, investigate whether it's possible to consolidate these such that we don't store two copies of each child Opportunity. One possible outcome is that there's a good reason for it to stay like it is (although I expect we could at least change one of the storage methods to use an ID to refer to the other). Try to get a good understanding of why it is the way it is before changing it. There might be some wisdom in there, which may still be true or now be outdated.

@lukehesluke lukehesluke changed the title Broker: Consolidate opportunityItemRowCache and opportunityCache to reduce memory usage Broker: Consolidate opportunityItemRowCache and opportunityCache to reduce memory usage & simplify code Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 💡Ideas
Development

No branches or pull requests

1 participant