I'm trying out a distributed app using Galera replication topology that needs to support writes if nodes are disconnected from the cluster. The idea was to have an extra MariaDB that is connected to each Galera node through master-master replication:
dbc0 <--> db0 <--> app | dbc1 <--> db1 <--> app . . . dbcn <--> dbn <--> app
Where the vertical replication between dbc's is Galera and needs to support 100's of nodes and WAN. The horizontal replication is MariaDB master-master within the same linux server but between different lxc containers. The idea is the app would only communicate to the non-Galera db's, and writes would have keys containing the node #, so be guaranteed unique. The sync between nodes can be slow, but the app (in another container) needs to interact quickly with its local db.
After setting it up with server_id's the same on the dbc's and unique on the db's, and log_slave_updates = 1 on the dbc's, it almost works: creating a new table on any dbc creates the tables in all the dbc's and db's. Adding a row in any dbc also shows up everywhere.
Adding a row in a db though successfully replicates to all the dbc's, but doesn't get to the other db's. However, this topology does allow writes to a db when its dbc is turned off, and sync's nicely when the dbc is turned back on to all the other dbc's (but not the db's). Hope this makes sense.
Is there a way to make a write in a db node replicate through both the Galera cluster dbc nodes and their corresponding MariaDB master-master replicated db's? Or any other way to accomplish this?