Re:Do you really need Redis? How to get away with just Postg...
by lstamour on Saturday June 12, 2021 @12:35PM
(#27485564)
Send bookings to the database early, with an expiry time and a counter visible on the screen?
Thing is, because purchasing is often shared across third-parties, even then you can’t guarantee that you’ll have the reservation until it’s paid and entered into the shared booking backend… unless the third party backend has a locking mechanism, at which point you’re probably not using your own Postgres to do this, but their mainframe instead.
Re:Do you really need Redis? How to get away with just Postg...
by abhishekjha on Sunday June 13, 2021 @09:48AM
(#27492561)
So what do you propose here? I see that stackoverflow mentions some preemptive locking for a seat in cache for a few minutes. During that time the seat is taken out of the pool for potential booking. If the time lapses without the seat getting booked then the seat returns to the pool. This avoids going to the DB and see who wins.
Re:Do you really need Redis? How to get away with just Postg...
by spockz on Saturday June 12, 2021 @02:23PM
(#27486436)
Is there any other solution other than going full STM on this?
Re:Do you really need Redis? How to get away with just Postg...
by mathfailure on Saturday June 12, 2021 @10:48PM
(#27489347)
Yes a simple SCRM will do.
Re:Do you really need Redis? How to get away with just Postg...
by abhishekjha on Sunday June 13, 2021 @09:48AM
(#27492567)
What is SCRM?
Saying this as someone who has been on both sides of that interview question, and also evaluated performance in it as a hiring manager.