Giter Site home page Giter Site logo

Comments (3)

Losses avatar Losses commented on August 27, 2024

If you are talking about the insert / update / error event, the cost of listening to these events are pretty low so it's safe to do that, but if your data updating logic on the Svelte side is heavy, remember throttle the update callback.

The main bottleneck is probably the adapter, if you are selecting an incorrect adapter for a looooooooooot of data, the performance of serialization would be pretty low.

Most of the adapter are built for Node.js so I assume you:

  1. Do not need to persistence the data into the hard disk.
  2. Implemented your own persistence adapter with Rust since you are using Tauri.
  3. Sync your data with the Changes API.

A detailed description would help a lot to let me know what you are expecting from this library.

from lokijs.

sc00 avatar sc00 commented on August 27, 2024

If you are talking about the insert / update / error event, the cost of listening to these events are pretty low so it's safe to do that, but if your data updating logic on the Svelte side is heavy, remember throttle the update callback.

The main bottleneck is probably the adapter, if you are selecting an incorrect adapter for a looooooooooot of data, the performance of serialization would be pretty low.

I understand, thanks!

Most of the adapter are built for Node.js so I assume you:

  1. Do not need to persistence the data into the hard disk.
  2. Implemented your own persistence adapter with Rust since you are using Tauri.
  3. Sync your data with the Changes API.

I'm currently moving away from Tauri due to an unrelated issue (I've been using sqlite with the old setup). Now I'm switching over to Electron, so Node it is and LokiJS came into play :) I do need to persist data into the hard disc though!

A detailed description would help a lot to let me know what you are expecting from this library.

I need to store documents in 4 collections. I expect them to hold no more than 5000 documents combined (probably much less on average - maybe around 1000). The documents hold objects with 5-30 properties (1 level of nesting max).

Within the app there's a list of all items for every collection (separate routes). I need to experiment with performance, but I'll probably put a limit on the query. I need to be able to filter each list with a search term that will be compared against a couple of properties.

As of now when I run an operation like insert/update/remove, I don't re-run the query but update the list from the frontend accordingly. Of course this was less convenient to write, but since I now have the option to use an observable, I wonder if I should get rid of all of this code :)

from lokijs.

Losses avatar Losses commented on August 27, 2024

I think your use case is safe, good luck.

BTW, avoid using loki-fs-structured-adapter, it is buggy.

from lokijs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.