1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What is better? Storing data in a .txt file or Storing data in a database?

Discussion in 'Databases' started by Imozeb, Mar 2, 2010.

  1. #1
    I'm trying to decide how and where to store my data. I know you can store and modify data in a .txt file and upload the file to a server. I also know you can store data in a database. Which is better and what are the differences between storing data in a .txt file v.s. storing data in a database?

    Thanks for the advice!

    ~imzoeb :)
     
    Imozeb, Mar 2, 2010 IP
  2. fierceservers

    fierceservers Peon

    Messages:
    338
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'd personally say that working with data in a database is much easier than working with data in a text file, I've used both methods before and databases provide much more functionality and also lessens the chance of messing up data (as opposed to text in a text file)...not to mention how big this text file would be (could cause some I/O issues on the server) :)
     
    fierceservers, Mar 2, 2010 IP
  3. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Okay. I'll use the database to store most of my data. Thanks.
     
    Imozeb, Mar 2, 2010 IP
  4. BrianM

    BrianM Peon

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    A database is, hands down, the best way to manipulate, store and retrieve data.
     
    BrianM, Mar 6, 2010 IP
  5. Andrew E.

    Andrew E. Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You could split the difference and use something like sqlite. I like having a database server, but sometimes that is not always the best solution. Every case, and every project is different.
     
    Andrew E., Mar 8, 2010 IP
  6. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #6
    In most cases databases are better, but are not always better. Sqlite is a great file system database that is very easily transportable. It's hard for me to find an example except for very small, static data sets where a single flat file would be a better solution to sqlite or a small database. If you need to store files or images in a database, it's usually best to use a hybrid, database / file storage system to keep everything running reasonably quick. Storing files in a database works, but most people quickly find out that there are some major downsides in performance and overhead once you start doing it.
     
    jestep, Mar 9, 2010 IP
  7. rajendradhakal

    rajendradhakal Peon

    Messages:
    245
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    As my 6 years experience of working with data i prefer to use of database instead of txt file..
     
    rajendradhakal, Mar 25, 2010 IP
  8. moneycms

    moneycms Peon

    Messages:
    265
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Database is the best since it allows easy updation, editing etc.....
     
    moneycms, Mar 29, 2010 IP
  9. MEMORIES89

    MEMORIES89 Peon

    Messages:
    1,461
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    well, data base stores information more efficiently, securely and easily manageable, so database is good option, and have easy to re-use.
     
    MEMORIES89, Apr 14, 2010 IP
  10. itsupportservice

    itsupportservice Peon

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    That is but obvious thing that you should storing data in database because it is easy & more secure...
     
    itsupportservice, Apr 17, 2010 IP
  11. CaseyM

    CaseyM Peon

    Messages:
    289
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Depends on how much data you need to work with. I have worked on projects where the client only needed to change a few strings of text here and there so i chose xml, which gave the client what he needed, didnt impact performance and was very cheap. However, if you need your site to be dynamic then you definetly should go with databases. It gives you much more flexibility.... and its not as hard as it might seem.

    Good luck mate :)
     
    CaseyM, Apr 19, 2010 IP
  12. Serious Workers

    Serious Workers Well-Known Member

    Messages:
    2,785
    Likes Received:
    65
    Best Answers:
    2
    Trophy Points:
    195
    #12
    Database are of course better then .txt files. There are various reasons for it. In databases you can optimize them and make them smaller as you want, but in .txt it is not at all possible. And also in .txt your data can get corrupted but in database there is less chance of it.
     
    Serious Workers, Apr 24, 2010 IP
  13. brudawson

    brudawson Member

    Messages:
    144
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #13
    Depends on how much data you need to work with. If worked on a project choose XML and for a project on site defiantly for a database.Database provides you more flexibility than text file. Databases provide much more functionality but always its not the best solution. Every case, every project is different. Working with database is much more easier than .txt file
     
    brudawson, Apr 27, 2010 IP
  14. weaverIT

    weaverIT Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    surely i will suggest database
     
    weaverIT, May 7, 2010 IP
  15. CaseyM

    CaseyM Peon

    Messages:
    289
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    SO how much data ARE you working with ?
     
    CaseyM, May 7, 2010 IP
  16. graspit

    graspit Peon

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    A database is more secure.
     
    graspit, May 11, 2010 IP
  17. abrh123

    abrh123 Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    storing data in database is better than storing data in .txt file in many ways.
    maintaining data in database is easy,clear,safe & extract.
     
    abrh123, May 12, 2010 IP
  18. cospro

    cospro Member

    Messages:
    56
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    30
    #18
    Obviously databse is a better option because it provides easy access of data, easy manipulation and maitenance. But if you don't have much data then you can store it in .txt file to avoid overhead of database installation and configuration.

    Cospro
     
    cospro, May 12, 2010 IP
  19. deaglezor

    deaglezor Member

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    38
    #19
    Of course, Database and not .txt

    Reason? >Safe..
     
    deaglezor, May 16, 2010 IP
  20. Ber

    Ber Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Database or txt or XML file?, what do you think is better for the search engines?
     
    Ber, May 17, 2010 IP