Simon Trewhella
Simon Trewhella

Reputation: 2484

mobile application and database interaction design

I'm involved in a project thats going to be developing a mobile application which will be interacting with a remote database. I'm wondering what the best way to design the interaction between these devices and the database will be, to make best use of battery life, bandwidth etc.

Should we have a server side application/set of scripts which do all the database interaction and then send the data back to our application as XML in a response, or should we have the devices querying the database directly? Or is there another better way to approach this?

My feeling atm is that the former will be a bit more work, but will reduce the workload on the devices, saving power etc, which would be a better way to go.

Thanks!

Upvotes: 1

Views: 790

Answers (1)

Mark Evans
Mark Evans

Reputation: 1367

What do you mean by "have the devices querying the database directly". It is normally considered a bad idea (for security reasons) to expose your database server directly to the Internet. The standard approach is to provide Web Services that connect to the database and return data as JSON or some other format.

Performance is a big issue with these devices and I have found that they are very slow to process XML so you may be better to try using JSON. Also I suggest to stay clear of data sets and data tables. Collections of plain business objects run much faster.

You might want to have a look at this: What are the most valuable .Net Compact Framework Tips, Tricks, and Gotcha-Avoiders?

Upvotes: 1

Related Questions