Comments (4)
Hello Irreloon!
I have not used ForerunnerDB yet. Please do feel free to remove this comment if you judge it's out of place.
I just came across ForerunnerDB and it does sound interesting. I looked previously into loki.js and NeDB that are kind of similar to ForerunnerDB but the database is transfered into memory at load time and saved back onbeforeunload (or directly calling commit() .. i guess).
I rulled out both loki and NeDB because of that (in memory: means they are mutable stores) and also because of the fact that data is not automatically persisted (Just loading at startup and saving on leave). This is less than ideal if we imagine that a user encounters some fatal error while using the in-memory database (for instance, if localStorage or indexedDB cannot handle the final size of the data). That would cause all the user's work to be effectively lost.
I'd be using ForerunnerDB as an immutable data store. It'd also be neat if one can chose different storage facilities for different data entities. For instance, some sensitive data must be stored in sessionStorage which means it's erased when the logged in user closes the session. Putting such sensitive data in indexeddb leaves it accessible to other users on the same machine.
from forerunnerdb.
Hey @mehdi-cit your question is not out of place :)
I rulled out both loki and NeDB because of that (in memory: means they are mutable stores) and also because of the fact that data is not automatically persisted (Just loading at startup and saving on leave). This is less than ideal if we imagine that a user encounters some fatal error while using the in-memory database (for instance, if localStorage or indexedDB cannot handle the final size of the data). That would cause all the user's work to be effectively lost.
ForerunnerDB is also an in-memory store but you choose how often (if at all) data is loaded and saved with underlying storage engines.
I'd be using ForerunnerDB as an immutable data store
For the easy querying I would guess?
It'd also be neat if one can chose different storage facilities for different data entities. For instance, some sensitive data must be stored in sessionStorage which means it's erased when the logged in user closes the session. Putting such sensitive data in indexeddb leaves it accessible to other users on the same machine.
This is an excellent idea. Could you open a separate issue for this request so it can be tracked and committed against?
Many thanks for your comments and questions. 👍
from forerunnerdb.
Thanks for the quick reply. I did open a separate issue with even more points/ideas:
#36
from forerunnerdb.
This may get long, but here's an explanation of how I planned to use ForerunnerDB:
I work on an application where there is a large set of data, we have a set group of (very busy) users that each owns a portion of the records and are expected to manage them weekly (~25k per user). The number of records will be growing substantially in the near future (~250k per user).
We are moving towards MongoDB from Oracle, because of the complexity of the searches, to make managing data-sets possible for our users. We're using node with mongoose on the server side, React+Flux+webpack client-side. Many operations on the UI need to have much or all of the data-set loaded. Paging / executing many queries is something we are trying to get away from, as the user changes search criteria frequently and needs to reload parts of the same data-set over and over again.
We have classes written to query the mongoose models. Forerunner looks (mostly) compatible, so it would be a great solution for us to have a client-side API to query already-loaded data when a search changes. The rest of the code would remain common between the server and client. A mongoose (or similar) compatible API would mean the only difference between client and server would be loading db.js
vs db.web.js
for server/client -- which webpack handles for us.
An example code snippet:
FooDAO.js
/**
* Used by both client and server.
* Server loads Foo.js, client loads Foo.web.js
*/
import Foo from './Foo';
export function findAll ( criteria ) {
return Foo.find( criteria ).exec();
}
export function findOne ( _id ) {
return findAll( { _id } );
}
export function update ( record ) {
// ...
}
// ...
Foo.js
/**
* Server side db access to Foo collection
*/
import mongoose from 'mongoose';
// ...
// ...
export default mongoose.model( 'foo', fooSchema );
Foo.web.js
/**
* Client db access to Foo collection
*/
import forerunner from 'forerunnerdb';
// ... data already available ...
export default db.collection( 'foo' );
As you can see, with a few minor changes, we could easily plug in Forerunner and FooDAO
wouldn't have to know the difference.
from forerunnerdb.
Related Issues (20)
- Clarity about find(); HOT 2
- upsert that resolves to update does not update fields that start with '$' HOT 5
- TypeError: http.IncomingMessage.prototype is not an object or null HOT 6
- Support for $not operator HOT 3
- Interactive Demo HOT 1
- index not used when using query operator
- collection.load is very slow HOT 1
- Loading JSON file into forrunner db file and vice versa ? HOT 8
- Duplicate data when setData and ensureIndex HOT 1
- Adding event listener with an ID does not work HOT 2
- Dropping condition does not remove memory reference
- $replace with new documents?
- How does load work? HOT 2
- using Date query with $gte and $lte operators. HOT 3
- Typescript is outdated HOT 3
- Where can i find the database file?
- Weird query behavior when using elemMatch
- WebWorker import ForerunnerDB
- ⚠️ Web SQL is deprecated
- How to query condition on comparing 2 fields?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forerunnerdb.