(Note: See a newer article on the renamed SpringTrader.) vFabric’s Reference Application, 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 Nanotrader 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 Nanotrader 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:
The VMware Nanotrader Architecture
See Nanotrader High-Level Architecture to the left for reference.
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
2. 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.
3. 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.
4. 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.
VMware Nanotrader Development Architecture: Spring and vFabric
The vFabric reference application uses modern frameworks to ensure high developer productivity, promote unit testing, and allow developers to focus on the application logic vs. infrastructure coding. The following diagram depicts the key technologies used in the Nanotrader reference application:
B) 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.
C) RabbitMQ provides the inter JVM connectivity between the Application Services and Integration Services.
D) The Integration Services primarily leverage Spring Integration to receive messages from RabbitMQ. The framework also choreographs multi-step transaction with SQLFire.
E) SQLFire provides a low latency, highly scalable in-memory database. Nanotrader 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.
Note: vFabric tc Server provides the runtime container for both the Application Services and Integration Services. vFabric TC Server is configured with EM4J (Elastic Memory for Java) to enable greater memory efficiency for Java workloads running in VMware virtualized environment.
VMware Nanotrader Operations Architecture
As previously mentioned, infrastructure for modern applications needs to be virtualized, automated, managed and monitored. In today’s cloud era, organizations need an optimized approach to accelerate application deployment across cloud environments. It’s not good enough to solely have a highly productive development experience but the infrastructure needs to be streamlined to support automated, one-click deployments of applications. There are three parts:
I. Nanotrader goes beyond the application development experience and leverages vFabric Application Director to provide automation and orchestration of the distributed application across the cloud environment. Using a model driven, service catalog based application blueprint, Application Director can deploy the distributed reference application in minutes vs. days/months seen with traditional application provisioning approaches. The following screenshot shows Nanotrader’s Application Blueprint within vFabric Application Director:
II. Once deployed, vFabric’s Application Performance Manager (APM) remains synchronized with the Application Director topology and provides deep runtime performance metrics of the reference application. APM provides real time performance dashboards to give deep insight into the distributed application. APM’s lightweight code agents provide code level diagnostic information allowing teams to quickly identify and correct problematic code. Within Nanotrader, APM provides monitoring for both synchronous (REST – Spring MVC Endpoints) and asynchronous requests (Spring Integration, RabbitMQ).
III. VMware vSphere and vCloud round out the infrastructure to keep every element virtualized, scalable, and elastic. The features and advantages of VMware's full infrastructure capabilities are leveraged in this architecture and provide a myriad of additional benefits from automation to high availability and more.
A sneak peak at the vFabric Reference Architecture will be available at VMworld.
|About the Author: Brian Dussault is an Staff Engineer with the vFabric division of VMware and has 14+ years of experience in software engineering. Throughout his tenure, he has worked in both IT (High Tech Manufacturing, Financial Industries) and R&D positions. His experience spans multiple disciplines including web applications, integration, SOA, open source, and system design.|