Need advice about which tool to choose?Ask the StackShare community!

LokiJS

25
42
+ 1
3
Mongoose

1.7K
1.2K
+ 1
55
Add tool

LokiJS vs Mongoose: What are the differences?

Developers describe LokiJS as "In-memory JavaScript Datastore with Persistence". LokiJS is a document oriented database written in javascript, published under MIT License. Its purpose is to store javascript objects as documents in a nosql fashion and retrieve them with a similar mechanism. Runs in node (including cordova/phonegap and node-webkit), nativescript and the browser. On the other hand, Mongoose is detailed as "MongoDB object modeling designed to work in an asynchronous environment". Let's face it, writing MongoDB validation, casting and business logic boilerplate is a drag. That's why we wrote Mongoose. Mongoose provides a straight-forward, schema-based solution to modeling your application data and includes built-in type casting, validation, query building, business logic hooks and more, out of the box.

LokiJS can be classified as a tool in the "In-Memory Databases" category, while Mongoose is grouped under "Object Document Mapper (ODM)".

LokiJS and Mongoose are both open source tools. Mongoose with 19K GitHub stars and 2.63K forks on GitHub appears to be more popular than LokiJS with 4.95K GitHub stars and 389 GitHub forks.

Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of LokiJS
Pros of Mongoose
  • 3
    Can query the objects directly
  • 17
    Well documented
  • 16
    Several bad ideas mixed together
  • 10
    JSON
  • 8
    Actually terrible documentation
  • 2
    Recommended and used by Valve. See steamworks docs
  • 1
    Can be used with passportjs for oauth
  • 1
    Yeah

Sign up to add or upvote prosMake informed product decisions

Cons of LokiJS
Cons of Mongoose
    Be the first to leave a con
    • 3
      Model middleware/hooks are not user friendly

    Sign up to add or upvote consMake informed product decisions

    - No public GitHub repository available -

    What is LokiJS?

    LokiJS is a document oriented database written in javascript, published under MIT License. Its purpose is to store javascript objects as documents in a nosql fashion and retrieve them with a similar mechanism. Runs in node (including cordova/phonegap and node-webkit), nativescript and the browser.

    What is Mongoose?

    Let's face it, writing MongoDB validation, casting and business logic boilerplate is a drag. That's why we wrote Mongoose. Mongoose provides a straight-forward, schema-based solution to modeling your application data and includes built-in type casting, validation, query building, business logic hooks and more, out of the box.

    Need advice about which tool to choose?Ask the StackShare community!

    What companies use LokiJS?
    What companies use Mongoose?
    See which teams inside your own company are using LokiJS or Mongoose.
    Sign up for StackShare EnterpriseLearn More

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with LokiJS?
    What tools integrate with Mongoose?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    Blog Posts

    JavaScriptGitHubNode.js+29
    14
    12185
    Jun 19 2015 at 6:37AM

    ReadMe.io

    JavaScriptGitHubNode.js+25
    11
    1955
    What are some alternatives to LokiJS and Mongoose?
    Redis
    Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams.
    SQLite
    SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file.
    Pouchdb
    PouchDB enables applications to store data locally while offline, then synchronize it with CouchDB and compatible servers when the application is back online, keeping the user's data in sync no matter where they next login.
    NeDB
    Embedded persistent or in memory database for Node.js, nw.js, Electron and browsers, 100% JavaScript, no binary dependency. API is a subset of MongoDB's and it's plenty fast.
    MongoDB
    MongoDB stores data in JSON-like documents that can vary in structure, offering a dynamic, flexible schema. MongoDB was also designed for high availability and scalability, with built-in replication and auto-sharding.
    See all alternatives