Mobile apps aren’t useful without existing data
In order for mobile applications to be useful as sales channels for the enterprise, access to existing corporate data is key. Without access to this back end data, mobile applications cannot cross the threshold of being relevant for an enterprise’s line of business. Today mobile backends are being either provided as a hosted service also called mBaaS (mobile Backend-as-a-Service) or being built in-house by developers.
The majority of mBaaS providers assume that you’re building your mobile app from scratch and that no legacy data exists. This means that private application’s data ends up getting locked up in the provider’s cloud. The truth is that enterprise mobile applications are being developed mostly as an extension to an existing platform rather than a brand new one. These applications might be used by employees, sales personnel, field operations (B2E) or as a new consumer sales channel (B2C). By their function, these mobile apps need access to the same enterprise data sets that traditional web apps have been using for years.
Existing data sources typically reside inside the datacenter and increasingly in a private cloud. Existing distributed systems like ERP, enterprise databases like Oracle, et cetera on contain business critical data that traditionally has only been available to legacy or web apps. To help simplify data access from mobile devices to these distributed platforms, StrongLoop announced LoopBack earlier this year. LoopBack is an open-source mobile API tier, built on top of Node.js. The diagram below shows LoopBack and how it interacts with various services and data sources.
LoopBack addresses the shortcomings of existing mobile backend services:
- Most are available only on public clouds with limited enterprise access.
- A higher cost due to “hosted service”. Usually priced by number of APIs or users, which is expensive to scale.
- Mobile apps need access to new data and existing data behind the firewall.
- Most mobile back ends are built using proprietary stacks with built-in lock-in.
- Some mobile back ends are built with Java or Ruby, where Node is the superior choice for mobile backends.
In contrast, Loopback can be run on-premises or in the cloud with enterprise connectors for Oracle, MySQL, MongoDB, In-memory datastore and REST services. LoopBack’s roadmap includes connectors for Postgres, SQLServer, SOAP, ATG Dynamo, SAP, Salesforce.com and Oracle Apps among others. LoopBack allows remote-able functions, that support dynamically saving data and invoking server-side functionality from mobile clients. Hence users can perform CRUD functions on the database directly from their devices. LoopBack provides data discovery and modelling to aggregate or mashup data objects from multiple data stores. Then it’s API engine generates JSON REST API for the modelled objects. Finally LoopBack provides SDKs for Android and iOS to make it easy to consume these REST API from the client application.
A mobile backend should do more than just surface APIs
Just like Loopback, any mobile backend needs to satisfy following the criteria of enterprise use cases to be successful:
- Access to legacy, current generation and evolving data sources.
- Advanced modelling to slice & dice or aggregate data objects to fetch complex queries from backends with No SQL.
- Easy generation of REST API services for direct/remote data access from mobile apps.
- Easy generation of REST API services for consumption by application logic.
- Mobile application management services like push notification, geolocation, file, etc.
- API Security management.
- API infrastructure management.
- Tooling and Automation.
The above listed functions and automation hugely reduce complexity, increase speed of development and reduce Go To Market time for a mobile app. In the diagram below we expand on the essential functions that Loopback delivers. When StrongLoop started to design an open-source mobile backend for the enterprise, time to accrue ROI from the product was primary success criteria. Loopback was designed specifically to address the use cases listed above. We ensured that the automation was present to help standup rich backend services in a matter of minutes vs days and months traditionally associated with these projects. The below example code snippets show, how easy it is to connect to an existing data store and dynamically create models and RESTful API endpoints for accessing the data objects.
Create a project and a product
Model the product
Create a data source
Generate REST APIs automatically
Push notification to iOS device
Node.js is the platform of choice for mobile backend
User experience on mobile devices is key to customer stickiness. In the early days of the web, response times of 2-3 seconds were acceptable when users submitted a form and patiently waited for the response page to load. Smart web designers often cached content on CDNs and client-side to render static elements faster and render visualization preemptively to logic. On mobile, CDN technology and caching is not mature. Users access app components and expect instantaneous data. To achieve this, small snippets of data are fetched based on user events usually using API calls. These snippets must have a very light payload and must render content in milliseconds. Following are key design criteria for mobile backends.
- Low latency.
- High concurrency.
- Streaming data.
- Evented models rather than request/response model.
- Caching and sync.
- Seamless technology integration.
Top use cases where Node.js has been very popular are JSON API and single page apps. Both of these enable mobile/mobile-web applications to gain parity and sometimes a competitive advantage over legacy web applications. Node supports the workloads of a mobile backend: small and frequent structured data exchanges. Hence, it is ideal candidate for I/O bound applications that involve exchanges of information rather than computational processes, which are CPU bound.
We hope this blog provided insights into mobile back ends and general back end development using Node.js. We also covered why Node has become the platform of choice and hugely popular as a glue for mobile to the backend. In the part 2, we will talk about the front end development using technologies like Angular.js, Bootstrap.js, Cordova/PhoneGap, Backbone.js, etc and how they can be integrated seamlessly with a node back end.
- Find out more about LoopBack.