Skip to content

storing files / blobs #109

Answered by appy-one
donl asked this question in Q&A
May 25, 2022 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

It's perfectly fine to store files in AceBase, you can store them as binary data (ArrayBuffer).

If you are only storing files in the database, you might want to increase the default storage settings: increase the recordSize to 1024 bytes and pageSize to 8192 records to allow AceBase to allocate more data in less records/pages. An 8KB file requires only 8 records with those settings, and 1000 8KB files can be stored in 1 page. The default storage settings (recordSize: 128 bytes, pageSize: 1024 records) are better for storage of JSON objects: an 8KB file would require 64 records, and only 16 would fit in 1 page.

const db = new AceBase('mydb', { storage: { recordSize: 1024, pageSize: 8192 } });

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@donl
Comment options

Answer selected by donl
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants