DB DB: database size

I save ~ 2500 images as attachments in one document in CouchDB. These images occupy approximately 15 MB on the hard drive, and the resulting CouchDB is approximately 17 MB.

When I push this document to my client through PouchDB, I saw that the resulting database is over 40 MB. I did some tests by following these steps:

  • Download X-image attachments to a CouchDB document.

  • Compact couchdb

  • Clear client’s cache completely

  • Refresh client (in my application, I replicate data on reboot).

This is the result:

number of attached files | Total size (KB) in HD | Inc | Size in Indexed DB | Inc
17                         129                           207
27                         168.2                   39.2  267                  60
37                         219.6                   51.4  335                  68
47                         275.5                   55.9  414                  79
57                         327.7                   52.2  493                  79
67                         384.9                   57.2  579                  86
77                         428.5                   43.6  654                  75

So it seems that:

  • PouchDB adds approximately 2K control data to each attachment.

  • Management data grows when additional attachments are added. (1.6K β†’ 2.3K β†’ 2.6K β†’ 2.8K ...)

content_type: image/png CouchDB, PouchDB. , base64. ?

- ? - ? , iOS 50MB.

pouchDB :

  • 1: orig size = 7.4K/PouchDB size = 10.2K

  • 2: orig size = 5.1K/PouchDB size = 6.8K

, , PouchDB - ( , ), , IndexedDB ( Chrome ).

, - , PouchDB?

+4
1

, , , .

: , Chrome, :)

  • Node.js LevelDB LevelUP, .
  • Safari/iOS WebSQL, , .
  • IndexedDB, Blob API , Chrome, Chrome (issue).

, Chrome. , , , base64 (source).

Chromium ( 48 ), , , Chrome . , PouchDB , blob .

: Chrome , Blobs PouchDB Chrome v43.:)

+4

Source: https://habr.com/ru/post/1541033/


All Articles