IBMStockTrader / account

Account microservice for the IBM Stock Trader sample
Apache License 2.0
0 stars 7 forks source link

Add pagination to the get all operation #7

Open jwalcorn opened 2 years ago

jwalcorn commented 2 years ago

Right now, the GET operation that takes no ID path param, used by the Summary JSP in the UI, does an open-ended query of all accounts in the CouchDB database. If you had thousands, this would obviously be very expensive. Need to add a way to ask for the first 20 or whatever, with some explicit "order by", ensuring we get the same 20 that Portfolio would get from its PostgreSQL (or whatever relational database you picked), and then a way to advance to the next page of output, and so on. @rtclauss's performance tests in Istio/CloudWatch/Kiali suggest this "get all" to CouchDB is the current bottleneck in Looper stress runs.

jwalcorn commented 2 years ago

related to https://github.com/IBMStockTrader/broker/issues/5

rtclauss commented 2 years ago

This could also be a new API. Then the "getAll" would still be in the app but be deprecated and eventually removed.

Note we may also need to do this in portfolio, too.