This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Architecture for Trading System

 
Vicky Pandya
Ranch Hand
Posts: 148
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am architecting Trading software system. Current system is client/server and we are replacing it with web based system. I am an experienced J2EE developer and have worked with J2EE, Struts, Hibernate technologies. I am planning to explore and use Spring in business layer and Spring MVC in presentation layer. We will also require to use AJAX in front end for refreshing real data from trading server.

As far as ORM tool is concerned, I am leaning towards Hibernate but bit hesitant as this trading system will have to handle 1 million transactions per day and I am not quite confident with hibernate performance. Should we use hibernate or go for EJBs? Or Spring JDBC with transaction support?

Do you think this will be a right architecture? I am concerned with not having expertiese on Spring and we may uncover issues at later stage of the project.

Any pointers would be appreciated.
 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hibernate or go for EJBs? Or Spring JDBC with transaction support?


Go for Hibernate and use JDBC with DAO as and when needed(ie. where there are many joins, hibernate is not good in that scenario).

Use Spring for front end and middle tier.
 
Vicky Pandya
Ranch Hand
Posts: 148
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have another quick question. In trading system with following scenario,how would one architect this particular piece in Software.

-10 clients (brower clients)are interested in buying 50 stocks of company A with 10 different BUY prices.
-System has 60 stocks availabe of company A with $100 as SELL price.
-System should handle request on First come first serve basis (Spring-JMS is the option or Message Driven Beans (MDB) ?)
-First request came in with < 100 BUY price, system shold put this request in pending (table?) with its BUYing price.
-Second request came in with >= 100 BUY price for 40 stocks. system will sell 40 stocks to this client. Now remaining stocks in the system =: 50-40=10
-Third request (client) came in with = 100 BUY price for 40 stocks. System will sell only 10 remaining stocks to this client and will put request in pending table with BUY price = 100 and Quantity = 40-10=30.
-Next time when someone sells company A's stocks, system will automatically match against open, pending orders in the databse and will buy for pending orders then send notification to clients about the BUY.

THis is very similar to how other stock broker site works (e.g. http://www.tdwaterhouse.com).

How would one implement this piece of software using Spring? I haven't explored Spring in deep but does Spring -JMS do this kind of job or Message Driven Beans are essential here?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic