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.

 

lokijsbanner

 

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.  

 

lokijssq

Banner


Random Gifts For Programmers
24/11/2024

Not really random. Not even pseudo random, more stuff that caught my attention and that I, for one, would like to be given. And, yes, if I'm not given them, I'd probably buy some for myself.



Google Opensources Privacy Library
08/11/2024

Google is making a new differential privacy library available as open source. PipelineDP4J is a Java-based library that can be used to analyse data sets while preserving privacy.


More News

 

espbook

 

Comments




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

Last Updated ( Tuesday, 18 November 2014 )