The Web Tub
Published in

The Web Tub

LokiJS: in-memory NoSQL datastore for Cordova apps

LokiJS is a lightweight JavaScript in-memory database made by Techfort that provides a document-oriented alternative to the already well known SQLite. For many applications a NoSQL approach could be more preferable than relational data when working with complex object stores. LokiJS gives us the chance to do this in a very efficient way.

LokiJS is intended to be used as an in-memory database with the possibility of persisting the data. It is compatible with Node.js (filesystem) and browsers, which means that it can be also used in our hybrid mobile Cordova apps (localStorage and indexedDB).

A block of code is worth a thousand words:

Furthermore, LokiJS supports field indexing for faster document access and provides a built-in DynamicView class that also enables to use indexes on data subsets for even faster performance. DynamicViews work as queries that are recomputed in the background when data changes, so once a view is created you never have to worry about recalling or refreshing data, it is always updated and available.

It is also available for AngularJS through the lokijs module:

Its low footprint and high performance, along with a bunch of other features, make it worth giving a try! You can follow its Github repo here and learn more about it here. We hope you find this tool useful for your future hybrid apps!

Originally published at on July 8, 2015.




Pushing the web current through hybrid mobile and PWA technology. Presented by the Monaca and Onsen UI team.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Fran Dios

Fran Dios

I create apps from Tokyo with love. I also like tomatoes.

More from Medium

How to Implement Brute Force Attacks on Hash Values in JavaScript

CORS policy Error In Working With Graphql, ReactJs,Apollo client.

Setup authentication with React +Auth0 + Apollo Server

LinguiJS: Managing message catalogs across multiple application instances