Ragnarok

Ragnarok: LokiJS 1.1 [Jul] rises

Joe Minichino
2 min readDec 22, 2014

--

Lots of Yule goodies with LokiJS 1.1 [Jul], The fast in-memory javascript datastore.

A bit of [optional] background

This year’s winter solstice occurred at 23.03 UTC on December 21st. I decided to wait and hit the enter button for “npm publish” for version 1.1.1 till that exact moment to give rightful seasonal tribute to the Gods. Loki is the Norse god of mischief, and I thought it quite mischievious to write a database in javascript, hence the name. Loki is also a pretty chaotic character, in the Edda you’ll see him helping Thor as much as you’ll find him causing trouble for him, and LokiJS quite resembles Loki in that respect: you’ll find it powering session-stores in the backend as much as powering webpages and mobile apps. The similarities pretty much end here, but given this Norse “heritage” to LokiJS we decided to give Germanic inspired names to releases, and choose meaningful dates to do so. At least in this early phase of LokiJS’s life, I’m not too obsessed about it.

So, this particular release is called Jul, from the Old High Germanic name of December.

What is new in 1.1

Lots of improvements and advancements in 1.1, namely:

  • Persistence Adapter for IndexedDB (and plugin functionality, roll-your-own-adapter)
  • Changes API (with full snapshot of objects, not just IDs)
  • Improved Database and Collection constructors, with lots of optional config parameters
  • periodic autosave
  • increased MongoDB API compatibility (this is ongoing work)
  • compound sort on multiple columns

Among issues and bug fixes that were addressed:

  • event listeners are now optionally async
  • renamed the id property of objects to $loki to avoid conflicts
  • optionally clone objects when inserting them into the db
  • insert class instances in the db, and de-serialize them as such (i.e. inflate a collection of users into instances of a User constructor)

The World after Ragnarok

There are a lot more changes coming into LokiJS soon enough, Jolablot is only 12 days away though so in all likelihood there’ll be a 1.1.2 bug-fixes release, but nothing more.

The future is extremely bright though, LokiJS is seeing rising adoption in a number of contexts and the feedback from the community has been excellent and very helpful to improve LokiJS, particularly on the session-store and browser districts,

Among future features are:

  • MRU cache
  • key/value store collections (I already have a prototype working in the experimental branch)
  • server standalone (tcp and http wrappers and clients)

and much more.

Happy Yule / Christmas from Loki.

--

--