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.

Text File vs Database reading performance

Discussion in 'C#' started by jimmy4feb, Apr 8, 2010.

  1. #1
    Hello Dp members,

    I have a database driven website & I want to improve its performance so that pages can load quickly at client side. So i think I can use text files instead of database & I will update text files as well with programming if I will update my database from admin session. It means text file will remain same as database all the time or I will just not use database any more. I will only work with file system. But before doing this I have couple of questions regarding file system vs database system performance.

    1. If I read data from text file or XML file instead of database tables, Will it give any positive effect to my website performance ???

    2. Like Databases have limited number of connections that number of limited users can access the database at same time.So is there any same type of limitation on accessing text files or XML file which are located on hosting server ???

    3. Which type of programming language (server-side programming language such as PHP or client-side programming language such as JAVASCRIPT) will be best to access the text file or XML file (which is located at hosting server) so that it can take maximum performance ???

    4. If I will access data from file instead of database then will I able to protect my data from to be copied and what type other hacking issues may rise ???

    Thanks for your valuable time,

    Jimmy
     
    jimmy4feb, Apr 8, 2010 IP
  2. vihutuo

    vihutuo Well-Known Member

    Messages:
    1,511
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    180
    #2
    You maybe better off using caching
     
    vihutuo, Apr 11, 2010 IP
  3. fly26

    fly26 Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    1. Reading a database is much faster than reading text files or xml files, especially if you have a large number of records.

    2. Most databases are good at handling concurrent access, all you need to make sure is that you open a connection when you need to
    and close it afterwards.

    3. Its best to access your files using a server-side script for security reasons, I think.

    4. From what I read here, I think you greatly underestimate the performance of databases.
     
    fly26, Apr 12, 2010 IP
  4. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #4
    What is the url for the website?
     
    camjohnson95, Apr 12, 2010 IP
  5. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Yup, caching is your way to go, I know asp.net allows you to cache even database driven web-apps, and only change on varying specifics that you choose. For instance, if the person's name is the only thing that changes... you can set it up to cache all but what varies, which is the block that renders the person's name...
     
    ccoonen, Apr 17, 2010 IP
  6. iamscottj

    iamscottj Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I agree with fly26.
    It really is good to opt for Database rather than a text file. Updating and maintaining relationship among tables is a concern where text files fail to perform. If you want frequent updations, deletions, addition, retrieval; you should better go for a Database. And yes a text file can be seen by anybody. You have to encode the name and file on regular basis to avoid any sort of unwanted disclosure of data which may become a daunting task. If you opt for database, you can change the login ID and password to save your precious data.
     
    iamscottj, Jun 7, 2010 IP