Tutorial on accessing external databases

Martti, thanks for asking.

I will take SWI-Prolog database on disk to mean library(persistency)

It is not a capacity extension of the in-memory database.
It is not a replacement of the in-memory database as it is not a means to query facts and run predicates stored using this means.
It is not specifically a read-only backup but could be used as such.

If you have new data that is coming into a running instance of SWI-Prolog, e.g. reading a twitter stream, and you want that data to be available after the instance is shut down, then persisting the new data to a file is accomplished using library(persistency). You can then shut down the SWI-Prolog instance knowing the data will be available latter. When an instance of SWI-Prolog is started and needs the persisted data, using library(persistency) the data can be loaded and then more added as needed.

In other words SWI-Prolog without adding features, all of the data must be loaded into memory. Once the SWI-Prolog instance is halted and killed, all of the data in memory is lost. Now if the data existed in a *.pl file and was loaded into the instance this can be done again and again, but that does not allow for new data to be added without editing the *.pl files. library(persistency) gives you the feature of saving new data when an instance of SWI-Prolog is running, and being able to have it again after halting and starting a new instance of SWI-Prolog.

I don’t exactly understand that, so will pass at even attempting an answer.

No and I wish there was. I have written two detailed post here about using library(persistency) and while the second is much better than the first, neither one is even near general enough or talks enough about the entirety of library(persistency) to be of use as an introduction. There is enough examples in them to get you going, but the examples are very specific to the post. Also the first one is very confusing in itself so skip it if you can.

Trying to understand library(persistency
Solving two consecutive dependent goals from command line