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

D2 Vendors API performance changes coming soon #1887

Closed
jshaffstall-bng opened this issue May 16, 2024 · 2 comments
Closed

D2 Vendors API performance changes coming soon #1887

jshaffstall-bng opened this issue May 16, 2024 · 2 comments
Labels

Comments

@jshaffstall-bng
Copy link
Member

jshaffstall-bng commented May 16, 2024

Hey Destiny API developer community,

Some of you may have noticed that the Destiny 2 GetVendors API call can often take a long time to return a response. During periods of extreme load on the D2 game services, these calls can time-out after ~10 seconds and return an error, which is not great.

We want to make the D2 Vendor APIs more reliable with faster response times and a decreased likelihood of timing out, so we are planning to introduce the following changes before the release of The Final Shape.

  • GetVendors (without the ApiPurchasable filter)

    • This is the biggest change: sale item component details are no longer available with the call to get all vendors.
      • DestinyVendorsResponse itemComponents will be empty.
    • The primary motivation here is to reduce the scope and complexity of this request, so that it can be computed and returned to clients in a reasonable amount of time.
    • D2 Vendors have grown a lot over the years, to the point that it's no longer feasible to crunch on every sale item for every vendor up front AND reliably get a response from the game server in under 10 seconds during peak concurrency.
    • To get sale item detail components, you'll need to call GetVendor for each vendor individually.
  • GetVendors (with the ApiPurchasable filter)

    • This will work the same way as before, except with it's own cache duration per-character.
    • This call gets cache-busted after a successful request to BuyItem.
    • This should only be relevant to our 1st-party Destiny 2 Companion apps where Acquire Bounties is allowed.
  • GetVendor

    • This will work the same way as before, except with it's own cache duration per-character, per-vendor.
  • GetPublicVendors

    • No changes, this will work the same way as before.

Too long, didn't read:

  • D2 Vendor APIs can be very slow if they're not already cached for you, and we want to reduce the likelihood of time-out errors.
    • If you depend on sale item details from the call to get all vendors, you will need to change your call patterns.
      • Specifically, expect DestinyVendorsResponse itemComponents to be empty for GetVendors (without the ApiPurchasable filter).
    • If you only depend on sale item details from individual GetVendor calls, you don't need to change anything.

The current plan is to deploy these changes on Tuesday, May 21st, but we could push that back a little bit if this breaks your apps too much and you want more time to update your call patterns.

@bhollis
Copy link

bhollis commented May 23, 2024

Can you share what the acceptable rate limit for a single client calling GetVendor should be?

@jshaffstall-bng
Copy link
Member Author

Sorry for the late answer. I would say as fast as you're able to without getting rate limited :P

dcaslin added a commit to dcaslin/d2-checklist that referenced this issue Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants