How can I run NHibenate queries asynchronously?

后端 未结 5 785
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-30 23:15

One way to increase scalability of the server application is to run IO-bound operation (reading files, sockets, web requests, database requests etc) asynchronously. This doe

5条回答
  •  执笔经年
    2020-12-30 23:52

    Note that async database calls do NOT imply better overall scalability by themselves. I recommend reading the article "Should my database calls be Asynchronous?" for an in-depth analysis. Here's a quote from that article:

    One respected DB/Web architect went so far as to say:
    For database applications using async operations to reduce the number of blocked threads on the web server is almost always a complete waste of time. A small web server can easily handle way more simultaneous blocking requests than your database back-end can process concurrently. Instead make sure your service calls are cheap at the database, and limit the number of concurrently executing requests to a number that you have tested to work correctly and maximize overall transaction throughput.

提交回复
热议问题