{"id":114563,"date":"2024-03-25T18:26:02","date_gmt":"2024-03-25T16:26:02","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/eksperiment-s-ispolzovaniem-sqlite-v-kachestve-kontejnera-dlya-arhivirovaniya-fajlov"},"modified":"2024-03-25T18:26:02","modified_gmt":"2024-03-25T16:26:02","slug":"eksperiment-s-ispolzovaniem-sqlite-v-kachestve-kontejnera-dlya-arhivirovaniya-fajlov","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/news\/eksperiment-s-ispolzovaniem-sqlite-v-kachestve-kontejnera-dlya-arhivirovaniya-fajlov","title":{"rendered":"An experiment using SQLite as a container for archiving files","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>The Pack project attempted to create a file archiving format based on the SQLite library and the ZSTD (Zstandard) compression algorithm. The prepared prototype, written in Pascal and distributed under the Apache 2.0 license, outpaced the most common archivers in terms of archive creation speed, as its operations involved reading data, compressing with the libzstd library, and performing SQL operations to add compressed data to a file with the SQLite database.      <\/p>\n<p>When compressing a directory with 81,000 files totaling 1.25 GB, pack proved to be 112 times faster than the ZIP utility, completing the operation in 1.3 seconds compared to 146 seconds for ZIP. The archive size with pack was 23% smaller (194 MB for Pack and 253 MB for ZIP). In comparison, the tar utility packaged without compression in 4.7 seconds and with gzip compression in 28.5 seconds, the RAR archiver completed the test in 27.5 seconds, and 7z took 54.2 seconds. The sizes of the archives were: tar.gz \u2014 214 MB, RAR \u2014 235 MB, 7z \u2014 135 MB. It is noted that regarding decompression speed and random access to files, Pack also outperforms other archivers while consuming less memory.\n       ZIP:     253 MB,  146 s           7z:      135 MB,  54.2 s     2.7 times faster than ZIP     tar.gz:  214 MB,  28.5 s     x 5.1     RAR:     235 MB,  27.5 s     x 5.3     tar:    1345 MB,  4.7 s      x 31     Pack:    194 MB,  1.3 s      x 112      <\/p>\n<p>The influence of the file cache on the test results is not mentioned. It is likely that the low speed of ZIP is due to the order of test execution without consideration for data caching in memory \u2014 the test with zip was run with a cold cache, while the others were run with a warm cache. Under normal conditions, Zstandard shows 3-5 times higher compression speed compared to zlib and performs decompression twice as fast, with a compression level that is 10-15% higher.       <\/p>\n<p>Addition: A similar idea of storing compressed files as blobs in an SQLite database was implemented in 2014 in the sqlar archiver, created by SQLite developers as an experiment to evaluate the effectiveness of storing blobs in SQLite. In sqlar, zlib is used for compression, and the file sizes are approximately 2% larger than those generated by the ZIP utility.<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=60842\">opennet.ru<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041f\u0440\u043e\u0435\u043a\u0442 Pack \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u043b \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0434\u043b\u044f \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0431\u0430\u0437\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 SQLite \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u0436\u0430\u0442\u0438\u044f ZSTD (Zstandard). \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Pascal \u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u043c\u044b\u0439 \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 Apache 2.0, \u043e\u0431\u043e\u0433\u043d\u0430\u043b \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u0440\u0445\u0438\u0432\u043e\u0432 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0432\u0430\u0442\u043e\u0440\u044b, \u043f\u0440\u0438 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043a \u0447\u0442\u0435\u043d\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0436\u0430\u0442\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 libzstd \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e SQL-\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u043e [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-114563","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041f\u0440\u043e\u0435\u043a\u0442 Pack \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u043b \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0434\u043b\u044f \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0431\u0430\u0437\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 SQLite \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u0436\u0430\u0442\u0438\u044f ZSTD (Zstandard).\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/news\/eksperiment-s-ispolzovaniem-sqlite-v-kachestve-kontejnera-dlya-arhivirovaniya-fajlov\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c SQLite \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043b\u044f \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041f\u0440\u043e\u0435\u043a\u0442 Pack \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u043b \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0434\u043b\u044f \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0431\u0430\u0437\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 SQLite \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u0436\u0430\u0442\u0438\u044f ZSTD (Zstandard).\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/news\/eksperiment-s-ispolzovaniem-sqlite-v-kachestve-kontejnera-dlya-arhivirovaniya-fajlov\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-03-25T16:26:02+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-03-25T16:26:02+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Experiment Using SQLite as a Container for File Archiving | ProHoster","description":"The Pack project attempted to create a file archiving format based on the SQLite library and the ZSTD (Zstandard) compression algorithm.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/news\/eksperiment-s-ispolzovaniem-sqlite-v-kachestve-kontejnera-dlya-arhivirovaniya-fajlov","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c SQLite \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043b\u044f \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 | ProHoster","og:description":"\u041f\u0440\u043e\u0435\u043a\u0442 Pack \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u043b \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0434\u043b\u044f \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0431\u0430\u0437\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 SQLite \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u0436\u0430\u0442\u0438\u044f ZSTD (Zstandard).","og:url":"https:\/\/prohoster.info\/en\/blog\/news\/eksperiment-s-ispolzovaniem-sqlite-v-kachestve-kontejnera-dlya-arhivirovaniya-fajlov","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2024-03-25T16:26:02+00:00","article:modified_time":"2024-03-25T16:26:02+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":[],"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/114563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=114563"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/114563\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=114563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=114563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=114563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}