Hi everyone I’m trying to think about how to get some database designs done for android and i’m thinking if the following is possible.
I’m trying to create a company-employee database where a company has a many-to-many relationship with employees which in turn has a one-to-one relationship with its employee details , depending which company he’s in. Basically like this
- Company to employee : Many to many
- Employee to employee_details : One to one
So the issue now is that I’m thinking of using an android device to browse the information which i’m thinking how I should populate the information ? Should I :
- be having the ORM for the relationship above handled by the webserver and handling each call from the device as a individual httpConnect call? or
- should I be having the device synchronize with the webserver everytime by downloading the information, and have the android device handle the relationships ?
I want the device to be able to browse the information without lag (which makes it seem method 2 should be the proper choice since it synchronizes the whole database into the phone and browsing is using the sqlite). But what are the choices out there ?
Any tips and comments ? Hope this is not confusing ! Thanks !
Even the second option can look like a better way it can be much more complex and the synchronization can takes a long time for larger datasets so you will not have a lag when browsing information but an user can wait for a long time before the application even starts (imagine if user is on 3G or even worse EDGE). Generally second solution have these challenges:
This is for reading. If you also want some modification on mobile device you can be sure that whole process will be even worse because you must avoid data modification collisions when synchronizing states from multiple devices back to the main database.
The simple way to start is using some combination of both approaches: