Ways to load a file to PostgresPosted on

To write a post about async queries I first need to load some data to Postgres. The data came form https://www.kaggle.com/CooperUnion/anime-recommendations-database. I wanted to use real data and I’m an anime fan, so it was the perfect fit. It’s a CSV file so there is no normalization. That’s ok. If there was this would be a short post. I decided to try several ways of loading the data to see which would be fastest. To be honest, I already knew which one was going to win I wanted to see how close I could get using other methods without over engineering it or getting cute with the code. I ended up going there anyway, but the method that came in a close second was a simple solution.
Continue reading “Ways to load a file to Postgres”

Why async is important to a web servicePosted on

At a high level, ASP.Net uses a thread pool to process requests. How many threads is based on a number of factors including configuration and work load. New threads will be added to the pool as needed but there is a startup penalty. According to ASP.NET Thread Usage on IIS 7.5, IIS 7.0 and IIS 6.0, it only adds 2 per second. If there is a sudden burst of activity, it will take time to spin up new threads. One way to avoid the penalty is to make the best use of the threads available.
Continue reading “Why async is important to a web service”