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)