Shows a mixed workload sample on a DataStax Enterprise cluster.
The use case is a financial application where users can actively create and manage a portfolio of stocks. On the Cassandra OLTP (online transaction processing) side, each portfolio contains a list of stocks, the number of shares purchased, and the purchase price. The demo's pricer utility simulates real-time stock data where each portfolio updates based on its overall value and the percentage of gain or loss compared to the purchase price. This utility also generates 100 days of historical market data (the end-of-day price) for each stock. On the DSE OLAP (online analytical processing) side, a Hive MapReduce job calculates the greatest historical 10 day loss period for each portfolio, which is an indicator of the risk associated with a portfolio. This information is then fed back into the real-time application to allow customers to better gauge their potential losses.
Before running the demo, make sure the following items have been completed:
To run the demo:
$ nodetool status
$ ps auwx | grep dse $ bin/dse cassandra-stop -p PID
$ sudo service dse start
This script creates a directory called dse-demos where you can run the demos without using root or sudo permissions. It also tells you where the dse-demos directory is placed.
$ bin/pricer --help
$ bin/pricer -o INSERT_PRICES $ bin/pricer -o UPDATE_PORTFOLIOS $ bin/pricer -o INSERT_HISTORICAL_PRICES -n 100
$ cd website $ ./start
The real-time Portfolio Manager demo application is displayed.
The results of the Largest Historical 10 day Loss for each portfolio are displayed.