-1

In the backend of my IOS project, the admin is saving the data into a DB or in an XML file. So whenever he wants, he can simply add an entry.

In the IOS app, I want to retrieve the data.

If I use XML, I can directly parse the XML file, since data are already in XML format (when admin added the value, the XML file got updated).

If I use JSON, I have to connect to the DB, get the result of the query and then encode it into JSON.

So, what do you think would be faster, in terms of the response come into phone.

Is there any other option that I didn't take into account?

I have read all of these similar questions:

  1. JSON and XML comparison [closed],
  2. What's better: Json or XML (PHP) [closed],
  3. JSON or XML: Just Decide (April 2012; by Mark Nottingham)

and many more, but I want to ask something specific for my project.

Community
  • 1
  • 1
ghostrider
  • 5,131
  • 14
  • 72
  • 120

1 Answers1

1

It depends on lots different things:

  • amount of data
  • cpu time needed to generate the data
  • network bandwith/latency
  • mobile phone's hardware
  • ...

But because generally mobile network is the bottleneck, probably the less redundant transfer will be the most efficient. And it is json in this case.

Lajos Veres
  • 13,595
  • 7
  • 43
  • 56