A database for mobile applications
To improve the user experience on mobile we often need to store, access and sync data to the user’s device. For web developers, this means having to bring in unfamiliar frameworks and platforms (e.g. Titanium, Xamarin, PouchDB/CouchDB) which come with a significant learning curve and add complexity to your project. Wouldn’t it be great if there was an easier way to create a fully-functional mobile client?
Web developers working with common front end frameworks (e.g. Angular, Ember and Backbone) and back end platforms (e.g. MongoDB and Node.js) who want to add a syncing mobile client with the minimum learning curve and additional programming effort.
LowlaDB is suitable for a wide variety of applications including:
Our technical objectives for LowlaDB are :
LowlaDB is designed as an easy-to-program JSON database for mobile devices. The developer API for LowlaDB is based closely on MongoDB to which we’ve added a number of mobile sync functions. An overview of the API follows here, but for more details on the direction in which we intend to take the API, see the documentation for the Node.js MongoDB driver here. In addition to the basic API, LowlaDB adds extensions to support real-time data updates and wherever possible offers promise-based APIs as an alternative to callbacks.
Mobile networks are much faster than they used to be. However, once sufficient bandwidth is available then latency becomes far more important than bandwidth in determining the responsiveness of an app.
There is a minimal improvement in page load time as mobile bandwidth increases beyond 5 Mbps, but a continuing linear improvement as latency decreases (graph from Ilya Grigorik, Google https://www.igvita.com/2012/07/19/latency-the-new-web-performance-bottleneck/ ).
Graphic credit: Ilya Grigorik (Google)
Wireless internet connections have surprisingly high latency (graphic courtesy of Mobify, http://www.mobify.com/blog/web-performance-optimization/). By locating the datastore on the device, our measurements show that developers can achieve a minimum 4-fold reduction in latency time for data access compared to a wireless connection. In typical real world conditions that advantage rises to 10X or more.
With real-world wireless networks it is not possible to guarantee that any device will be online 100% of the time. There are many network dead spots where coverage is poor or non-existent. Networks can become overloaded at peak times resulting in loss of access. Interference from other radio sources may cause severe packet loss. Well-designed mobile apps should not block the user when their device is offline, but continue to function and then sync their data with the back end system when the network returns. LowlaDB’s goal is to make it much easier to develop this kind of application.
We now carry many different types of devices – laptops, phones and tablets – each of which may be best for any given task. We want our apps to run on all of our devices and sync data automatically between them. In the future, the Internet of Things will add to this device variety. For all these reasons it’s important that LowlaDB is architected to make it easy to port to the widest possible range of platforms.
If your application needs to scale to larger databases, a later release of LowlaDB will add a specialized datastore implementaton designed to run in Cordova. Web applications built with LowlaDB will run in Cordova with no code changes required and will automatically detect and use the improved datastore. The Cordova implementation will also add features not possible in the browser such as overnight syncing.
Mobile apps are a combination of a front end running on the device and a back end running in the cloud or in an enterprise data center. These back ends are very diverse. They can be built on either SQL and NoSQL databases. They may provide a RESTful API to the front end, or some other kind of API across the network. To accommodate all of these different scenarios, LowlaDB provides a great deal of flexibility in connecting to different back ends. This is achieved by the provision of a modular adapter layer between the Lowla Syncer and the back end system.