I'm considering switching to Ember.js for one of my Sinatra applications. Our current setup is using server-side Handlebars rendering along with RESTful routes for CRUD operation and Websockets for push notifications.
My main concern, however, is duplication of model code.
Ember Data is a library for loading models from a persistence layer (such as a JSON API), updating those models, then saving the changes. It provides many of the facilities you'd find in server-side ORMs like ActiveRecord, but is designed specifically for the unique environment of JavaScript in the browser.
From what I understand, to use Ember.js, I need to define my models in Javascript, thus duplicating a lot of the Mongo models that we already have server-side. Is this correct? How is it possible to mitigate code duplication in models when using Ember.js in combination with a Ruby backend?