Online Stock Trading System

Slides:



Advertisements
Similar presentations
3 Copyright © 2005, Oracle. All rights reserved. Designing J2EE Applications.
Advertisements

J2EE Design patterns Sharath Sahadevan August 8, 2002 St Louis Java SIG.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
CSIS0402 System Architecture K.P. Chow University of Hong Kong.
Capacity Planning and Predicting Growth for Vista Amy Edwards, Ezra Freeloe and George Hernandez University System of Georgia 2007.
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
An architecture for webb applications, J2EE
Computer Monitoring System for EE Faculty By Yaroslav Ross And Denis Zakrevsky Supervisor: Viktor Kulikov.
6/1/2015Ch.31 Defining Enterprise Architecture Bina Ramamurthy.
1 James Lynn Hewlett-Packard Middleware Division EJB Architecture Design Strategies and Performance Optimizations.
Chapter 13 Physical Architecture Layer Design
J2EE Java2 Enterprise Edition by Damian Borth. Contents Introduction Architectures styles Components Scenarios Roles Processing a HTTP request.
The Architecture of Transaction Processing Systems
JMS Java Message Service Instructor Professor: Charles Tappert By Student: Amr Fouda.
July 23 th, 2005 Software Architecture in Practice RiSE’s Seminars Bass’s et al. Book :: Chapter 16 Fred Durão.
Enterprise Programming By J Pearce. Enterprise Software Sales HR Inventory Customer Support Shipping.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
J2EE Kenneth M. Anderson CSCI Web Technologies October 3, 2001.
Session-01. What is a Servlet? Servlet can be described in many ways, depending on the context: 1.Servlet is a technology i.e. used to create web application.
Overview SAP Basis Functions. SAP Technical Overview Learning Objectives What the Basis system is How does SAP handle a transaction request Differentiating.
Java Pet Store Application. Outline Introduction Introduction Information Layer Information Layer Application Layer Application Layer Infrastructure Layer.
J2EE Application Server Deployment and Performance Optimization for Enterprise Application Service Thesis presentation Author: Xiaoyang Wang.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Beyond DHTML So far we have seen and used: CGI programs (using Perl ) and SSI on server side Java Script, VB Script, CSS and DOM on client side. For some.
1 J2EE Components. 2 Application Servers relieve the programming burden for business distributed components. They provide support for system level services.
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Introduction to distributed systems Dr. S. Indran 23 January 2004.
Institute of Computer and Communication Network Engineering OFC/NFOEC, 6-10 March 2011, Los Angeles, CA Lessons Learned From Implementing a Path Computation.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
CS 493/693: Distributed Systems Programming V. “Juggy” Jagannathan CSEE, West Virginia University March 21, 2005.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
SUN J2EE Architecture (Introduction, J2EE Patterns, Samples)
CERN LASER Alarm System Katarina Sigerud, CERN ACS workshop, 9 October 2005.
第十四章 J2EE 入门 Introduction What is J2EE ?
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
Enterprise Java Beans Java for the Enterprise Server-based platform for Enterprise Applications Designed for “medium-to-large scale business, enterprise-wide.
Computer Emergency Notification System (CENS)
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Client Call Back Client Call Back is useful for multiple clients to keep up to date about changes on the server Example: One auction server and several.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Collaborate Lesson 4C / Slide 1 of 22 Collaborate Knowledge Byte In this section, you will learn about: The EJB timer service Message linking in EJB 2.1.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Click to add text © 2012 IBM Corporation Design Manager Server Instrumentation Instrumentation Data Documentation Gary Johnston, Performance Focal Point,
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP.
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
AMQP, Message Broker Babu Ram Dawadi. overview Why MOM architecture? Messaging broker like RabbitMQ in brief RabbitMQ AMQP – What is it ?
Java Message Service (JMS) Web Apps and Services.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
EJB Enterprise Java Beans JAVA Enterprise Edition
Expense Tracking System Developed by: Ardhita Maharindra Muskan Regmi Nir Gurung Sudeep Karki Tikaprem Gurung Date: December 05 th, 2008.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
IBM Software Group ® WebSphere ® Support Technical Exchange Transactions in WebSphere Process Server Lalitha Chandran.
Server Concepts Dr. Charles W. Kann.
Introduction to J2EE Architecture
Software Architecture in Practice
#01 Client/Server Computing
Design and Maintenance of Web Applications in J2EE
Software models - Software Architecture Design Patterns
Applying Use Cases (Chapters 25,26)
Enterprise Java Beans.
Knowledge Byte In this section, you will learn about:
#01 Client/Server Computing
Network programming Lecture 1 Prepared by: Dr. Osama Mokhtar.
Demo for Partners and Customers
Presentation transcript:

