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?
Write using redis
Get the data and store it in redis, then use redis to flash it to the database