Syncing data with Mobile CouchBase
As anyone who’s used one of Amazon’s Kindle apps knows, synchronization without user interaction is a priceless feature. As any programmer who’s built an app that persists data across multiple devices knows, synchronization takes a lot of work.
A todo list for accomplishing this task might look something like this:
- Ensure the device has connectivity
- Check last sync date
- Request newest items from server
- Parse response
- Check for existence of items. If new, insert new records. If existing, update attributes.
- Save current sync date
- Repeat as necessary
Then there’s the reverse for when data is created on the mobile device. Not only does a developer need to handle transitions in connectivity, offline to online, but also dropped connections in the middle of a sync. Doing this right takes a lot of time, consideration, programming and let’s not forget QA.
Enter Mobile CouchBase.
Earlier this year, Membase and CouchOne merged to create CouchBase. One of the components of this merger is Mobile CouchBase, initially an iOS-only implementation for storing, persisting and synchronizing data with a web-based backend from mobile apps. CouchBase is leveraging a key-value datastore not unlike the NoSQL solutions powering scalable websites.
I’m reminded of my first introduction to Amazon Web Services. Amazon took painstaking tech-heavy tasks like acquiring and configuring web deployment infrastructure and made it a simple focused task. Removing that complexity from the process of building rich web applications lowered the barrier of entry for a plethora of products and services to get up and running with a much smaller budget.
Whether or not Mobile CouchBase will do for mobile syncing what Amazon did for cloud computing remains to be seen. It does, however, underscore the potential for a distinct and foundational layer in ubiquitous computing poised to make the transition to a commoditized product or service. Once we as developers can forget about this layer we should expect to see a burst in the number and quality of mobile applications.
To implement Mobile CouchBase in your own iOS app, visit their github repository here.