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


Microsoft Introduces SharePoint Embedded VSCode Extension
22/02/2024

Microsoft has released a preview version of a SharePoint Embedded Visual Studio Code extension, describing it as a new tool for developers who want to get started with SharePoint Embedded application  [ ... ]



Generative AI Training For All On Coursera
04/03/2024

Generative AI is on the loose, getting into business and commerce as well as into art, poetry and coding. Already useful, it  will become ever more useful as long as we use it properly. Coursera  [ ... ]


More News

 

raspberry pi books

 

Comments




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

Last Updated ( Tuesday, 18 November 2014 )