Home > Enterprise >  Hosted database is much slower than localhost one
Hosted database is much slower than localhost one

Time:08-09

When I'm using my local SQL Server database during development of my .NET API, all requests are being responded almost immediately.

But when I'm using Azure or AWS RDS, each request takes over 20 seconds (or more) to get a response.

I think it may be Azure performance issue because I'm using free plan, but in AWS I'm using max performance.

It doesn't matter who is the database provider, once I use a cloud database it takes forever to get the data.

I know there will be a latency, but not for more than 20-25 seconds.

Edit: to be more specific, for example when I'm getting all movies or a specific movie details, using postman or swagger .. when it's local, I get all data in less than a second, but I'm using a cloud database, it takes a really much time to get one movie details.

I'm getting a lot of information, like .. movie genres, movie reviews and comments, more like this movie and other information .. I don't know if that is the problem, but if it's why is so fast on local?

My internet connection is good, ping also good, tried regions near me to eliminate latency, I can't figure out what's the problem.

Could anyone help me please? Thanks.

CodePudding user response:

I will post what I did because maybe someone will have same problem, I think there was a huge latency because I noticed that all resources in azure were not in the same region, so I deleted all resources and created new ones .. and made all of them in the same region:

backend-application

frontend-application

database-server

resource-group

and all other resources

Now the performance is very good, the page is loading in less than a second.

Thanks everyone and sorry for being dumb

CodePudding user response:

Maybe slow connection or you should try another package in aws or azure!. I recommend using pooling connection for production environment.

  • Related