Tell me, what files to use when designing and for further work of the program? For example, you need to have a file in which information will be written from a table in a program, as well as read it, to the same table ... What will this file be? .. A database file or some other (txt or its own format). ..

Closed due to the fact that the question is not clear to the participants Athari , Nick Volynkin , Suvitruf , Timofei Bondarev , LEQADA December 23, '15 at 4:04

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Rephrase the question too blurry. - Sergey
  • The question has been rephrased) - Leshij_2005

5 answers 5

Yes, everything, as always, depends on the project requirements. Also from the programming language, at least in general, most modern DBMSs are always supported, but work with some is more optimized for a specific platform.

Also I would advise looking towards technologies like db4o. It is a very convenient storage system that does not require a database design. But it has many basic functions of the DBMS. But while it only develops.

    Well, it turns out that it is easier to work with database files (direct access files), it is easier to search for the necessary records, as well as insert and delete, than, for example, with text files (sequential access files) ..

    And you can also do serialization / deserialization. Those. on the fingers, I would explain it this way: if there is a certain structure of objects, then each of them can be put in binary form into a file (it can be in one, not necessarily in several different files). How these objects are in memory. For this, it is necessary for each of the object types to draw a special function of writing to a file and a second function that will read from the file and create an object. In the part of the libraries there is such functionality. For example, in MFC .

    In general, in fact, I don’t really like the question, because too vague and unclear exactly what the author wants.

    Well, it turns out that the database files (direct access files)

    And why is this DB - direct access file? At the physical level, it will still be stored on the same HDD as the normal one on the file system. Therefore, when working with the database will be overhead. From terrible to imperceptible, depending on the implementation of the database itself.

    • The question has been rephrased) - Leshij_2005
    • <i> For example, you need to have a file in which information will be written from a table in a program, as well as read it, to the same table ... What will this file be? .. A database file, or some other (txt or its format) ... </ i> <p> It didn’t get much better. What type of data? In simplicity, it can be stored in CSV files. This is a table in which each new item is a new row, and the columns are separated by a semicolon. <p> Example: <pre> 1997, Ford, E350, "ac, abs, moon", 3000.00 1999, Chevy, "Venture" "Extended Edition" "", "", 4900.00 1996, Jeep, Grand Cherokee, "MUST SELL! Air, moon roof, loaded ", 4799.00 </ pre> - gecube
    • The data type is textual and numeric. Just as it would like to be limited from the user, in the sense of having a file that only the program can read, but not the user ... What do you need for this? Encode info? ... - Leshij_2005
    • Any binary format. Text can be easily opened in notepad and viewed, and even edited! - gecube
    • OK) Thank you) We will read about the binary format) - Leshij_2005

    The simplest is INI , access is available in some languages ​​in standard libraries.

    XML

    Yaml

    DB in one file - SQLite

      The truth is that for small data you can use text files, and for large and not very small - the database. With the database is always more convenient :)

        There is an option to store data in a binary file, which will allow to receive data arbitrarily.
        This method depends on the data you need to store and retrieve.