I have an Azure SQL database that is connected to python code which scrapes data into the database four times a day. The database is also connected to a tableau cloud dashboard which refreshes the extract roughly 30 mins after the data has been scraped.
The estimated monthly costs is said to be around 5$ a month with being charged per second of usage but I am being charged upwards of 5$ per day which would come out to hours of usage.
I have checked my code to ensure it closes the connection after accessing the database and I have set the auto-pause to its lowest setting of 1 hour. Am I running into a problem where because my database is accessed 8 times day, the connection remains open for 8 hours until the auto-pause delay stops it?
I am curious to know whether this is normal for what I am trying to do or if I am doing something wrong and paying the price for it.
This is what is happening:
So if this is happening 4 times a day your Azure SQL Database is sleeping 4 hours max.
Serverless is suggested for databases that receive no connections for more than 50% of the time and this is not your case.
Use an S1.