I am working on a lottery system. I have 1 First Prize, 10 second prize, and 100 third prize. now I need to save some of the prize winners to see if there are enough prize winners, but it's a little tricky to write it into the database. how do you store it. I am working on a lottery system. I have 1 First Prize, 10 second prize, and 100 third prize. now I need to save some of the prize winners to see if there are enough prize winners, but it's a little tricky to write it into the database. how do you store it.
Reply content:
I am working on a lottery system. I have 1 First Prize, 10 second prize, and 100 third prize. now I need to save some of the prize winners to see if there are enough prize winners, but it's a little tricky to write it into the database. how do you store it.
Files exist. In fact, databases also store files.
Put the file in it. this temporary storage of data is not a file or a cache, but redis is also good. it comes with sorting.
Front-end localStorage
Put it in the cache. redis
File_put_content: Save the file
For configuration, write the configuration.
Write an XML file to save
If you do not want to store databases, you can store files, shared memory (such as shared memory functions, apc, apcu), memcached, redis, and so on.
However, there is a risk of loss. if you don't want to lose the number of winners, you 'd better put it in the database, and data loss will be more troublesome.
It can be stored in the redis Cache.
Stored in a file, written to the cache, or written to the configuration file
This is not too much data! Since it is useful, it is still possible to collect statistics and view data on a certain day of a certain year, and it is quite good to store the database!
Isn't sqlite solve this problem?