Akilan1999 / p2p-rendering-computation

p2p network to enable running distributed computation and rendering.
https://p2prc.akilan.io/
GNU General Public License v2.0
27 stars 9 forks source link

Storing all information except config file in the sqlite file #78

Closed Akilan1999 closed 2 years ago

Akilan1999 commented 2 years ago

Problem

All the files such as IP tables and tracker containers/ grouping. Would be stored inside the SQLite DB. This is because of the faster read and writes compared to reading from the file system. Another is reason would be that the config file would have to point to lesser files and release file requires lesser boiler plate template.

Why SQLite ?

SQLite reads and writes small blobs (for example, thumbnail images) 35% faster¹ than the same blobs can be read from or written to individual files on disk using fread() or fwrite().

Furthermore, a single SQLite database holding 10-kilobyte blobs uses about 20% less disk space than storing the blobs in individual files.

The performance difference arises (we believe) because when working from an SQLite database, the open() and close() system calls are invoked only once, whereas open() and close() are invoked once for each blob when using blobs stored in individual files. It appears that the overhead of calling open() and close() is greater than the overhead of using the database. The size reduction arises from the fact that individual files are padded out to the next multiple of the filesystem block size, whereas the blobs are packed more tightly into an SQLite database.

The measurements in this article were made during the week of 2017-06-05 using a version of SQLite in between 3.19.2 and 3.20.0. You may expect future versions of SQLite to perform even better.

source: https://www.sqlite.org/fasterthanfs.html

Implementation

We will use Gorm as ORM(Object Relational Mapping) library which would interact and create the SQLite DB. Expected files to be converted to Sqlite DB

Models

Akilan1999 commented 2 years ago

This issue is closed because p2prc is aimed to be in pure go.