We help IT Professionals succeed at work.
Get Started

Need expert opinion for a real time data processing web application

271 Views
Last Modified: 2016-10-06
I have a financial project which receive real time stock data from some data vendor , save it into mysql database, then retrieve the data and send to the end user browser. The client software provided by the data vendor used to receive stock data is a program written by c/c++ running on the server.  this client can save the data into the mysql database(does not have to be mysql, could be switched to any other database). In order to retrieve the data from the database as quickly as possible, any framework can I use? heard about CES or ESP? spark streaming? any of them can be used for my project?  if not, how can I only retrieve the un-read data from the database as soon as it reach the database? the stock data feed is probably about maxium1000 records(my wild guess, might not be correct)  a second. see the sample below.

+---------------------+--------+-------------------+-------------+
| insertTime                  | symbal | trade_time                 | trade_price |
+---------------------+--------+-------------------+-------------+
| 2016-09-15 04:00:00 | AAPL   | 20160915040000017 |      111.70 |
| 2016-09-15 04:00:00 | AAPL   | 20160915040000017 |      111.70 |
| 2016-09-15 04:00:00 | AAPL   | 20160915040000200 |      111.69 |
| 2016-09-15 04:00:00 | AAPL   | 20160915040000200 |      111.69 |
| 2016-09-15 04:00:00 | AAPL   | 20160915040000272 |      111.51 |
| 2016-09-15 04:01:14 | AAPL   | 20160915040113878 |      111.57 |
| 2016-09-15 04:01:14 | AAPL   | 20160915040113887 |      111.57 |
| 2016-09-15 04:01:14 | AAPL   | 20160915040114011 |      111.57 |
| 2016-09-15 04:01:20 | AAPL   | 20160915040120342 |      111.57 |
........

| 2016-09-15 04:28:29 | AAPL   | 20160915042828740 |      112.16 |
| 2016-09-15 04:28:33 | AAPL   | 20160915042833306 |      112.18 |
| 2016-09-15 04:31:39 | AAPL   | 20160915043138895 |      112.18 |
| 2016-09-15 04:31:39 | AAPL   | 20160915043138895 |      112.24 |
| 2016-09-15 04:35:13 | AAPL   | 20160915043513179 |      112.10 |
| 2016-09-15 04:35:16 | AAPL   | 20160915043515888 |      112.10 |
| 2016-09-15 04:35:16 | AAPL   | 20160915043515888 |      112.09 |
| 2016-09-15 04:35:58 | AAPL   | 20160915043558378 |      112.18 |
| 2016-09-15 04:35:58 | AAPL   | 20160915043558378 |      112.18 |
| 2016-09-15 04:37:35 | AAPL   | 20160915043734987 |      112.19 |
| 2016-09-15 04:37:35 | AAPL   | 20160915043734987 |      112.18 |
| 2016-09-15 04:37:35 | AAPL   | 20160915043734995 |      112.18 |
| 2016-09-15 04:37:35 | AAPL   | 20160915043735002 |      112.18 |
| 2016-09-15 04:37:35 | AAPL   | 20160915043735056 |      112.18 |
| 2016-09-15 04:37:35 | AAPL   | 20160915043735063 |      112.18 |
| 2016-09-15 04:37:35 | AAPL   | 20160915043735071 |      112.18 |
| 2016-09-15 04:37:35 | AAPL   | 20160915043735116 |      112.18 |
| 2016-09-15 04:37:35 | AAPL   | 20160915043735123 |      112.18 |
| 2016-09-15 04:37:35 | AAPL   | 20160915043735131 |      112.18 |
| 2016-09-15 04:37:35 | AAPL   | 20160915043735138 |      112.18 |
| 2016-09-15 04:37:36 | AAPL   | 20160915043736164 |      112.18 |
| 2016-09-15 04:37:52 | AAPL   | 20160915043752468 |      112.18 |
| 2016-09-15 04:37:52 | AAPL   | 20160915043752476 |      112.18 |
| 2016-09-15 04:37:52 | AAPL   | 20160915043752539 |      112.18 |
| 2016-09-15 04:37:52 | AAPL   | 20160915043752547 |      112.18 |
| 2016-09-15 04:37:52 | AAPL   | 20160915043752555 |      112.18 |
| 2016-09-15 04:38:01 | AAPL   | 20160915043801260 |      112.18 |
| 2016-09-15 04:38:31 | AAPL   | 20160915043831574 |      112.20 |
+---------------------+--------+-------------------+-------------+

I know the simple way to do is to add another column to mark if each record has been read or  not, then change the value after read. is this the best way to do?

I was thinking about the other option which is to capture the data from the data vendor client (c/c++ program) first, then forward the data to both the browser and the database simultaneously, in this way it could save the the time for the round trip to the database. however, I am not good at c/c++, only good at java,  have no idea how to get data from the c/c++ program. any work around solution? probably adopt apache kafka?
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 2 Answers and 4 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE