Stream (.NET) handling best-practices

Posted by Jader Dias on Stack Overflow See other posts from Stack Overflow or by Jader Dias
Published on 2009-02-26T18:12:43Z Indexed on 2010/05/26 8:21 UTC
Read the original article Hit count: 365

Filed under:
|
|

The question is entitled with the word "Stream" because the question below is a concrete example of a more generic doubt I have about Streams:

I have a problem that accepts two solutions and I want to know the best one:

  1. I download a file, save it to disk (2 min), read it and write the contents to the DB (+ 2 min).
  2. I download a file and write the contents directly to the DB (3 min).

If the write to DB fails I'll have to download again in the second case, but not in the first case.

Which is best? Which would you use?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about best-practices