![]() ![]() It would lead to bloated table sizes because of increased dead tuples.Option 1 did not seem very viable because tuples that are deleted are not physically removed from the table. Partition the table with weekly timeframes, and delete the whole partition once all the bookings within it are completed. ![]() Delete a booking from the DB as and when it is completed.Since a booking is no longer useful once it is completed, we needed this schema to facilitate periodic cleanups. Index on customer_id is needed in order to fetch all the active bookings for a customer.booking_number has to be the Primary Key for there should be only one entry per booking.Our schema looked something like CREATE TABLE IF NOT EXISTS bookings ( But high availability and consistency was a crucial requirement here. Agreed! Thats not much data compared to our other systems. This meant we needed our system to be able to handle large volumes of new bookings every day, each one ready to be served for at least a week. A booking remains active for at most a week. In Gojek, over 3 million bookings are initiated in a day. Thus, this system needed to be highly available and consistent. This would lead to multiple duplicate bookings, drivers being allocated to them, and a higher rate of cancellations. If a customer initiates a booking, but (due to some delay or failure in our system) is not able to see it on the app, they might initiate another one. Our customer application uses this backend to show active bookings for a customer. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |