I’ve been comparing Backbone.js and Ember.js for my project that needs to connect to a Rails REST API. I understand that Ember.js is more feature-rich compared to Backbone.js.
From what I’ve researched, Backbone.js offers multiple ways to interact with REST endpoints. However, with Ember.js, it looks like I need additional libraries such as ‘resources’ or ‘data’ to handle API communication. I’m confused why there are multiple libraries for the same purpose.
Which framework would be simpler to integrate with a REST backend? I’m also having trouble finding good examples that show how to make API calls like this:
// Example API call I need to make
const apiEndpoint = '../api/articles';
const method = 'GET';
const credentials = { username: 'user', password: 'pass123' };
const responseFormat = 'json';
Any recommendations or working examples would be helpful.
hmm interesting dilemma! have you considered what your team’s expereince level is with these frameworks? backbone might feel more straightforward initially but ember’s conventions could save headaches later. what’s your timeline looking like for this project?
I’ve worked extensively with both frameworks in production environments. Ember.js does require Ember Data for robust REST integration, but the confusion around multiple libraries stems from the framework’s evolution. Ember Data is now the standard and official solution, while older libraries like ember-resource are deprecated. The learning curve is steeper initially, but Ember Data provides powerful features like automatic relationship handling and intelligent caching that become invaluable in complex applications. Backbone’s simplicity is appealing for smaller projects, but you’ll likely need to build additional abstractions as your application grows. For your specific use case with Rails, Ember Data’s conventions align well with Rails API patterns, making the integration quite seamless once configured properly.
backbone is definetly easier for rest integration out of the box. ember’s ecosystem can be confusing with all those different data libs - ember-data is probably what you want tho. for simple crud operations backbone.sync works great with rails conventions without extra setup.