-
Notifications
You must be signed in to change notification settings - Fork 59
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
BRD/Auth API - table data is very slow to load when there are a lot of records #25080
Comments
I think there's an old ticket around this, but I wasn't able to easily find it. |
The plot thickens. This is probably not as easy as straight pagination, because we should honour any filtering or sorting that the user has selected, but that would force the API to look up all results (which is the time-consuming part) before filtering, sorting and returning just a specified set (page) of results. This is being discuss in a MS Teams chat with Thor and Travis. |
@janisrogers @jacqueline-williams-549 The current technical design makes it virtually impossible to improve the performance of the BRD as it is. Idea 1 - if we can ignore filtering and sorting of the table items then we can paginate on "raw affiliations". But how would we convey to users that their filters and sorting only apply to the current page (eg, records 100-199)? Idea 2 - could we split NRs and businesses into separate concerns (separate tabs?). Then each set of data would be quicker to process and load than everything at once. We would also not need to "combine" NRs and businesses, which would allow us to optimize the back end. To really improve things will require a significant redesign of the APIs and databases. Any thoughts so far? |
Severin to describe potential solutions. Describe best solution for today.
|
(See epic for The Problem and Goals.) The basic solutionWe need to handle smaller amount of data (at least in the UI). This would be done by "paging" results (eg, show only 100 at a time). However, it is expected that users will use filtering (eg, show only "Approved" NRs) or searching (eg, show only business "BC1234567") to quickly access the item they want to manage. For filtering and pagination to work together correctly, first all the records for the subject account need to be filtered, then the first 100 (or next 100, etc) need to be returned. Therefore, a large amount of data is still being handled at some point, but filtering/paging as close to the db as possible means less data transfer and faster API operations. Approach # 1Have the required data already available in one API/database. For example, one can imagine a "rich" affiliations table that is kept up to date whenever NR/business statuses change. Then, it's a fast, simple query for filtering, sorting and paging. Option 1Add a table to Auth db (or a new API+db), and implement async updates to it. Pros:
Cons:
Option 2Use a new search service (using SOLR/ElasticSearch/Google Cloud Search) to store all data and return it based on search parameters, and implement async updates to it. Pros:
Cons:
Option 3Enhance existing Business Search (BTR/SOLR) to replace the affiliations lookup.
Pros:
Cons:
Option 4Use one db for Auth+Names+Legal with a bunch of schemas (for Auth, Names and Legal); this allows a single query across all data (eg, similar to data warehouse). Pros:
Cons:
Approach # 2Perform real-time queries from respective APIs/databases, but filter the data as early as possible and return partial results (eg, pages of 100 results each). Option 1
Pros:
Cons:
Option 2
Pros:
Cons:
Option 3
Pros:
Cons:
Option 4When user lands on BRD, show a page of (eg, first 100) unfiltered affiliations, with table options to show "next 100" or whatever. (Paging uses the order of affiliations in Auth db.) If user applies a filter then return all data that matches the filter (where pagination is optional -- wouldn't make much difference in response time so it's a UX decision -- as long the number of items remains workable, say, less than 1000). Pros:
Cons:
Approach 3Ask users to have a limited number of affiliations per account (say, less than 5000). The BRD UI page would no longer fail to load, though it might take 30-60 seconds. Large accounts would have to be split up into smaller accounts (eg, 20000 / 5000 = 4 accounts). This may complicate the user's process for finding a particular NR or business. This could be mitigated by providing a "search for business" feature that would lead them to the respective Business Dashboard (and similar actions for a NR). Pros:
Cons:
Approach 4Improve the performance of the current Names and Legal databases in OCP. See #26052 and #26053. Pros:
Cons:
|
RecommendationApproach 1, Option 4 (ie, combined database with separate schemas) is probably the cleanest and highest-performance option, but many things need to be completed before we can get there. Approach 2, Option 4 (ie, initial show first 100, when filtering show all results) is probably the most feasible for MVP, and should perform well. |
When the registry dashboard (both old MBR and new BRD) has a lot of entries, the table is very slow to load. I've also heard rumours that the
affiliations
call to fetch the data can time out in Prod.This ticket is to analyze or fix the slow load issue. I imagine the best way will be to paginate the results (so that less data is fetched), but there may be other options, left to the Assignee to look into.
See also #25073 as a potential or partial solution.
I also got the sense that Thor had some ideas on refactoring the "middleware" that might solve this issue, so he should be consulted.
The text was updated successfully, but these errors were encountered: