R
R
rundll322021-02-06 06:11:57
Database
rundll32, 2021-02-06 06:11:57

How to understand the principle of working with a database?

This is a very stupid question, please understand. The opinion has strengthened in my mind that a database is such a file, by analogy with a text file or Excel tables. In fact, it turns out that there are such little-understood entities as a connection and a server. How can I work with the database, transfer it from the local server to the site, if it is not some kind of file? If I am working on a desktop program, then where can I get all these connection strings, login, password, if with an Excel spreadsheet file it’s enough just to know the path to it (and if it doesn’t exist, then create it accordingly)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hint000, 2021-02-06
@rundll32

In my mind, the opinion has strengthened that the database is such a file

In the simplest case, it is. The database can indeed be stored in a single file. In more complex cases, the database is stored in several files, or in a folder with many files, or in many folders with files, or it may occupy an entire disk partition or an entire disk (so no files and folders can be seen), or even thousands of disks, including disks on which one database is stored can be located in different cities.
As for the transfer. For example, a MSSQL database is contained in two files (the database itself and the transaction log) or in more files (at the discretion of the administrator); Indeed, it is enough to transfer these files and connect (attach) them to the DBMS in a new location. Another transfer option is to make a backup (dump) of the database (into one file), transfer this backup and restore from the backup in a new location.
The third option, which Dr. Bacon - migration. This is done either in the case of a complex structure, or in the case of a very large database and the inadmissibility of stopping work. For example, a large retail chain wants to migrate their database, but they have a 24/7 job, and the managers only allow a stop for one minute (for example), and the database transfer will take three days (for example).

D
Dr. Bacon, 2021-02-06
@bacon

1. "transfer it from the local server to the site" you do not need to transfer data, you only need to transfer their structure, for this they came up with migrations. Well, if earlier you had a path to the file, now instead of this connection parameters.
2. For a desktop, sqlite is most likely to work, there is a file there. Well, or another built-in DBMS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question