Online Stock Trading System Members of Team 5 Insan Wijaya Tjiam Shi Lei Tan Boon Tham Wu Xue Song Xu Jun Zang Yan

Contents 1. 2. 3. 4. 5. 6. 7. 8. Introduction Software Architecture System Overview 3. Use Case Realization 4. Fulfillment of Real Time Requirements 5. External Interfacing 6. Inter-Process Communication & Synchronization 7. Design Patterns 8.

1. Introduction The Stock Trading System is a real time web application which allow investors to do transaction of Stock in Singapore This system will be a Java based web application Trading are done through an electronic broker “Interactive Brokers”, who provides APIs via which can write custom applications to link with their TWS (Trader Workstation Software).

1.1 Use Cases

2. Software Architecture The Online Stock Trading (OST) system is a J2EE Web based system: 3-tier enterprise system Presentation tier using Struts framework Business tier using EJB 3.0 Data tier using Hibernate

2. Software Architecture Selection of platform Enterprise Java was selected to build this web-based distributed system due to its comprehensive services Normal Java system has some limitations on meeting strict real time constraints Java doesn't support true priority in thread. This is because Java tried to avoid use of platform native APIs (e.g. Windows), which are needed for such support. Due to the lack of priority, there is no support for priority inheritance. Effect of garbage collection affects the determinism of the system response Java Community has developed the Real-Time Specification for Java (RTSJ). This specification has addressed the above issues with new JVM Unfortunately, we cannot use RTSJ There are no implementation for RTSJ on JEE so far The current RTSJ approach on memory management doesn't fit in into the JEE context since it doesn't allow class unloading Given the distributed nature of the system topology, the bottle neck for the real time performance of the system is unlikely the JVM For our application, the real time requirement is much softer (between soft real time and firm real time). We don't really need priority based scheduling Workaround for Garbage Collection - Instead of waiting for low memory threshold to be hit to start calling garbage collector, the system nodes will force a garbage collection process periodically

2. Software Architecture

2.1 Network Diagram

3.1 System Components

3.2 Deployment Diagram

3.3 Data Flow Diagram – Overall System

3.3 Data Flow Diagrams – System Components

3.4 Class Diagrams Data Transfer Objects Data Access Objects Enterprise Java Beans Struts Web Actions Java Servlet Pages Java Platform Objects Java Messaging Service Java Mail API Java Communications API

3.4 Class Diagram - DTO DTO

3.4 Class Diagram - DAO DAO

3.4 Class Diagram - EJB EJB

3.4 Class Diagram - EJB EJB

3.4 Class Diagram – Web Action

3.4 Class Diagram - JSP JSP

3.4 Class Diagram - Platform JMS Mail API Serial API

4. Use Case Realization Show one use case here View Stock Information View Stock History Force Live Data Retrieval Periodic Live Data Retrieval Retrieve Live Stock Info Setup Retrieval

4. Use Case Realization - View Stock Info

4. Use Case Realization - View Stock History

4. Use Case Realization - Force Live Data Retrieval

4. Use Case Realization - Periodic Live Data Retrieval

4. Use Case Realization - Retrieve Live Stock Info

4. Use Case Realization - Retrieve Live Stock Info

5. Fulfillment of Real Time Requirements Real Time Requirements Summary 200 concurrent users 5-sec response time Assumptions Typical web user issues less than 4 requests per second Typically there will be less than 10 database access per user per second Price trigger notification text can be fit into one standard SMS with max 160 byte data TWS platform has worst case response time of 1 second Email server can handle much more than 2000 emails per second Database server can support 500 concurrent users, and can handle 5000 operations per second. It has worst case response time of 1 second

5. Fulfillment of Real Time Requirements Time budget Web tier - 1 second Business tier - 1 second Data tier - 1 second Queuing for TWS - 1 second TWS response time - 1 second GSM Modem Manager - 1 second Email Server - 1 second With the above allocation, any transaction for the use cases will not involve more than 5 items above, and hence will not exceed the 5 second response time limit.

