The task is as follows:
The client database is stored on the local machine. It should periodically (with changes, apparently) be copied to the hosting (MySQL is there).
The second part of. Customers have cards (magnetic or with bar codes) with which you can pay. There is a ticket office. It is necessary that when reading a card, a certain amount is deducted from the account in the database.

Very little idea how to organize it. Is there any ready software for this?
Can you recommend something worthwhile?

  • And why is the database so distributed, is it not possible to create a centralized database? - frops
  • You want replication probably? What would be two distributed mirror bases? - pyatak
  • M ... There is a person who earnestly wants the main database to be on the local computer and only be copied to the site (so that registered users with a map can see how much money they have through this site, etc.). The main problem is that computer transfer to the site. - oleg_ismaylov
  • 2
    "Replication needs to be addressed last." Arguments are required. - pyatak
  • one
    In general, sticking out the cash database to the Internet is generally a very bad idea! highly! about how to do this - I would make a separate plate for the site with the data of client cards and a crown would sync only the required fields there. just select on a local database, insert or update based on the site. Delov for "10 minutes" =) - thunder

3 answers 3

Master-Slave replication in MySQL .

  • @eugene "Page not found". - frops
  • Replication is still good because the data is duplicated - if the virus eats the local computer and there are no backups, then the site will have the most recent copy + provider backups. - Sergiks

According to the description it is not very clear what kind of cards and what amount is debited from the account in the database. Where does the money in the client's account come from? The whole formulation of the problem is important. Replication is not needed - you need a simple upload to the site. Is he already there? And it is possible to organize the upload via a text file (apparently, the data is flat, that is, one table will be enough). There are a lot of questions. For example, should the client see a history of operations? Does the site already exist? What mutual settlements are supposed to be conducted?

The second part is easy to write on 1C - there are drivers for working with magnetic card readers and barcodes. And it is possible and on the same php with MySQL on the server, if you tie drivers.

    Generally push out the cash database in the Internet is generally a very bad idea! Highly!
    As for how to do this - I would make a separate plate for the site with the data of the client cards and the crown would sync only the required fields there. Simply select on a local database, insert or update based on the site. Delov for "10 minutes" =) you can even simply upload to a text file and import it back to the usual file. realizations of the sea.

    Reasoning about viruses in general is a strange thing :) Although nobody knows about backups ...

    • > popping a cash database into an Internet is a very bad idea in general! :) By experience, those who are interested in 1C happen to not back up and catch viruses. - Sergiks
    • Well, I am serious, it’s better not to put out such data) besides driving a bunch of data there that nobody needs on the site is also nonsense) and you can torment yourself with replication for a long time, especially if there is a lot of data) from experience, in the course, and if you back up, it is often on the same car where the base is, which is why the meaning of backup is significantly reduced)))) got rid of it by transferring the base to db2 linux :) - thunder
    • Well, I conditionally said that the base should be duplicated on the Internet. I intended to transmit only some information. The difficulty is that I have no idea how to transmit. - oleg_ismaylov
    • you save the necessary data into a file, you can simply mysqldump some kind of structure and then import it to the right place. - thunder