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

feat(mojaloop/#3565): database and cache optimizations #318

Merged
merged 13 commits into from
Oct 13, 2023

Conversation

kleyow
Copy link
Contributor

@kleyow kleyow commented Oct 12, 2023

feat(mojaloop/#3565): database and cache optimizations - mojaloop/project#3564 mojaloop/project#3565

  • Added cache ttl config for enum and participant based caching
  • Added getParticipantByName/Enabled getParticipant and getParticipantEndpoints database caching
  • Removed unused database functions and associated tests
  • Move get queries outside of transaction window
  • Added caching to fetchParticipants api function
  • Added logic to reduce getParticipant calls in validating quote requests
  • Parallelized some db inserts/selects in handleQuoteRequest

@kleyow kleyow changed the title feat(mojaloop/#3564): database and cache optimizations feat(mojaloop/#3565): database and cache optimizations Oct 12, 2023
quoteRequest.amount.amount, quoteRequest.amount.currency, payerEnumVals),
this.db.createPayeeQuoteParty(txn, refs.quoteId, quoteRequest.payee,
quoteRequest.amount.amount, quoteRequest.amount.currency, payeeEnumVals)
])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting off consolidating these two into a single insert since createQuoteParty has itself several queries that would also need refactoring to a single insert for the quote pair.

@@ -196,10 +199,11 @@ const config = new Config()
* @description Starts the web server
*/
async function start () {
const cache = new Cache()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can pass a singular cache to the db and for api request caching but have kept them seperate for now. Any thoughts on a singular cache for everything?

@kleyow kleyow marked this pull request as ready for review October 13, 2023 13:15
Copy link
Member

@mdebarros mdebarros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kleyow kleyow merged commit da15567 into main Oct 13, 2023
@kleyow kleyow deleted the fix/transaction-cache branch October 13, 2023 16:22
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.

2 participants