php - How to write the commission of lottery draw in real time
高洛峰
高洛峰 2017-05-16 13:01:53
0
2
489

I wrote a * function, the lottery results are synchronized with the lottery results of the lottery.
After the user placed a bet, I set up a crontab on the server to refresh the lottery results every minute. Once a certain lottery is drawn, ,
I will update the winning status and lottery results of all users’ betting orders. The platform has an agency mechanism. There is
a table that records the winning and losing of each agent's commission for each bet placed by the user, but now I have not put this thing in the planned task,
because if tens of thousands of people place bets in one period, Then the loop writing may not be completed within one minute. The current method is to write the agent's commission only when the user writes his own betting order
How many wins and losses are written passively? Now I want to ask, if the data is actively written in real time when the lottery is drawn, is it appropriate to run it on the server in a loop? Is there any other good method?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
習慣沉默

Write using redis

phpcn_u1582

Get the data and store it in redis, then use redis to flash it to the database

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template