Hello.
I am looking for any database designed for file storage.
Moreover, DB has to store the history of operations for example: "user created a new file", "user removed the file" etc.
I thought about:
surrealdb (but it does not support for file storage).
SQLite can notably be faster than the filesystem for storing files up to a certain (reasonable) size, and it's a well-established, battle-tested embedded DB. The rusqlite bindings are solid and maintained, although a little annoying to work with.
mongodb is a classical client-server DB. It probably scatters your "files" all over the place (in its own directory structure), so it will be annoying if you ever need a backup. Also, it's designed for storing documents – I'm not entirely sure how efficient it would be to store big blobs as a BSON binData object, but do note that parsing a BSON object needs to go through a couple of hops (due to how the data format itself is designed) in order to access subfields, and you can't store just blobs in MongoDB – every top-level member of a collection must be a document.
In addition, there's a hard-coded, per-document size limit of 16 MB in MongoDB, which is awfully small if you need to store "files". SQLite has a configurable limit on BLOB sizes, which is also much larger by default: 1 GB (109 bytes), but you can raise it to as much as 2 GiB (231-1 bytes).
Thanks for your reply.
I would like to try SQLite.
Does SQLite have a driver for async programming (tokio.rs)?
The rusqlite is not async. I have found tokio-rusqlite but is very young.