Dash App - Run & Loading Slowly

Hello all,

I start to link my dash app to SQL server, and extract data from DB
And notice that when I run or refresh my app is become more slower

Is there any thing can I do for this problem?

Hello @DoaaElbanaa,

Without seeing your code, it’s hard to say what would be bogging it down.

But I would say, make sure you are only querying new data from the server whenever you absolutely need it.

This is one of the query I applied on the DB, and rest of data like this
I need it for dashboard, which mean is must to be updated

Hi @DoaaElbanaa !

Agree with @jinnyzor, for some improvement try to query only the data you need
For instance if you only use the date field (I guess you must query other fields :slight_smile: ),
you can try df = pd.read_sql('myDB', engine, columns=["date"])

And often it can be slow when you connect to you DB the first time, when using
engine = sqlite3.connect('myDB.db') for instance

unfortunately, I need the data what I extracted from the DB

Is there any approach to enhance the performance and make app more faster?

@DoaaElbanaa,

I have no doubt that you need the data, but how often do you need fresh data?

You could also have your layout generate without the data and then fill the data via a callback.

I build a dashboard that represent the data from DB

I understand.

But without seeing your callbacks or your layout, that’s all the info I can give.

I also use Dash to represent data from a DB.