bradtraversy / proshop-v2

ProShop ecommerce website built with MERN & Redux Toolkit
532 stars 267 forks source link

fetching data from mongo seems high latency #16

Closed HridoyHazard closed 10 months ago

HridoyHazard commented 11 months ago

after fetching data from mongo using asyncHandler it seems the latency is very high and loading is slow and sometimes get lagged. anyone facing the same issue ?? image image image

bushblade commented 10 months ago

Hi @HridoyHazard I guess the bottle neck here would be where your MongoDB is hosted in relation to where you app is running. For example if your app is running on a server in the UK but your DB is Australasia then yeah it's gonna take a while. I don't think this would be anything to do with the code here in the repository though and it looks like this is in your own project too? It looks like you are experiencing this in development locally? So where is your DB and where are you located in the world? If you want super fast zero latency then I would recommend running MongoDB locally. Hope that helps, but I'll close here as an issue with the repository code.