size database (db), backups (rdm)and restored database (db)

size database (db), backups (rdm)and restored database (db)

avatar

I have a question regarding the size of the db and rdm files.

I have a original database size of 4000KB
I backup this database to a rdm file, which size is only 400KB
When I restore this backup (rdm) to a new database (db) the size is 1000KB

How can these change in sizes be explained?
So between db and rdm, and again back to db...

All Comments (3)

avatar

What database? SQLite? MySQL? MariaDB? MS SQL?

Regardless, databases and text files are very different. RDM manages then differently and offer different advantages, for example all of database based data sources support entry history, the .rdm format does not. These entries must be stored and take up more disk space. Databases will also contain schema objects like table structures, indexes, primary & foreign keys. Furthermore databases must manage things like physical pages of the disk and store transaction logs. So yes, a database will usually be (much) bigger than a simple text (XML) file. This is completely normal and to be expected. There are, however, ways, depending on the database used, to reduce (temporarily) this overhead disk space (compact the database). In most cases (most) experts will advise against compacting/shrinking of the database for a plethora of reasons. I will let you go down that rabbit hole on your own. You can also, in RDM, perform the cleanup actions for logs, entry history, and so on and so forth.

Best regards,

Stéfane Lavergne

avatar

Hi Stéfane

I use SQLite.
Now it is explainable. The source db has things stored like entry history. When I do a automatic backup to a rdm
this information is not back-upt to the rdm I think. Therefor the rdm is 90% smaller. When I create a new SQLite database
and restore the rdm into it, it is bigger than the rdm because of the "Databases will also contain schema objects like table structures, indexes, primary & foreign keys",
but smaller than the source db because the entry history is still missing. Over time it will of course grow..

avatar

Yes, you got it, that is a good summary.

Best regards,

Stéfane Lavergne