0

My application that is running on a client uses a MySQL database running on a server. So multiple clients are connected to the same server. That works well when the server is online. But now I would like to enhance my application to be able to run in an offline mode.

                +--------------+
                |              |
    +-----------+   SERVER     +----------+
    |           |              |          |
    |           +-------+------+          |
    |                   |                 | 
+------+-------+   +-------+------+  +-------+------+
|              |   |              |  |              |
|  Client 1    |   |  Client 2    |  |  Client X    |
|              |   |              |  |              |
+--------------+   +--------------+  +--------------+

Now comes the problem: what happens when the client is offline? I need a copy of my MySQL database on each client too. By default the application interacts with the MySQL on the server. If this server is not accessible (for what reason ever: server is offline or client has no internet connection) it should use the MySQL running on the client. If the client/server connection is available again the databases need to be synched automatically.

My question is now: how to achieve this? First of all I checked the MySQL-replication, but in my scenario I have multiple "masters" and an unknown number of clients. So I afraid that replication is not my solution. Is it possible to solve my problem with MaxScale? I never worked with that so I really appreciate any help.

Lars
  • 920
  • 1
  • 14
  • 34
  • Let's first clarify if you use mysql or mariadb! No, they are not the same contrary to general belief. – Shadow Sep 19 '21 at 08:39
  • @Shadow a MySQL is running on the server. MariaDB is running on the clients. ...I know that it isn't the same :-) – Lars Sep 19 '21 at 08:43
  • You are asking for trouble with this setup! – Shadow Sep 19 '21 at 08:55
  • @Shadow I'm asking if it is possible to realise it with MaxScale and if yes - how to do? I'm not familiar with configuration issues like described... – Lars Sep 19 '21 at 08:59
  • 1
    Assuming you have MariaDB SERVER running on your clients, you should start by making a choice for MySQL or MariaDB, and convert all instances of server to either MySQL or MariaDB. But even when all servers are the same (version and vendor) .... I am asking meself if this question belongs to dba.stackexchange.com ? – Luuk Sep 19 '21 at 09:05
  • 1
    I agree with @Luuk: if your question is about configuring a database proxy tool, then the question is off topic here on SO, as SO is for programmimg related questions only. The DBA sister site of SO deals with configuration type of questions. But you really should use exactly the same database products down to the minor version number on the client and the server. – Shadow Sep 19 '21 at 09:16

0 Answers0