BackFire: Firebase bindings for Backbone.js
A lot of you have been asking for an easier way to integrate Firebase into your Backbone app. Today, we’re really happy to announce BackFire, our official bindings that make it easy to power your new or existing Backbone apps with Firebase. Backbone apps built with these bindings gain all of the advantages of Firebase:
- Real-time data updates
- Easy scaling
- First-class security
- Offline data access
- Rapid development
Check out an example in action - we updated the famous Todo example (that every Backbone developer is probably familiar with) to be completely server-less and real-time. All changes made by a client are automatically synchronized to all other clients, and the DOM is updated instantaneously, Trello-style! Go ahead - try opening the example in two different browsers and adding a few todo items. Note that this is an entirely server-less app, which is why we were able to host it on GitHub Pages.
How does BackFire work?
We’ve overridden the Collection object in Backbone so that it synchronizes directly with Firebase. With a Firebase-powered Collection, all updates made on one client will automatically be synchronized with our servers and with all other clients. You don’t have to worry about local data or remote data, or how it will be synchronized. There’s just data, and it’s the same everywhere.
Once you include the library, you’ll have access to a new collection object, called Backbone.Firebase.Collection:
You can now use this object as you would any regular Backbone collection, with the important difference being that all changes to this collection will immediately show up on all your other clients!
If you already have a Backbone application where you’d prefer to continue using the sync method to control data changes, BackFire can help you here as well. We’ve overridden the sync method to save data to Firebase and pull in new changes.
Making your Backbone.js powered application real-time is now easier than ever. You can find BackFire, along with the real-time Todo example on Github.
We’d like to thank Alex Bain, who wrote the first ever Backbone binding for Firebase, as well as Michael Wulf, Harry Shoff, and Spike Brehm for their extremely valuable feedback on early versions of these bindings.
Finally, we’ll be at the Backbone Study Group tonight (Jan 29th) at AirBnb HQ in SF. Come by and hack with us!
That’s it, grab a beta key and start hacking now.
More Firebase Articles
- Feb 19, 2014
- Announcing Thinkster's AngularJS + Firebase Tutorial
- Feb 04, 2014
- Firesafe: Add Complex Security Logic to Your Firebase App
- Jan 21, 2014
- Firebase at ng-conf 2014
- Jan 14, 2014
- Follow Firebase at the First Ever AngularJS Conference: ng-conf!
- Jan 02, 2014
- Queries, Part 2: Advanced Searches with Firebase, made Plug-and-Play Simple
- Dec 31, 2013
- Happy New Year from Firebase
- Dec 19, 2013
- Wearing Firebase on Your Wrist: Firebase & Electric Imp Team Up to Hack Hardware
- Dec 16, 2013
- Building an Ember.js App With Firebase
- Dec 12, 2013
- Firebase + Famo.us is the Future of App Development
- Dec 10, 2013
- Talkboard by Citrix: Collaborative Drawing with Firebase