JocaPC / Belgrade-SqlClient

Small async ADO.NET helper library
http://jocapc.github.io/Belgrade-SqlClient/
Other
93 stars 14 forks source link

Performance considration issue #4

Closed ysmoradi closed 7 years ago

ysmoradi commented 7 years ago

I've developed web API / OData app based on Owin pipeline which is hosted on asp.net core / kestrel using full .net framework I convert OData query to SQL query, then I execute that SQL query on SQL server 2016. Using SQL server 2016's json support, I produce json result based on OData spec. So it's ready to be sent to client. I use Web API's PushContentStream which provides me a response stream. I use that stream and your amazing library to send that json to client. Everything is fine. I know that my question is not directly related to your project )-: But could you please tell me does it work for me in a way asp.net core/owin send file feature is working? Send file feature writes file directly to network card, so It's very fast. If I use your library with Web api's push stream content, does it work like send file feature? Does it write SQL db's response to network card directly? If not, can I achieve something like that by developing asp.net core middleware which passes It's stream to your library? Sorry for interruption.

ysmoradi commented 7 years ago

I've read this method Could you please describe what does that private method do? Thanks again

ysmoradi commented 7 years ago

I think I've got my answer. You're reading data from data reader in small size buffers, then you write them into response. So it's not what I was looking for. But it's performance was very good and I'm gonna use that. Can't understand why there is no way to return sql server's stream to client directly.

jovanpop-msft commented 7 years ago

Hi, I'm glad that you find the answer. Could you take a look at https://github.com/JocaPC/sql-server-rest-api . This is another library where I have implemented OData service using Belgrade client. Maybe this library can also help you.