Stock Ticks Time Series processing with PHP and MongoDB Aggregation (Rollups)
$30-250 USD
Paid on delivery
Must be familiar with MongoDB and PHP especially MonogDB aggregation and Rollups. Be very comfortable with time series data and OHLCV concepts.
Preference to those who private message with schema/implementation ideas or previous relevant examples.
Task: Design MongoDB Schema and write php/mongo code for aggregation + rollups
We process thousands of rows per hour of incoming data that looks like this:
time|amount|price|total
time|amount|price|total
....
data is received via a JSON GET api which causes issues since data at the api can have old trades be but only new data must be added to mongodb.
Data comes from various sources so PHP function should take an input similar to
process_ticks($time,$amount,$price,$tid){
//VERSION1
//record a raw trade … 1. for long term and one for short cap like “100 last trades"
$trade=record_raw_trade(){};
//WriteResult()
if($trade){
//if trade is recorded then update stats/graphs …etc
$roll_up = roll_up_trade(){
do_per_minute(o,h,l,c,v)
};
}
//VERSION2 (shorter)
mongo find(where trade_id < $this_trade_id, insert_id, do_rollup($inc))
}
Requirements
1. Real time … as data comes in
2. Atomic Inserts + Data consistency, don’t insert / rollup the same trade more then once
3. Archive old data
Expectations:
1. Well commented and nicely structured code
2. Meaningful variable and functions names
3. Documentation if needed
Project ID: #6280307
About the project
3 freelancers are bidding on average $266 for this job
Am well versed in the No SQL Mongo. I have experience in working in the aggregation framework and map-reduce function in mongo. I have little exposure to PHP. Let me know if PHP knowledge is more needed.