Skip to content

Look up handles without listing all resources#412

Merged
UserNotFound merged 6 commits intomasterfrom
handle-lookup
Mar 12, 2026
Merged

Look up handles without listing all resources#412
UserNotFound merged 6 commits intomasterfrom
handle-lookup

Conversation

@UserNotFound
Copy link
Member

@UserNotFound UserNotFound commented Mar 11, 2026

We have an API endpoint that allows returning apps and databases for a given handle, or for a a combination of handle and account handle. This is much faster than doing the filtering client side.

Tho illustrates the time it takes to identify an app by handle, I ran aptible config --app httpd in a test account with 400 apps. The performance of the current CLI release is as follows: (real CLI execution time and the response time of the request we're changing)

real 5.016s => GET https://api.aptible.com/apps?per_page=5000&no_embed=true (0) 3.78s
real 5.484s => GET https://api.aptible.com/apps?per_page=5000&no_embed=true (0) 4.41s
real 5.218s => GET https://api.aptible.com/apps?per_page=5000&no_embed=true (0) 4.18s
real 4.900s => GET https://api.aptible.com/apps?per_page=5000&no_embed=true (0) 3.86s
real 4.860s => GET https://api.aptible.com/apps?per_page=5000&no_embed=true (0) 3.82s
real 4.778s => GET https://api.aptible.com/apps?per_page=5000&no_embed=true (0) 3.74s
real 4.786s => GET https://api.aptible.com/apps?per_page=5000&no_embed=true (0) 3.76s
real 4.806s => GET https://api.aptible.com/apps?per_page=5000&no_embed=true (0) 3.8s
real 4.508s => GET https://api.aptible.com/apps?per_page=5000&no_embed=true (0) 3.51s
real 5.514s => GET https://api.aptible.com/apps?per_page=5000&no_embed=true (0) 4.46s

Versus this PR:

real 1.267s => GET https://api.aptible.com/find/app?handle=httpd (0) 0.28s
real 1.248s => GET https://api.aptible.com/find/app?handle=httpd (0) 0.27s
real 1.257s => GET https://api.aptible.com/find/app?handle=httpd (0) 0.28s
real 1.309s => GET https://api.aptible.com/find/app?handle=httpd (0) 0.32s
real 1.255s => GET https://api.aptible.com/find/app?handle=httpd (0) 0.27s
real 1.225s => GET https://api.aptible.com/find/app?handle=httpd (0) 0.27s
real 1.350s => GET https://api.aptible.com/find/app?handle=httpd (0) 0.29s
real 1.273s => GET https://api.aptible.com/find/app?handle=httpd (0) 0.29s
real 1.261s => GET https://api.aptible.com/find/app?handle=httpd (0) 0.29s
real 1.289s => GET https://api.aptible.com/find/app?handle=httpd (0) 0.3s

The same change has been made to databases, as well as accounts.

@UserNotFound UserNotFound changed the title [WIP] Look up app handles without listing all resources [WIP] Look up handles without listing all resources Mar 11, 2026
@UserNotFound UserNotFound marked this pull request as ready for review March 11, 2026 20:49
@UserNotFound UserNotFound changed the title [WIP] Look up handles without listing all resources Look up handles without listing all resources Mar 11, 2026
madhuravius
madhuravius previously approved these changes Mar 11, 2026
Copy link
Contributor

@tvdaptible tvdaptible left a comment

Choose a reason for hiding this comment

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

omg yessssss 🚀

@UserNotFound UserNotFound merged commit c1f17f0 into master Mar 12, 2026
10 checks passed
@beaugunderson
Copy link

🎉🎉🎉 music to my ears!

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.

5 participants