Remember me

Register  |   Lost password?

The Trading Mesh

Looking to Improve Mobile App Performance? Use an API Mash-Up Platform

Tue, 10 Apr 2012 16:35:30 GMT           

Over the last 5 years, more than a million mobile apps have been developed. (Source: http://www.nytimes.com/2011/12/12/technology/one-million-apps-and-counting.html).  Mobile apps can be grouped into two categories. The first category consists of mobile apps created for the consumer market. The second category is custom mobile apps developed for enterprises. Enterprises create mobile apps to support their particular business needs and to create a competitive advantage.  Enterprise mobile apps tend to be more complex to build, as the goal is to make PC-oriented applications work on mobile devices.

In this post, I explain the advantages Xignite’s financial API mash-up platform Splice provides in improving mobile app performance. Splice lets you create composite APIs by mashing and transforming other APIs. It also offers a visual designer where you can build the exact API you need to power mobile apps.

Advantage #1: Reducing Network Bandwidth

Network traffic is one of the biggest obstacles to mobile app performance. API mash-up tools like Splice let you reduce the amount of data returned, by letting you trim the output of APIs. This facilitates efficient memory utilization and improves mobile app performance.
Imagine you were developing a mobile app like OpenFin’s PNL tool, one that displays real-time financial market data. To get data, you would need to use the GetRealQuote operation from XigniteBATSRealTime. The data fields returned by this API are given below:

<Symbol>msft</Symbol>
<CompanyName>Microsoft Corporation</CompanyName>
<Date>3/28/2012</Date>
<Time>2:01:14 PM</Time>
<Open>32.55</Open>
<Close>0</Close>
<PreviousClose>32.52</PreviousClose>
<High>32.7</High>
<Low>32.16</Low>
<Last>32.16</Last>
<Change>-0.36</Change>
<PercentChange>-1.107</PercentChange>
<Volume>2442414</Volume>
<Bid>32.15</Bid>
<Ask>32.16</Ask>
<Spread>0.01</Spread>
<BidQuantity>9138</BidQuantity>
<AskQuantity>10621</AskQuantity>

For a mobile app, you might not need all the fields (for e.g. Volume, BidQuantity and AskQuantity). Essentially, you are transmitting more data than you need. A more efficient way to deal with this to trim the API output, which can be done using an API mash-up tool.

I trimmed the output of the GetRealQuote operation using Splice. It now returns only the high, low and last. The trimmed output fetched from the API is given below:

<Last>32.06</Last>
<Low>32.045</Low>
<High>32.7</High>

API URL: http://splice.xignite.com/CustomWS/CWSEditor.aspx?CloneSplice=rsrivastava_ReducingBandwidth_Splice

Keep in mind you must be logged into your Splice services account in order to receive data. If you don’t have an account, just sign up for a free trial.

Advantage #2: Reducing Overhead

Imagine you were developing an mobile app where you need to fetch both equity and foreign exchange(forex) quotes. The inefficient way to get data would be to:

  1. Make a request to XigniteBATSRealTime for an equity quote.
  2. Parse the response.
  3. Display it on the screen.
  4. Repeat the steps for forex quotes.

On mobile devices, each of these actions is resource intensive because it consumes battery life. On the other hand, if the equity and forex APIs are mashed up using a mash-up tool, all the data can be returned in a single API call.

<GetRealQuoteReturnObject>
<Last>32.26</Last>
</GetRealQuoteReturnObject>
<GetLatestCrossRateReturnObject>
<Rate>0.75094997882843018</Rate>
</GetLatestCrossRateReturnObject>

API URL: http://splice.xignite.com/CustomWS/CWSEditor.aspx?CloneSplice=rsrivastava_Reducing_Requests

This reduces the processing overhead and overall processing power required, improving mobile app performance.

Advantage #3: Parallel Processing (Speed)

An API mash-up such as the one above lets you process API calls in parallel. In the previous example, the equity and forex APIs are independent of each other. Splice is an API mash-up tool that automatically splits the request into two parts, gets the data in parallel from both APIs and then returns the output. The data is thus returned to the mobile app and as a consequence, to the user faster.
Like the previous example, there might be situations where parallel processing might be difficult to implement for a mobile app. In such cases, it might be best to leave the implementation of such functionality to a mash-up tool, like Splice.

API URL: http://splice.xignite.com/CustomWS/CWSEditor.aspx?CloneSplice=rsrivastava_Reducing_Requests

Advantage #4: Multiple Data Formats Available

Most mobile app developers prefer using REST instead of SOAP because it is a lightweight protocol. On the other hand, there are mobile app developers who still use the latter. Splice allows you to return data in multiple formats. After the API mash-up has been created, Splice gives you the following URLs:

WSDL URL: http://splices.xignite.com/rsrivastava_Reducing_Requests.wsdl
JSON REST URL: http://splices.xignite.com/rsrivastava_Reducing_Requests.json?Header_Username=yourauthenticationtoken &Symbol=MSFT&From=USD&To=EUR
XML REST URL: http://splices.xignite.com/rsrivastava_Reducing_Requests.xml?Header_Username= yourauthenticationtoken &Symbol=MSFT&From=USD&To=EUR
CSV REST URL: http://splices.xignite.com/rsrivastava_Reducing_Requests.csv?Header_Username= yourauthenticationtoken &Symbol=MSFT&From=USD&To=EUR

This gives you the freedom to use the data format that is best suited for your mobile app.

Advantage #5: Leaving the complexity in the cloud

Splice allows you to mash-up market data APIs with mathematical utilities. As an example scenario, consider a mobile app that has users all across the globe. It makes more sense to display stock quotes in the user’s local currency. Using an API mash-up, you can implement the currency conversion in the cloud. Leaving the complexity in the cloud saves you valuable processing power.
Using Splice, I created a mash-up that uses the GetLastQuote, GetLastCrossRate and UtilitiesMath operations to get the stock quote for MSFT and then convert it into EUR. The XML output for the mash-up is given below:

<GetRealQuoteReturnObject>
<Last>31.9</Last>
</GetRealQuoteReturnObject>
<GetLatestCrossRateReturnObject>
<Rate>0.75379249453544617</Rate>
</GetLatestCrossRateReturnObject>
<ReturnValue>24.04598057568073</ReturnValue>

API URL: http://splice.xignite.com/CustomWS/CWSEditor.aspx?CloneSplice=rsrivastava_ReducingBandwidth_Splice

Conclusion: As mobile app development is getting more complex by the day, it is important for developers to pay attention to performance. API mash-up tools are a great way to achieve this goal. The true flexibility and power API mash-up tools offer can only be gauged by using them. I invite you to try Splice. Please feel to let us know your views on it.

, , , , , , , , , , , , , , , , , , , , , , , ,

This is very interesting technology. I'd be interested in hearing from people that are making use of it. What are the trade offs between mashing up web services internally or using a service such as this?

Iver Band 2567 days ago,(2012/04/13)