-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[v2] Consider different method of persisting nodes data #6656
Comments
It'd be nice to make this pluggable. Most sites are fine with the existing serialization but a simple API could be built to allow for plugins to take over persisting changes. It'd be nice too then to persist individual changes instead of the entire data tree each time as that's much faster obviously. |
It would be nice to have this in, I am building an prototype using Gatsby for my company's static website and we have a Contentful space with about ~9000 entries excluding assets and 8 active locales. Thanks to #6611 I can build the website without facing OOM issues but however it takes far too long at Right now the time it takes is a deal breaker for us but I love the flexibility that Gatsby offers hoping to see this and would love to help in testing this PR against our static website. |
Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open! |
This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue. |
Let's re-open this--worth considering this again. We have #10732, which may help, but worth considering if there are better approaches. Some things I was thinking:
As @pieh notes, most important is that we don't introduce a significant performance regression in most sites for the benefits of few. However, we also need to make Gatsby more scalable to larger sits, and a key bottleneck currently is persisting large amounts of data in memory. |
@DSchau Two more things to note wrt to using LokiJS as a node store: (i) this will require breaking the nodes namespace out of redux anyway or at least make it easy to swap backends there; (ii) Loki has its own persistence adapters. |
This should be mostly fixed (for now) with #10732 |
Currently we serialize entire nodes map every time we save redux state to
.cache/redux-state.json
- this gets problematic when we hit scenarios with large amount of nodes - it might lead to high memory footprint and longer than necessary I/O when we save state.Potential solution would be switching to sqlite ( f.e. https://github.com/JoshuaWise/better-sqlite3 ) or some noSQL document store which could handle incremental in more performant manner. We can listen to
CREATE_NODE
andDELETE_NODE
actions and incrementally update persisted data without serializing entire nodes map. Because this would be used just for persistence - I think we really only need performant key-value (id->node) store that handles incremental updates nicely.Initial list of things to consider:
_.debounce
(as of right now after bootstrap ingatsby develop
)Ref: #6611
The text was updated successfully, but these errors were encountered: