TonyS
Posts: 0
Joined: Thu Jun 11, 2015 12:11 pm

How do I speed up API load

I have a custom API created with API express getting data from a MySql db. It takes too long to get the data on the screen. This is in the preview mode. Will it be the same in the app and if so how can I speed it up?

Thanks

Pavel Zarudniy
Posts: 0
Joined: Mon Jul 06, 2015 8:56 am

How do I speed up API load

Hi TonyS,
Speed of getting data dependence on speed query to your SQL server

TonyS
Posts: 0
Joined: Thu Jun 11, 2015 12:11 pm

How do I speed up API load

Well it's not a complicated statement and it's from a single table. Locally (on the server where it resides) it's very quick. Any other ideas why it could be slow?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How do I speed up API load

Hello Tony,

Could you please clarify do you have multiple requests to your db? Also please detail how much data is transferred.

TonyS
Posts: 0
Joined: Thu Jun 11, 2015 12:11 pm

How do I speed up API load

One request, a select query, which gets 7 fields from a table that has currently 1000 records based on an alphanumeric parameter. In some cases it might return 100 records max (containing the the 7 fields)

I'd be happy if the spinner would show whilst it gets the data. That way the user will know something is happening.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

How do I speed up API load

Hi Tony -

You can find posts on our forum about how to show/hide spinner while executing the service:
https://getsatisfaction.com/apperyio/...
https://getsatisfaction.com/apperyio/...
https://getsatisfaction.com/apperyio/...

TonyS
Posts: 0
Joined: Thu Jun 11, 2015 12:11 pm

How do I speed up API load

Here's better idea, is there anyway to store the previous "fetched" records, like in a cache, whilst the new ones are returned. Just like Facebook does?

TonyS
Posts: 0
Joined: Thu Jun 11, 2015 12:11 pm

How do I speed up API load

Thanks Illya, yeah showspinner() etc. but the app locks up so it doesn't show, that's the problem. I'll figure it out.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

How do I speed up API load

For such case you can use Model/Storage approach for this and store your data structure in storage which will replicate your service response model structure and you will have access to this records.

TonyS
Posts: 0
Joined: Thu Jun 11, 2015 12:11 pm

How do I speed up API load

So this would allow the storage of multiple records of varying amounts in storage variables of the same name which would be recalled into label place holders until the service succeeds and replaces the fields with new data?

Return to “Issues”