Thread: Databases, and how they work

  1. #1
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949

    Question Databases, and how they work

    How exactly do Databases (MySQL, SQL, Access, ect.) work? I haven't seen them specifically create files to store the info, and I don't know how else they would work, as variables within the program itself would be deleted after the program is closed. Especially MySQL, how does PHP connect to it, write to it, and save it without files? Thanks all .
    Do not make direct eye contact with me.

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    They do use files. Why do you think they don't?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683

    Re: Databases, and how they work

    Originally posted by Lurker
    How exactly do Databases (MySQL, SQL, Access, ect.) work? I haven't seen them specifically create files to store the info, and I don't know how else they would work, as variables within the program itself would be deleted after the program is closed. Especially MySQL, how does PHP connect to it, write to it, and save it without files? Thanks all .
    they do use flat files when it comes to storage.. but they have a middle layer which takes care of this. When you start the database the database will load the index and other information into the memory.. all your query is searched through the indexes and when a result is found a pointer will point to the actual record on the hard disk... they use data structs called b-trees to index the records to make searches faster.. Basically the records are stored on the hard disk..

Popular pages Recent additions subscribe to a feed