Caching remote data in Local Storage with EmberData

Just to “bump” this thread up a little, because it was one of the top results when I researched solutions for ember local cache of restful api, etc.:

Dan Gebhardt seems to do a bloody good job with Orbit.js and its integration into Ember:
https://github.com/orbitjs/ember-orbit

Orbit is a standalone library for coordinating access to data sources
and keeping their contents synchronized.

Orbit provides a foundation for building advanced features in
client-side applications such as offline operation, maintenance and
synchronization of local caches, undo/redo stacks and ad hoc editing
contexts.

Orbit.js features:

  • Support any number of different data sources in an application and provide access to them through common interfaces.

  • Allow for the fulfilment of requests by different sources, including the ability to specify priority and fallback plans.

  • Allow records to simultaneously exist in different states across sources.

  • Coordinate transformations across sources. Handle merges automatically where possible but allow for complete custom control.

  • Allow for blocking and non-blocking transformations.

  • Allow for synchronous and asynchronous requests.

  • Support transactions and undo/redo by tracking inverses of operations.

  • Work with plain JavaScript objects.

And don’t miss his great speech and slides about Orbit:
Introduction to Orbit.js

(UPDATE: I added some more descriptive information from the Orbit pages, as my posting got downvoted for “just” referencing external resources and not containing the actual solution in itself. But Orbit seems to me like the solution, and the only way to “include” this here is via links.)

Leave a Comment