In most financial applications there is a wealth of interconnected data from various different sources. With the move toward web based platforms, JSON has become the ubiquitous data transfer format primarily due to its easy conversion to JavaScript objects. Within financial services, JSON now allows us to present data in a visual format. For example, if we have raw data about a trader’s current trade status we can now display that data on a graph within a personalised dashboard, as represented below.

[img]../../../images/img/JSONgraphblog2.png[/img]



The historic issue with JSON is that it doesn’t update to real time figures. Of course, a huge consideration when we apply this to financial services is that the stock prices change throughout the day which means that the JSON graph nodes are out of date within moments. Because of this we may end up returning an array of stock IDs along with the price that the stock was bought at. The issue with this is that it leads to a very chatty system with data that is difficult to cache, which is even trickier if the source of the live prices is different from the trader’s details.



But that is now all set to change after Netflix’s recent announcement of Falcor, a JavaScript library for efficient data fetching. Netflix have been making big inroads into highly scalable, distributed technology in recent years and contributing heavily to Open Source Software so they are well placed to do so. If you are old enough to remember the film ‘Never ending Story’ you might remember the lucky dragon who appears when he is most needed, then you will see the humour in the name of Netflix’s solution to this problem… Falcor!

In terms of the usability of Falcor, users are now able to express their domain model as a single virtual JSON graph comprising of multiple data sources. Falcor optimizes communication between your clients and your server by caching, bulking and intelligently traversing your JSON graph. It provides a very simple API with very few methods such as get, set and call which allow you to send and receive just the relevant data.

And best of all Falcor is framework agnostic!



Returning to our previous issue with the historic information being used in graphs, Falcor now offers us a solution to this issue. With Falcor the data is the essentially the API and we can traverse the JSON graph as if it was all present on the client.

The coding below shows the Falcor graph model used to model the same paradigm as before.







Falcor can now understand the graph and the connections between the nodes so that when we try to query then the correct data will be returned.



The beauty of using Falcor’s asynchronous API is that it no longer matters if the data is cached locally or remotely as Falcor can handle both for us.

In terms of its future, we believe that with data becoming more and more interconnected and remote that this will effectively allow the unification of data across different data sources. We see this playing extremely well with frameworks such as Angular 2.0 that provide asynchronous data binding. Through allowing Model View Controller (MVC) views to retrieve data from your applications will finally be achieve true MVC decoupling as the view will no longer need to ask the controller for data but instead request it directly from the model. This pattern is commonly referred to as Async MVC and detailed with use in Falcor during Jafar Husain’s appearance on the Angular Air YouTube channel.

We think that Falcor fills a real gap in the JavaScript ecosystem, elegantly simplifying data retrieval. In industries such as financial services where data comes from a diverse set of locations with data consistency being of paramount importance Falcor will exceed!
Tushara Fernando