I have the following doubt.
Suppose a company that issues tickets for boat tours has two outlets in different locations. Currently these two points of sale do not have any type of connection between them, therefore the only way to know if all the tickets have been sold is by literally calling whoever is at the other point to ask how many places are left.
I developed a system to generate such tickets/passages in Delphi XE7. Now I'm missing a way to sync the outlets.
My goal is that if I issue a ticket at point of sale "A" and it is ticket "No.: 0003" when point of sale "B" issues a ticket it is "No.: 0004".
And in the same way, when the ship is full and there are no more tickets available, the two systems cannot sell more tickets on that trip.
Basically, to solve this situation of having to call the other point and ask how many tickets are left.
I did some research on database replication in MySQL (Master-slave) but apparently it is one-way, therefore one of the two outlets could not modify the database.
Any suggestion how I can solve this problem?
The "correct" solution (ideal) and the simplest (the one that will give you the least problems) is that these 2 points of sale work against the same Database.
What you have to see is what solutions you have to achieve that. A VPN seems simple and shouldn't require you to change the program.
If this solution is not possible due to technical issues, you have to evaluate alternatives, but I think that then you are conditioning the solution of the problem, not only to the problem itself, but to other external factors.
(MANDATORY)
It is clear that you need an internet connection to be able to solve this problem, because there has to be a common place where both points of sale can read and write the information.
If you tell me that the connection fails, it is impossible for you to communicate both points reliably.
OTHER OPTIONS (patches):
(0) Use something like "RAD Server" , but speaking of the fact that we are developing a patch, I think it is not even worth evaluating it.
(1) Create a simple WebService in an Internet Server, which will give you the tickets and the status of the boat (Full/Empty boat). In this case, customers communicate with the WS every time they make a sale (before and after), a simple process. Check out this series of posts , which explains how to do this in a simple way. Both the server and the clients.
(2) Option we used before when there was no WS. Use an FTP/FTPs of those of a lifetime to share information, performing pooling every x time. Both for reading and writing. Manual sync.
Less recommended than the previous one, but possibly technically simpler.
(3) Use other spaces (on the Internet) to carry out the same synchronization of the previous point. Same problems and shortcomings of the previous one. Read, DropBox, GDrive, OneDrive,...
There may be more but considering that the further down the less recommended and that we already base ourselves on the fact that they are a patch, I am no longer even proposing...