|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Read from database or read from file ? Which is faster?
I am trying to optimize so I wasn't sure which one would be a better option.
I'm building an app that will use a database whose number of records will go into the thousands (and will continue to grow very quickly). A lot of that information on the database (especially the older records) will be static and never be edited or deleted. But there are good chances those records will be pulled up frequently by search queries. So would it be a better bet to remove those older records from the database and save it into a text/csv/xml file and read it from there ? Or keep it in the database ? I am thinking in terms of what causes greater I/O and CPU instructions .. the file I/O or the database reads. Even a small difference could be substantial because I am expecting thousands of users to be querying the database (and adding/editing records to it) at real-time. Thanks in advance! |
|
#2
|
||||
|
||||
|
My gut reaction is that the database will be faster retrieving the records becuase that is what databases are built to do.
However making joins accross multiple tables takes time which is why data warehouses are de-normalized. Putting your data into a text based file (csv, xml) generally requires you to de-normalize it as well. Based on the situation you described of mass entry and then reporting, I would build a database that had: normalized tables for entry to ensure consistancy, etc de-normalized tables for storing the data for quick reporting indexes on the fields/columns that will typically be used for filtering data
__________________
P.S. I am looking for work. <grin>. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Database Development > Read from database or read from file ? Which is faster? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|