Click here to Skip to main content
Click here to Skip to main content

Tagged as

Blue Commerce

, 23 Jun 2013
Rate this:
Please Sign up or sign in to vote.
Article for Azure Developer Contest

Please note

This article is an entry in our Windows Azure Developer Challenge. Articles in this sub-section are not required to be full articles so care should be taken when voting. Create your free Azure Trial Account to Enter the Challenge.

Introduction 

We aim to provide users with Real Time updates of Financial World; everyone wants to know how their portfolio is doing by the hour and not wait for EOD ticks? By providing users an app which gives them RT updates throughout the day we provide the users the knowledge, power to act on their portfolio within trading hours rather than waiting for EOD (End Of Day) updates and thus realizing that they have missed the opportunity.

In addition to this, the platform also provides the user the option to delve into TA (Technical Analysis) of their favorite stocks and setting up multiple parameters of Technical indicators on them. The platform will also be available to allow users to setup alerts on their favorite stocks for information regarding price / volume movement. Also, using SQL Server Analysis we will provide the user the ability to create custom data analysis on the data collected by the platform.

By leveraging Windows Azure we will be able to provide HA, faster, reliable user experience and having an infrastructure, which is ready for instant scale-out.  

Web Site Info  

The web site will be using MS LiveID as Authentication source, it will be created in HTML5 using Responsive design principles, the user will be able to have charts of different type i.e., Daily/Weekly/Monthly/Yearly, manage their portfolio and have option of setting up alerts using technical indicators.  

Web Service Info  

To feed the platform, their will daemon service running on Azure, which will be collecting, & feeding stock data into the SQL Azure for processing.

There will be another set of service, which will serve as user-front services, e.g., Chart service to accepts user parameters for a stock and providing data accordingly.

Alert services, which will provide the platform the ability to raise alerts for the pre-defined conditions setup by the user on the platform.

Using VM 

The platform will be collecting tremendous amount of data on daily basis, this data can be used for performing data analysis using SQL Server Analysis engine setup on these VMs and provide users the ability to setup their own analysis on this data. It can be something as “Find out which stock in the Automobile industry has been trending above average of the AutoIndex for the last month/quarter?”

Mobile Platform 

The web app, will be available on multiple platform by using HTML5/CSS3/jQuery etc. thus the user will be able to access the app from anywhere at anytime and not restricted to the web site.

Application Design

Building Windows Azure Cloud Services App with Web Role, Worker Role, SQL Azure Storage and Service Bus 

Windows Azure Cloud Services, provides a Platform as a Service (PaaS) offering for building multi-tier, highly scalable, reliable cloud applications on the Windows Azure Cloud platform. While building Blue Comm, we will demonstrate how to build a multi-tier Windows Azure Cloud Services application using with Web Role, Worker Role, SQL Azure Storage and Service Bus Queue. This application will also demonstrates the usages of Service Bus Queue, SQL Azure Storage and how to communicate between the Web Role and Worker Role.

Following the Application Design Diagram 

 Windows Cloud Services: Web Role

The Cloud Services has three types of roles the WebRole, WorkerRole and the VMRole.

The WebRole is all what is related to the web application, no matter what programming language the application is developed with. Certainly the user can make the required connection between your WebRole and WorkerRole using the Queue, WCF or even the Service Bus.

Each WebRole can be configured through the configuration and the service definition file. These 2 files configure and define the application and the virtual machine where this application will be host. 

BlueCommerce web site will be deployed in a Windows Azure web role. Creating a web role that contains a web site is pretty easy. Essentially one needs to add site elements to web roles service definition.csdef file. Each site element would include a physical directory element that references the location of the BlueCommerce website.

1

2

3

4

5

6

7

8

9

10

11

<Sites>

  <Site name="WebRole1" physicalDirectory="..\..\..\WebRole1">

<Bindings>

<Binding name="Endpoint1" endpointName="Endpoint1" />

</Bindings>

</Site>

<Site name="WebApplication1" physicalDirectory="..\..\..\WebApplication1\">

<Bindings>

<Binding name="Endpoint1" endpointName="Endpoint2" />

</Bindings>

</Site>

</Sites>

 

When Visual Studio and the Windows Azure SDK (via CSPACK) create the cloud deployment package (.cspkg), the content listed at thephysicalDirectory location is simply copied into the deployment package.  Meaning, any web applications there are not compiled as part of the process, no .config transformations take place, and any code-behind (.cs) and project (.csproj) files are also copied. But since BlueCommerce will be a single site so when packaging single-site web role, CSPack doesn’t rely on the physical directory attribute. With a single-site web role, the packaging process is able to build, publish and create the deployment package.

Windows Cloud Services: Worker Role

The WorkerRole can be considered as a background services that runs on Windows Azure Data Centers, consuming its Servers processing power. Certainly the amount of the processing power is defined by the VM size in the Service Definition file. They run in the background they don’t have an interface and can run once triggered to forever. Certainly they can be link to WebRole application.

In Blue com application, there is a very critical need for collecting stock market data, be it, Real Time (RT) stock quotes, EOD market stats, Trading & Delivery Positions etc. for the stock market. This need matches perfectly with the basic design philosophy of ‘Worker Role’, so we will be pushing multiple worker roles to make the collection scalable, reliable and fault-tolerant. The data collected will be feed directly into SQL Azure DB, from where it will be consumed by end-points like desktop/tablets/smartphone and by BI agents deployed on VM for crunching numbers for publishing stock trends, analysis of price/volume, etc. to be made available to users as BI reports / dashboard.  

Database – SQL Azure 

Hardware sizing is always a chore that is more based on “guesses”. It is a difficult science to predict and forecast

usage of database and its growth.  Having something elastic like “SQL Azure” makes it best for costs and

