Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You have not given nearly enough information here to properly answer your question.</p> <p>But let me make a few observations that might help to guide you.</p> <p>First, File I/O vs Database I/O does not affect algroithmic complexity. However it can have a huge impact on implementation complexity and resulting run times. This is what you are looking to minimize.</p> <p>If you do not need to search for persisted records the file I/O option should be the most efficient. This assumes pure sequential processing.</p> <p>As soon as search comes into the picture all bets are off as to which method will be most efficient. Databases can be very fast when tuned properly. File I/O can result in significant overhead when you choose a poor file structure or search mechanism (eg. sequential search through a large file will be much slower than an indexed select).</p> <p>As a general statement, you should always be able to build a faster system using customized file I/O vs a generic database. One is tuned to a specific application the other is not (no contest). However, the amount of work needed to build a reliable, highly tuned customized file I/O based system will most likely far outweigh the savings in terms of run time and maintenance (the more you write the more you have to maintain). This is why so much of the industry relies on generic databases to manage their data.</p> <p>My personal preference is to use a database, not because it might be the absolute fastest mechanism but because it will look after transaction integrity for you (ie. provides commit/rollback facilities). Consider the difficulties of managing a pure file based system in the event of an abend. When using files you never know how much of your output was buffered (not yet persisted) when the crash occured. Recovery/restart can be quite complex when using file I/O. A database makes recovery a lot easier - you just have to start processing from the last commit point.</p> <p>Only resort to file based processing when a database cannot do the job - and there aren't may situations where databases aren't up to it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload