Ember data in an on- and off- line scenario

Its a good idea but unless its mission critical, I would say wait a bit because you’ll probably get this for free soon. To make what you’re describing work, you actually would want all of that to happen automatically. In browser storage would serve as cache between the app and the api or backup. Both of these scenarios are covered by Orbit.js. You can watch an intro video on EmberSherpa YouTube Channel. Orbit adapter for Ember.js is in the works but its possible that Orbit might drive a future version of Ember Data(its just a matter of time)

@tarasm So does that mean, Orbit.js will eventually become ember-data’s core ? Or Orbit.js will be standalone library like ember-model ? If Orbit.js got implemented inside ember-data core that would take almost every possible architecture of the front-end data-sync even in offline . But not then lot of customization i guess.

1 Like

Orbit.js will eventually become ember-data’s core ?

That’s what we’re hoping is going to happen. Maybe Ember Data 1.3 :smile:

Or Orbit.js will be standalone library like ember-model ?

It will always also remain as a standalone library but more like Backburner.js power Ember’s Run Loop while being an external library.

If Orbit.js got implemented inside ember-data core that would take almost every possible architecture of the front-end data-sync even in offline . But not then lot of customization i guess.

Yep and yeeepppp

1 Like

@tarasm Thanks man for clearing a lot .

Now a general question, is there any ember app that provides offline support as of now ? If so I would like to inspect it.

I know one that’s going into production but its not open source. Its written by Kasper Tidemann he talks about it here http://vimeo.com/81960884 also this was just published on twitter Novelys - Building an app with Ember.js using HTML5 Storage APIs

Hi, where have you heard that an orbit adapter for ember is in the works? Do you know the author(s)? Is it opensource, or can we follow progress and/or contribute somewhere?

Hi I saw localforage from Mozilla after saw it in novelys.com and Really works great in many browser, is very new so appear good stuff, you can see more here localForage: Offline Storage, Improved - Mozilla Hacks - the Web developer blog

Just for other users that still have the problem. We created an Ember Data adapter for Mozilla’s localforage, see https://github.com/genkgo/ember-localforage-adapter. This gives you an offline adapter that works browser independently.

There is also Ember Sync now, see https://github.com/kurko/ember-sync. We haven’t tested it, but you could try to use them together.

1 Like

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 and integrating it into Ember:

https://github.com/orbitjs/ember-orbit

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

2 Likes

Yeah, I also saw it. Looks really great. I think Orbit-Ember has a better perspectives for the future. But we will have to wait till it gets stable. If read this correctly, it is not production ready.

Kurko great job keep going!!!

I just got @kurko ember-sync working in an example using both indexdb and localstorage. The localstorage one works in cordova as well, but of course indexdb isnt supported on iOS till 8. Here’s my example:

https://github.com/Genkilabs/ember-cli-example

You will need to provide your own RESTful JSON server if you want to try it. I used a Rails one.

Thanks @joseperales! I’ll be working kinda of full time with Ember.js for the next months, so I might have more time to work on Ember-Sync. I’m currently working on removing the additional store (Ember-Sync uses 2 stores too keep things in sync), so we can just use a RESTAdapter instead for the online source. Core team member has offered help too :slight_smile:

@alex let me know how it goes :smiley:

1 Like

We just released the new ember-pouch. To see an example go to https://bloggr.exmer.com wait for some data. Kill your wifi and close your browser. Than open your browser and go to https://bloggr.exmer.com again to see how this behaves off-line.