Stream (.NET) handling best-practices
- by Jader Dias
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:
I download a file, save it to disk (2 min), read it and write the contents to the DB (+ 2 min).
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?