At Twilio, we like to play with new and fun technologies. One
technology we have been exploring recently is client-side storage in
web applications. There are a few available options, but the one that
has gained the most adoption in modern browsers is javascript's
localStorage.

At its core, localStorage is a simple key-value store which uses
strings as keys and can only store strings as values. Even if you try
to store a non-string object into localStorage, it will be converted
into a string before it is saved. This means that the developer has to
worry about coercing the data back into the intended type before it is
used in code again. Still, localStorage's ability to save data between
sessions and browser restarts without relying on massive cookies makes
it an appealing storage mechanism.

We have a lot of experience with Redis at Twilio,
and we thought, "Wouldn't it be nice to have a Redis-like interface to
client-side storage in javascript?"

BankersBox is a javascript library that injects Redis-like steroids
into javascript data storage and uses localStorage as the default
persistent data-store. There is a pluggable storage adapter system to
allow other means of persisting the data stored in BankersBox.

Now you can store and retrieve any sort of native data type with
localStorage!

The implementation is not complete (notably Hashes and Sorted Sets
are not there yet), but we are actively working to add
functionality. There is a full suite of unit tests written in
CoffeeScript that run with the Expresso test framework for node.js.

Over the past few weeks, we have been developing several interal web
apps to test and dogfood our own products. Using BankersBox has made
working on these apps fast and fun.

We think that BankersBox can be useful for several different
applications: