Reputation: 137
So the title says it all. Based on the following example which would be the best way to implement it?
Lets have a room reservation desktop software installed on many client machines where each clients can book a room and a centralized database.
So we have client C1 and client C2 and the database where both clients are connected. In the time that a room is booked from C1 i want to show it in the screen of C2 and vice versa and naturally i do not want that a room can be booked on the same time twice.
Should i lock the room in the database when a client starts a reservation und unlock when done (or after a time limit) or just check the database before insert and fail if the room was booked in the meanwhile?
Should i send the request directly to the database or should i implement a server software in front of the database to take the requests?
How to inform the other clients that a room was booked?
Point 3C seems to be more complicated since requires the registration of the clients into the server software and making the clients also to small servers for accepting the pushed updates.
I would have chosen: check before insert, send request directly to database (no extra server software) and 3B. So would you recommend the same or do you have any other ideas?
Please mind that i am talking about desktop software and not web applications and not regarding any security issues ;)
Upvotes: 0
Views: 1298
Reputation: 112
@teo,
My choices would be:
Summarizing, you can tell that the architecture is clearly a client server one, used a lot of time ago, and this kind of requirements you describe are better treated nowadays with a web app approach, otherwise you would write tons of code to create the server by yourself.
So, unless this is a case of study for college or there are 1000 orcs threatening your life, I would not recommend developing this as a client server, but as a web app.
Cheers,
Marcelo
Upvotes: 1