maintenance.  SQL Azure gives a lot of flexibility to increase / decrease usage of resources almost instantaneously

SQL Azure data engine is as strong as SQL server but there are still some differences. Following is list of differences: 

  • With SQL Azure, users are forced to use SQL Server Authentication which is a recommended best practice to enhance security. 
  • In SQL Server, an idle connection never goes down. In SQL Azure it goes down in 5 minutes. There will have to be a bit of rethinking of strategy when connection pools are being used 
  • There is no SQL Server Agent on SQL Azure. Thus no jobs can be scheduled. However BCP and SSIS can move data to cloud. 
  • Currently databases cannot be backed up. But they can be copied 
  • All tables should have a clustered index. The exception to this rule is only for tables in tempdb. 
  • No cross database referencing in SQL Azure. 
  • Linked Servers cant be accessed in SQL Azure 
  • Default collation is SQL_LATIN_1 and currently has a limitation of being the only collation available on SQL Azure. However other collations will be supported soon. 
  • Regardless of the data center chosen, time zone is set to UTC and currently cant be changed. 

 Blue Com database will be on SQL Azure and following is the db diagram

 Virtual Machines in Windows Azure 

Windows Azure Virtual Machines are a new addition to the services provided by Windows Azure. They allow a much easier and flexible solution for quickly moving an existing workload from on-premises to the cloud or for building new applications that have dependencies on applications that will only run on a server with persistent local storage. Creating VMs in Windows Azure is easy and flexible because Windows Azure provides many ways to achieve it.

The Windows Azure Virtual Machine gallery includes images that contain SQL Server installations. The SQL Server editions supported in the gallery images are the same installation files you can install to on-premises computers and virtual machines.

BI Features Installed on the SQL Server Virtual Machine Gallery Images

The following table summarizes the Business Intelligence features installed on the Windows Azure Virtual Machine gallery images for SQL Server 2012.

 

SQL Server BI Feature

Installed on the gallery image

Notes

Reporting Services Native Mode

Yes

Installed but requires configuration.

Reporting Services SharePoint Mode

No

The Windows Azure Virtual Machine gallery image does not include SharePoint or SharePoint installation files.

Analysis Services Multidimensional and Data mining (OLAP)

Yes

Installed and configured as the default Analysis Services instance

Analysis Services Tabular

No

Supported in SQL Server 2012 images but it is not installed by default. Install another instance of Analysis Services.

Analysis Services PowerPivot for SharePoint

No

The Windows Azure Virtual Machine gallery image does not include SharePoint or SharePoint installation files.

 

BlueCommerce application will use the SQL Server Analysis services hosted on Windows Azure virtual machine for data analysis of stocks and helping in predicting the buys and sells of stocks. The logic will be implement through dot net code but the trends that would work as inputs will be derived from the analysis engine. Following are some of the categories of data that will be used in BlueCommerce 

Growth

BlueCom application will have Growth category indicators measuring the short term and long term growth of the company’s top line (revenue) and bottom line (net income) using quarterly and trailing twelve month data, as well as what happens in between (margins) from year to year. In other words, while growth in and of itself is very important in our analysis, growing profitably is closely measured and graded and given significant importance also.

Value 

BlueCommerce Value category compares the price of the company’s shares and its overall market capitalization to several fundamental metrics. Analysis’ calculates the price at which the company’s shares would be fairly priced based on its long-term earnings per share growth record. As such, younger, growth oriented companies may be priced fairly at a level that is much higher than a mature, slow-growing company. BlueCommerce will compare the stock’s actual price to earnings ratio to the ‘optimum’ level based on EPS growth and calculates the grade based on the relationship between the two. The highest grades are assigned to those companies under-priced by the market based on their own growth rates. In this category we also measure the company’s valuation to its book value, or the amount of tangible equity in its balance sheet, its cash flow and its sales.

Profitability

BlueCommerce’s Profitability category focuses on how successful the company is at making money, whether building widgets, providing a service or whatever its business may be. Therefore several of this category’s indicators vary based on industry or Industry, accounting for the differences in business models. Our Profitability indicators measure the company’s return on equity, or its operating return to its shareholders and whether it has improved over time; we consider it the ultimate measure of profitability.

BlueCommerce Ratings

Buy -> Companies rated 'buy' have a consistent growth track record over the short and long term and the ability to steadily increase earnings. While our system allows companies with high valuations by traditional standards the opportunity to be rated ‘buy,’ their profitability and growth track records must be impeccable. This rewards a business environment that fosters disciplined risk-taking with solid management skills.

Hold -> Companies rated 'hold' by BlueCommerce are for the most part in a transition process either on an improving fundamental outlook or in the middle of a deteriorating business environment. It is adequate to assume that the characteristics of these stocks represent a middle ground between ‘buys’ and ‘sells.’

Sell -> 'Sell' rated companies for the most part embody characteristics opposite of those rated ‘buy,’ including declining top and bottom line growth over the short and long term coupled with inconsistent earnings per share results. In many cases the valuation indicators of these stocks are not necessarily as poor as those of some companies with higher overall ratings; this may be attributed to the market having at least partially discounted the company’s meager fundamental record

Following is the current layered diagram of BlueCommerce 

 

 Application is hosted on Windows Azure and following is the link

 http://stockapp.azurewebsites.net/

Application is accessible on mobile, tablets and Desktops.  

Download BComStockAppData-noexe.zip 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

GrapecityIndia

United States United States
No Biography provided
Group type: Organisation (No members)



Comments and Discussions

 
GeneralMy vote of 5 PinmemberMember 881576713-Jun-13 7:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 24 Jun 2013
Article Copyright 2013 by GrapecityIndia
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid