Booking System: Fetching Available Appointment Slots for next 7 days in a React Native app

大城市里の小女人 提交于 2021-01-28 11:42:04

问题


I am designing a booking system which allows users to view available time slots on a mobile app and book one of them. Each time slot consists of 15-minute. If we calculate total time slots available in a day (10:00am - 00:00am), they'll be 56. We will have multiple servicemen, for example 3-5, can be more.

This means we will have 56 x 5 = 280 time slots each day and if we offer booking for next 7 days they'll become 280 x 7 = 1960 time slots.

I am intending to use MySQL as the database, Laravel for API calls, backend and React Native for mobile application.

So the table in database will save only the booked time slots. PHP Function in the backend will make call to database to get booked-slots and will calculate the available time slots. Now, I can make them available via API call so the mobile app can get them.

But is it the right choice? Because thinking about the scenario where user will open the mobile app:

  1. a network call to API will start in the background
  2. backend-server will fetch data from mysql
  3. backend-server will calculate the available slots
  4. mobile app will receive the data and will display

The whole process looks very lengthy when we take 1960 time slots into consideration.

How can I make this process better?

Is it a good practice to download 1960 time slots in one call?

来源:https://stackoverflow.com/questions/65160091/booking-system-fetching-available-appointment-slots-for-next-7-days-in-a-react

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!