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

Batch larger serialisations #194

Open
elmarti opened this issue Sep 22, 2021 · 2 comments
Open

Batch larger serialisations #194

elmarti opened this issue Sep 22, 2021 · 2 comments

Comments

@elmarti
Copy link

elmarti commented Sep 22, 2021

Current behavior

Node has an internal string length limit, meaning that any data larger than 2GB. will fail with a string length error, when we run JSON.parse here https://github.com/LokiJS-Forge/LokiDB/blob/master/packages/loki/src/loki.ts#L687

Expected behavior

Any size of data will be eventually serialized without error

What is the motivation / use case for changing the behavior?

Allow the batch insert of large quantities of data greater than 2GB

Environment


LokiDB version: 2.1.0

Node v14.17.0


Others:
- We could add an explicit batch length like knex does in their `batchInsert` method https://knexjs.org/
- We could internal batch inserts with an arbitrary value than can be overridden in DB config e.g batches of 10,000
@elmarti elmarti changed the title Batch larger FS writes Batch larger serialisations Sep 22, 2021
@lustremedia
Copy link

Am I hitting this issue here? nuxt/content#947 would be great if that got fixed!

@elmarti
Copy link
Author

elmarti commented Jan 9, 2022

@lustremedia I attempted, but it's quite fundamental to how Loki works so it would be pretty significant, also note that this is somewhat unmaintained #190 (comment) - I can recommend the successor that I wrote that doesn't have this issue - main caveat is lack of indexing at this point (in the near future), although it performs pretty well without it https://github.com/elmarti/camadb

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

2 participants