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

meaning of "in-memory" #749

Closed
mesqueeb opened this Issue Mar 19, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@mesqueeb
Copy link

mesqueeb commented Mar 19, 2019

I usually don't open the same issue twice, but I'm afraid it might go unnoticed on StackOverflow, so here goes:

LokiJS says it's an:

In-memory JavaScript Datastore with Persistence

But I don't understand what "in-memory" means. How is "in-memory" indexedDB different from regular indexedDB? 🧐

As I'm under the impression that usually "in-memory" means non-persistent.
But LokiJS is "in-memory with persistence". 😃

@Viatorus

This comment has been minimized.

Copy link
Collaborator

Viatorus commented Mar 19, 2019

Operate (insert/modify/query...) in-memory (RAM).
Save/load a backup to/from disk (persistent) using LocalStorage/IndexDB/FS....

@mesqueeb

This comment has been minimized.

Copy link
Author

mesqueeb commented Mar 19, 2019

So you mean to say instead of writing and reading directly from the indexedDB Loki would first load the DB into RAM and work from there? Then sometimes push changes back to the actual indexedDB?

Is this better to how a library like Dexie works? I’m trying to choose which one to learn and use.

Sent with GitHawk

@Viatorus

This comment has been minimized.

Copy link
Collaborator

Viatorus commented Mar 19, 2019

Yes. You can manual trigger saveDatabase or use the autosave functionality.

Dexie is limited to IndexedDB and its options. I would prefer learning LokiJS because it is more flexible.

@mesqueeb

This comment has been minimized.

Copy link
Author

mesqueeb commented Mar 19, 2019

Thanks a lot! ☀️

@mesqueeb mesqueeb closed this Mar 19, 2019

@mesqueeb

This comment has been minimized.

Copy link
Author

mesqueeb commented Mar 19, 2019

For anyone come looking for extra information on this. The introduction on YouTube is also helpful:
https://youtu.be/jgW23Uo-XZ8

Also be sure to check out this StackOverflow question & answer:
https://stackoverflow.com/questions/55233077/in-memory-db-lokijs-vs-regular-indexeddb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.