[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: While you're packing (some questions about gb.db2)


Il 14/08/24 22:44, Christof Thalhofer ha scritto:
Am 14.08.24 um 15:04 schrieb Gianluigi:

Hi Fabien,

In my small database projects, I have always stored file paths and not
files (blob).
However, the files are always present in a folder, so they are stored on
the computer, with the problem that it is not enough to back up the
database to save the files.
Are you sure this system is more economical?

It's the best in most cases. Imagine what you store in a database and
what on disk if you want to keep documents and their description in this
example:

The database contains the path to the file and the description as
strings. If you need 1 kB for that per file and you have 1,000 files
then the data in your DB sums up to 1 MByte.

If you store the files in the filesystem and each file has 1 MB then the
files need 1 GB.

So you have 1001 MB on disk. 1 MB for the database and 1000 files.

Now imagine that every day you add one new file and delete one and you
want to backup that. On every Sunday you make a full backup and from
Monday to Saturday you create incremental backups which store only files
which had changed.

The backup in this scenario:

Sunday: 1000 files and database dump = 1001 MB
Every Mon to Sat: 1 new file and the database dump changed = 2 MB

So you have a total storage of 1001 MB + 6 * 2 MB = 1013 MB for one full
and six incremental backups.

Now imagine that you have everything (content of files and the
description) in the database which creates a database dump of 1001 MB
every day because every day one document was deleted and one was created
new.

Sunday: Database dump = 1001 MB
Every Mon to Sat: Database dump = 1001 MB

So you have a total storage of 7 * 1001 MB = 7007 MB

That's the reason why it is better to store only the paths as string in
the database and the files in the filesystem (in most cases).

Alles Gute

Christof Thalhofer


Hi Christof,

great explanation.

Thank you very much.

Good night
Gianluigi


Follow-Ups:
Re: While you're packing (some questions about gb.db2)Fabien Bodard <gambas.fr@xxxxxxxxx>
References:
While you're packing (some questions about gb.db2)Gianluigi <gradobag@xxxxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Gianluigi <gradobag@xxxxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Gianluigi <gradobag@xxxxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Bruce Steers <bsteers4@xxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Bruce Steers <bsteers4@xxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Gianluigi <gradobag@xxxxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Bruce Steers <bsteers4@xxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Bruce Steers <bsteers4@xxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Bruce Steers <bsteers4@xxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Fabien Bodard <gambas.fr@xxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Gianluigi <gradobag@xxxxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Fabien Bodard <gambas.fr@xxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Gianluigi <gradobag@xxxxxxxxxxx>
Re: While you're packing (some questions about gb.db2)Christof Thalhofer <chrisml@xxxxxxxxxxx>