Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Application Overview

dussab edited this page Oct 19, 2012 · 13 revisions

Overview

vFabric’s Reference Application, SpringTrader (previously named Nanotrader), provides customers with an end-to-end solution for developing, provisioning, and managing a distributed application in a cloud environment. The reference application and architecture provide customers and partners with a blueprint for development, infrastructure, and operations teams.

The SpringTrader application is based on the web based Trading application, Day Trader. The legacy Day Trader application provides context for application modernization by representing the “before” picture while SpringTrader provides developers with a blueprint for achieving the “after” picture. Functionally, both applications allow users to login, view their portfolio, lookup stock quotes, and buy or sell stock shares. However, this is where their similarity ends. The following table describes key high-level differences in the application design:

Alt attribute text Here

High Level Architecture Overview

High Level Architecture

A. Presentation – SpringTrader’s user interface is built upon open standards such as HTML 5, CSS 3, and Javascript. The user interface provides an optimized experience for clients with different form factors: browser, tablet or phone. The majority of the client side code is shared regardless of the client type. Unlike legacy presentation techniques, the reference application never performs full-page refreshes from the server side (multi-page interface). Once loaded, the client side invokes the server side application services to retrieve data in JSON format. This way, only sections of the page that have changed are updated. This approach improves client side performance and overall usability of the application. Developers commonly refer to this approach as a single page interface

B. Application Services – Application functionality is exposed through lightweight, REST style services that expose JSON. The Application Services interact with the Data Tier to retrieve information on behalf of the client. For long running processes (such as buying and selling stocks), these services place a message onto the Message Broker for asynchronous processing.

C. Message Broker – The Message Broker is used for asynchronous processing and for inter-JVM processing between the Application Services and Integration Services. The Message Broker also decouples these services, allowing the Integration Services to be taken offline for maintenance while the Nanotrader application remains online.

D. Integration Services – The Integration Services are responsible for processing long running business transactions. These services listen for messages that arrive at the Messaging Broker and perform the required integration. In the case of Nanotrader, buy/sell operations perform the following multi-step process: orders are created, account balance updated, holdings updated, and stock volatility simulated.

E. Data Tier – By default, SpringTrader leverages an in-memory, SQL based database, which is built on a “shared nothing” architecture eliminating disk I/O which plagues traditional databases. SpringTrader can also run with PostgreSQL.

SpringTrader Development Architecture: Spring and vFabric

Detailed Architecture

  1. SpringTrader leverages “state of the art” client side technologies such as HTML 5, CSS 3, JQuery, Backbone, and Bootstrap. Static resources are served from vFabric Web Server (for local development these static resources can be deployed to tcServer).

  2. The Application Services leverage the enterprise proven Spring Framework to expose REST style services to the browser. Spring Data JPA provides simplified access to SQLFire, Spring Integration provides code free connectivity with RabbitMQ, and Spring GEMFire combined with Spring’s Cache Abstraction provides declarative, application tier caching. Specifically, the Application Services embed a peer-to-peer GEMFire Cache in the deployment unit to allow caching of authorization tokens for the REST API. Spring Security is used to protect the services from unauthorized access.

  3. RabbitMQ provides the inter JVM connectivity between the Application Services and Integration Services.

  4. The Integration Services primarily leverage Spring Integration to receive messages from RabbitMQ. The framework also choreographs multi-step transaction with SQLFire.

  5. SQLFire provides a low latency, highly scalable in-memory database. SpringTrader leverages SQLFire’s advanced partitioning capabilities to achieve web scale and eliminate the database as the performance bottleneck. Of course, other data services (e.g. vFabric Postgres or legacy RDBMS) could be used within the architecture.