We have an iOS app which must download a large amount of user data from a remote server (in JSON format) and then insert this data into the local SQLite database. Because there is so much data, the insertion process takes more than 5 mins to complete, which is unacceptable. The process must be less than 30 seconds.
We have identified a potential solution: get the remote server to store the user's data in an SQLite database (on the remote machine). This database is compressed and then downloaded by the app. Therefore, the app will not have to conduct any data insertion, making the process much faster.
Our remote server is running PHP/MySQL.
My question:
- What is the fastest and most efficient way to create the SQLite database on the remote server?
- Is it possible to output a MySQL query directly into an SQLite table?
- Is it possible to create a temporary MySQL database and then convert it to SQLite format?
- Or do we have to take the MySQL query output and insert each record into the SQLite database?
Any suggestions would be greatly appreciated.