Click here to Skip to main content
15,887,908 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello there,

I'm developing a mobile application in c# connected to a mysql server for a portable application.
Basically there are two MySQL servers, a main server and a mobile one. the app has to import information from the main server to the mobile one to allow the app to work offline, but only the essential information for the job.

Exemple Tables:

   Technicians           Jobs              Clients           Machines
    id | name      id |idTec|idClient   id |  name       id |idClient | idModel
    1  | John       1 |  1  |   4        1 | Client1      1 |   5     |   1
    2  | Mike       2 |  3  |   2        2 | Client2      2 |   5     |   2
    3  | Bob        4 |  2  |   1        3 | Client3      3 |   2     |   1
                    5 |  2  |   3        4 | Client4      4 |   3     |   1
                    6 |  2  |   5        5 | Client5      5 |   2     |   2     
                                                          6 |   1     |   2     
                                                          7 |   4     |   2        

   MachinesModels
id |  brand  | model
 1 |  brand1 | X4-333
 2 |  brand2 | Fas-12    

So, if "Mike" login in the app (connected to the mainserver) there will be a Sync option and what that option should do is get all his jobs, and only his jobs like this:

   Technicians           Jobs              Clients           Machines
    id | name      id |idTec|idClient   id |  name       id |idClient | idModel
    2  | Mike       4 |  2  |   1        1 | Client1      1 |   5     |   1
                    5 |  2  |   3        3 | Client3      2 |   5     |   2
                    6 |  2  |   5        5 | Client5      4 |   3     |   1
                                                          6 |   1     |   2

   MachinesModels
id |  brand  | model
 1 |  brand1 | X4-333
 2 |  brand2 | Fas-12


so, my question is, what would be the most effective way to do that?
is there a MySQL option that exports some rows and all the connected tables and only the specific rows?

I could get all the jobs and search table by table for the fk connections, but that dosen't seem very efficient for large DB.

What's your opinion?

(BTW sorry for any writing error)
Posted
Updated 23-Feb-15 17:44pm
v5

1 solution

You can try Bidirectional Replication - in MySQL[^] between these two databases.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900