Professional Web Applications Themes

speed: file vs. DB - PHP Development

Hi Ich bin der administrator von TSEP - The Search Engine Project (www.tsep.info). Wir Developer haben eine Unstimmigkeit was schneller geht, daher wende ich mich an Euch: Ist es schneller a) in eine Datei zu schreiben oder b) einen Datensatz in einer Datenbank zu aktualisieren? Olaf -- http://www.team-noehring.de...

  1. #1

    Default speed: file vs. DB

    Hi

    Ich bin der administrator von TSEP - The Search Engine Project
    (www.tsep.info).
    Wir Developer haben eine Unstimmigkeit was schneller geht, daher wende ich
    mich an Euch:
    Ist es schneller
    a) in eine Datei zu schreiben
    oder
    b) einen Datensatz in einer Datenbank zu aktualisieren?

    Olaf

    --
    http://www.team-noehring.de
    Olaf Guest

  2. #2

    Default Re: speed: file vs. DB

    Olaf Noehring wrote: 
    Ähm, du hast schon gemerkt, daß diese Newsgroup englisch ist?

    For those that aren't able to read the german text above: 



    So what about your problem. Why don't you guys test it? I guess the
    database will be faster in the average case, but this also depends on
    the database structure for example which indices have to be updated
    after an update and of course of the structure you use in the files,
    because a database also stores its data into a file ;)
    So lets think about an avarage case:
    10000 of datarows in the most naive file solution a CSV file. Imaging
    you want to alter the 5000th row, you need to load the entire file (at
    once or in parts), alter the row and store the whole file. A database
    doesn't do so, so it would be of course faster. But if you have say a
    B*-Tree structure behind your files you may get the same results a
    database get. Well just test it.


    Regards
    Stefan
    Stefan Guest

  3. #3

    Default Re: speed: file vs. DB

    Hi Stefan
     
    nope, I did not notice - really!
     [/ref]

    Thanks for your answer. We need to write only about 5 lines to the file -
    or 1 record to the DB. It's only needed to tell the indexer (of TSEP)
    which reads the contents of the files that another instance of the indexer
    is already running. So, the first instance started will write to the file
    / db record when it has been started and that it is running at time X
    (every 30 seconds)

    We will probably favor the simple file.

    Sorry, that I missed the english translation of my request and the
    explanation what we need this for. Thanks for translating and your comment
    Stefan.

    Olaf

    --
    http://www.team-noehring.de
    Olaf Guest

  4. #4

    Default Re: speed: file vs. DB

    Olaf Noehring wrote: [/ref]
    >
    > Thanks for your answer. We need to write only about 5 lines to the
    > file - or 1 record to the DB. It's only needed to tell the indexer
    > (of TSEP) which reads the contents of the files that another instance
    > of the indexer is already running. So, the first instance started
    > will write to the file / db record when it has been started and that
    > it is running at time X (every 30 seconds)[/ref]

    If there is no searching involved, just writing 5 lines (as you specified),
    the simple file operation probably is faster. I would be concerned if you're
    doing an append and the file size gets rather large, though - you may want
    to do a little testing of that scenario.

    --
    Tony Garcia
    Web Right! Development


    Tony Guest

Similar Threads

  1. Replies: 2
    Last Post: August 20th, 02:54 PM
  2. Replies: 1
    Last Post: August 15th, 11:50 AM
  3. NIC speed on LAN vs DSL
    By Roy in forum Windows Networking
    Replies: 3
    Last Post: August 15th, 08:06 AM
  4. Please HELP! ISO speed set to wrong speed.
    By Mick in forum Photography
    Replies: 4
    Last Post: July 27th, 02:44 PM
  5. Speed of file vrs dbase access
    By Abigail in forum Perl / CGI
    Replies: 2
    Last Post: July 1st, 07:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139