Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The serialized value is too large #229

Open
beljand opened this issue Jul 22, 2017 · 9 comments
Open

The serialized value is too large #229

beljand opened this issue Jul 22, 2017 · 9 comments

Comments

@beljand
Copy link

beljand commented Jul 22, 2017

When trying to persist DB, I often get an error saying:

DOMException: The serialised value is too large (size=133577246 bytes, max=133169152 bytes)

I've forked ForerunnerDB and updated to latest LocalForage (1.5.0), but the issue persist. The DB size on disk is 22-25MB. The collection that fails to persist has 9000-10000 items.

@beljand
Copy link
Author

beljand commented Jul 23, 2017

In fact JSON is larger than expected, probably larger than ~130MB, IDB size on disk is compressed.
Current assumption is that this is a Browser limitation.

Is there any other solution than splicing the collection into many collections (Collection Group), let's say 500 items per collection and then persist only one of the collections in the Group?

@tonyjoanes
Copy link

I'm just dealing with the same issue using localForage with Chrome. I think I will try and compress the data with something like lz-string and see if I can get a bit further

https://github.com/pieroxy/lz-string

@urossmerdelj
Copy link

Actually FDB already supports compression out of the box.
https://github.com/Irrelon/ForerunnerDB#data-compression-and-encryption

We ended up implementing a solution that splits data into multiple collections and grouping them in a collectionGroup (so we can query them all). Issue with grouping is that when inserting into a group the entity is inserted into all collections, so we use it for read only purposes and insert into a new collection when the last one reaches a certain size/count.

@Irrelon
Copy link
Owner

Irrelon commented Aug 2, 2018

@Ulkuurz That is a very interesting and novel way to solve the problem! Kudos!

@tonyjoanes
Copy link

Ah yes that's what I've had to do as well, splitting the data up has helped a lot!

@Irrelon
Copy link
Owner

Irrelon commented Aug 6, 2018

I'm rewriting ForerunnerDB from scratch in ES6 with a view to removing all of these annoyances. When I first coded FDB it was as an in-memory store for single page applications with absolutely no persistent storage layer at all so it wasn't designed with that in mind - I figured people would cache the HTTP calls that generated the data in the first place and replay them if they needed to. The rewrite will be persistence-first coding :)

@urossmerdelj
Copy link

That's great news, looking forward to that!

@Fadi288
Copy link

Fadi288 commented Mar 22, 2020

so we are no in 2020 and still my max size per objectstore is 133169152 ?? :(
still tehre is no workaround to solve this without having to split the wole image i wanna save as an array into many objectstores?

@Irrelon
Copy link
Owner

Irrelon commented Mar 23, 2020

@Fadi288 unless browsers increase that limitation then no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants