search

Home  >  Q&A  >  body text

PHP - This requirement does not require redis. Can table locks be used to solve the concurrency problem?

Requirements:

Due to a large number of businesses, a company needs to make an appointment in advance. It can be done in six time periods every day: 9:00, 10:00, 11:00, 15:00, 16:00, and 17:00. reserve.
Only 10 people can make reservations in each time period, that is, 60 people can make reservations every day.
Only one reservation can be made per person.
Successful reservations need to be sorted, for example, the first person in the 9:00 time slot is 001, the first person in the 10:00 time slot is 011, and the last person in the 17:00 time slot is 060.
Appointments can only be made for tomorrow and the day after tomorrow. 
PHPzPHPz2827 days ago362

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-05-16 13:11:48

    Let’s use redis to solve the problem. Wait for a certain period of time and then write the data in redis to the database in batches

    reply
    0
  • Cancelreply