5. Fulfillment of Real Time Requirements Web Tier Maximum 4 requests per second per user, 200 concurrent users will generate 800 requests The web server farm entry point can handle 2000 requests per second With 10 boxes in the farm, each supporting 200 requests per second, the total is 2000 request per second ρ = 800/2000 = 0.4 L = 1/2000/(1-0.4) = 0.00083 ρ^20 = 1.0995E-8 With a queue of depth 20, there will be almost no data loss, and the response time is less than 1 second

5. Fulfillment of Real Time Requirements Business Tier Maximum 4 requests per second per user passed from web tier, 200 concurrent users will generate 800 requests The application server farm entry point can handle 2000 requests per second With 10 boxes in the farm, each supporting 200 requests per second, the total is 2000 request per second ρ = 800/2000 = 0.4 L = 1/2000/(1-0.4) = 0.00083 ρ^20 = 1.0995E-8 With a queue of depth 20, there will be almost no data loss, and the response time is less than 1 second

5. Fulfillment of Real Time Requirements Data Tier With maximum 10 database access per second per user passed from web tier, 200 concurrent users will generate 2000 access The database server can handle 5000 access per second ρ = 2000/5000 = 0.4          ρ^20 = 1.0995E-8 With a queue of depth 20, there will be almost no data loss Database server worst case response time is assumed to be 1 second Email Server Based on the assumption that it can handle 2000 emails per second with the size of the notification emails, it will be able to support the worst case 2000 notifications at the same time

5. Fulfillment of Real Time Requirements GSM Modem Time required for Telco to deliver the SMS is out of our control and is not considered as part of the time budget, so only queuing delay is considered. Each modem can exceed transmitting speed of 100Kb per second. With 4 modems in the pool, the total process rate is 400Kb per second. The entry point can handle even more data at 1Mb per second With maximum 10 price triggers per user, 200 concurrent user will generate 2000 triggers. At worst case scenario, all of these trigger are met, and the total data to transmit per second is 160byte*10*200 = 320Kb ρ = 2000/2500 = 0.8 L = 1/2500/(1-0.8) = 0.002 ρ^64 = 6.2771E-7 With a buffer of 10Mb (64 SMS messages with size 160b) for each modem, there will be almost no data loss, and the response time is less than 1 second.

5. Fulfillment of Real Time Requirements Queuing for TWS Based on TWS specification, each connection can transmit 50 messages per second With 10 connections in the socket pool, total amount of messages per second is 500 With 200 concurrent users, assuming every user issued requests to TWS, there will be 200 messages to be sent ρ = 200/500 = 0.4 L = 1/500/(1-0.4) = 0.00333 ρ^20 = 1.0995E-8 With a queue of depth at least 20 for the 2 Message Driven Beans managing the interface to TWS, there will be almost no data loss, and the queuing time is less than 1 second.

5. Fulfillment of Real Time Requirements Periodic Timers Periodic live stock data retrieval timer Periodic price trigger checking timer These 2 periodic timers are implemented as EJB timers. Started by the context listener at web server starting time Based on the update sequence of the TWS platform and the amount of tasks to perform at each time out, the period of these 2 periodic timers are set as 1 minute, This time timer value could be fine tuned later on based on system load.

6. External Interfacing Interface to TWS Platform Interface defined by TWS Via sockets and callbacks Interface to GSM Modem Physical connection – RS232 AT commands over Java serial port API Interface to Email Server SMTP protocol Java Mail API Interface to Banks

6. External Interfacing - TWS

7. Inter-Process Communication & Synchronization Java Remote Method Invocation Java Messaging Service Inter-Process Synchronization Managed by JEE container Interface to TWS, using semaphores

7. Inter-Process Communication & Synchronization - RMI

8. Design Patterns MVC model 3-tier model Singleton Factory Method The system adopted a Model View Controller model. The model is the data access layer, the view is the presentation layer and the controller is the business layer. 3-tier model The system used a standard 3-tier JEE structure: Web-tier, Business-tier and Data-tier. Singleton A few components in the system are modeled as singleton, such as DAO Factory, Socket Pool and SMS Dispatcher. Factory Method The factory method pattern is used to get instance of the DAOs. This pattern can be upgraded to Abstract Factory if more than one database implementations are preferred. Facade A few EJBs acts as facade to the data tier. The same bean manages an aspect of a usecase, and is the entry point of all related DAO access. Strategy The notification for price triggers can make use of the strategy pattern to support both SMS and email notifications.

Thank You !

Back-up Slides