LokiJS - A JavaScript Database
Written by Kay Ewbank   
Tuesday, 18 November 2014

LokiJS, a lightweight JavaScript document-oriented database has reached version 1.0. An in-memory database, it prioritises performance.




LokiJS supports field indexing for faster document access and performs at near 500,000 ops/s on those. Its built-in DynamicView class also enables to utilize indexes on data subsets for even faster performance.  



The main advantage for LokiJS is a combination of the very small size (14.66KB when unzipped) and the fast performance.

Recent benchmarks indicate that its primary get() operation is about 1.4 million operations per second on a mid-range Core i5 running under node.js. The get() operation utilizes an auto generated 'id' column with its own auto generated binary index. If you’re running a Mongo-style query object, you’ll get around 20,000 ops per second under node.js, or around 500,000 ops per second if you’re querying an indexed field.

LokiJS is designed to be used for in-memory datasets, though it does persist data between sessions, and will persist data to disk when changes are made in a nodeJS, node-webkit and environments. When you want to persist data between sessions, the entire database state can be serialized as a single entity, so you can restore the state or transfer it across environments as a single JSON entity.

You can set up field indexes for faster document access, and the database includes a built-in DynamicView class that you can use to make use of indexes on data subsets. LokiJS can be used in the browser or in a node.js environment.

The developers say that LokiJS draws inspiration from MongoDB and CouchDB, in that the API is similar (but not identical or compliant) to MongoDB and you can define your own views in a CouchDB style.

The fact that new databases are still appearing in the JavaScript space highlights the fact that there’s still no clear winner in what’s a confusingly crowded sector where alternatives such as NeDB, MiniRedis, and SQL.JS all have their fans. Whether LokiJS can become a market leader remains to be seen.  




Now Perl 6 Is Raku, Perl 5 Can Be 7

After Perl 6's renaming to Raku, acknowledging that it really is another language, Perl can now use number 7 without fear. It already has claimed the newly freed territory with the announcement that P [ ... ]

Udacity's New Nanodegree In CyberSecurity

The latest new nanodegree from Udacity's School of Programming gives participants a start in the high growth field of Cybersecurity. Currently Udacity is offering discounts and other financial support [ ... ]

More News






or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 18 November 2014 )