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

Optimize backend calls to frequently used endpoints. #790

Open
1 of 4 tasks
budzanowski opened this issue Jul 24, 2023 · 0 comments
Open
1 of 4 tasks

Optimize backend calls to frequently used endpoints. #790

budzanowski opened this issue Jul 24, 2023 · 0 comments
Labels
type: enhancement The issue is a request for an enhancement.

Comments

@budzanowski
Copy link
Collaborator

budzanowski commented Jul 24, 2023

Intro

This is a master Issue that will track work on all of the endpoints mentioned below. I expect that optimizations for each endpoint should be delivered via separate PRs for better separation and tracking.

Tracking progress

User story

Adarsha has observed that commerce/product_pin_merchants/{$merchant_id}/ API endpoint is being called over 100k requests per hour (averaging around 4 requests per hour per user). This high traffic to the API endpoint could potentially be causing unnecessary load on our servers and slowing down our application performance. The same has been noticed on get advertiser countries, get advertiser discounts, and get feed profiles for merchants.

Is your feature request related to a problem?

The issue is related to the optimization of our backend operations. The overuse of these endpoints is not necessarily causing a problem right now, but it may in the future if left unchecked. It could lead to an unnecessary increase in costs and could potentially slow down our application for users.

How to reproduce the problem

  1. Monitor API calls to the commerce/product_pin_merchants/{$merchant_id}/ endpoint.
  2. Observe the number of calls made per user, per hour.

Describe the solution you'd like

I propose that we review the frequency and necessity of these API calls. It may be possible to reduce the number of requests or to implement caching or batch processing where appropriate.

Technical

A technical review of the backend code related to these API endpoints is necessary. This would involve inspecting how and where these API calls are made and determining if there are more efficient ways to achieve the same results.

Figma link

Not applicable.

Acceptance criteria

  • Conduct a thorough review of the usage of these API endpoints.
  • Propose a plan to reduce the number of API calls or increase efficiency.
  • Implement the proposed changes.
  • Monitor the usage of the API endpoints after implementation to ensure the changes have had the desired effect.

Unknowns

  • We need to identify the parts of the application that are making these calls, and why they're doing so frequently.
  • What are the possible implications on the application's functionality if we reduce the number of API calls?

Out of bounds/rabbit holes

  • Rewriting major parts of the backend is out of scope for this issue. Our aim should be to optimize the existing system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

1 participant