I am writing server for realtime application (online users is about 20 000).
My server saving each user, that conected to server, into memory. When I should save memory data to database?
Related
I have written an application (intended only for my own use) that monitors Core Location Accuracy and logs this information to a simple Core Data model. Each time the application is launched it begins recording the data and saving it to a new Item within the Model. What are my options for getting this data out of the iPhone and onto my laptop in a format I can use (JSON or XML)? I would like to avoid having to send it to a server and keep things as simple as possible.
Just download iExplorer and gab the coredata file directly from your device.
I have an app that uses an SQLite database. With the advent of iCloud on the rise I'm trying to figure out a good architecture for syncing data between devices. So lets say my app runs on an iPhone, an iPad, and a Mac. How can I keep data in my DB up-to-date on all devices?
My first thought was, I can put the database in the cloud and send transactions. But the device may not always been online and the users need their content at anytime, so that wont work. My other thought was to continue using the local db, and then when a connection is made, to send the cached data to the central db. The problem is I have no ideal where to even begin on something like that. How would I know which data has been sent and not sent, which data to actually send when a connection is made, etc.
So this is my question (we don't have to get into iCloud specifics), using an SQLite database and iCloud (or any storage medium), how can I sync data between multiple devices, but still have the most recent data stored locally on the device?
You might want to checkout Couchbase Mobile. This would help with the synchronization you are looking for.
If you have a significant investment into CoreData, then you may want to look at writing your own NSIncrementalStore to support writing data to and from a key value store.
iCloud is only going to be a good solution if your data is sandboxed to a specific user. If you have multiple users that want to view the same data then it won't work.
We have a iPhone web application that uses WebSQL that is working fine. The amount of data downloaded depends on the user of the app. If the user has more than 5MB data, the user is prompted to increase the size of their database.
We then moved our application to run in an UIWebView hosted in a native ObjectiveC application. The application works fine if the user stays under the 5MB database limit. If the user has more than 5MB data, our application fails without prompting the user to increase their storage limit.
What are some alternatives to either pre-allocate the required database in the native app or somehow allow the user to be prompted to allow the database to grow to the required size?
You could write the html files to application documents directory and in database keep only the pats to the files.
Or you could use core data.
I'm currently in the middle of developing an iPhone app with a big reference database (using Core Data backed with a pre-populated sqlite database). Once the app is live and deployed to a client's iPhone, I need the facility to update/insert a small amount of data. What are best practices / methods for doing this?
There may be occassions when the frequency of updates will be daily for a month or so. Other occassions when a data update happens once every few months.
What is the recommended way of doing this? Note, I don't anticipate any data model changes for these updates -- this is purely an insert/update of data.
At the moment I'm starting to research the use of push data notifications (q:payload size restrictions?), app store updates (q:code/data model only, not data updates?) and the use of my own ad hoc data server (which the app connects to routinely to check for updates).
Can anyone please provide me any pointers on the above?
Thanks in advance
IIRC Push Notifications have a maximum payload of 256 bytes. Enough for notification purposes, but not more. Your app would still have to download the actual data from your own server after receiving the notification.
Note that the app bundle is not writable on the device. So if your app needs to update the data store, you should copy the pre-populated database file from the app bundle to the app's documents directory on first launch.
App Store updates would certainly be feasible (especially now that Apple seems to have gotten its review process down to a few days at most) but note that an App Store update will always replace the entire app bundle (code and data), so if your pre-populated reference database is big, the customer would have to download it in full every time.
I have to download only updated data from my mysql database that I have created at server.
i also have SQLite database for iphone .
Now i want any changes in database would prompt the user for doing updating.
Also an update button will be there for updating.
how to identify the data is updated in the database.
Also is there any code for synchronizing will be good for understanding
You might want to take a look at objective sync = it provides synchronisation and integration between a local sqlite db on ithe iPhone and a RESTful web application (the interface to your Mysql DB on the server).
How else does the app communicate with the server? Why not have the app ping the server to find out if the MySQL DB is updated? Can the app check email outside of the iPhone's email client? You could generate a userID for each app User, and whenever changes are made to the MySQL server, it sends an email to the app telling it updates are available. There may even be a way to do this via something like XMPP/Jabber.
Essentially, the app has to talk to the server to get the updates regardless of how it finds out if there are updates. So that means it talks to the server in general. If that's the case, just have the server send the app an alert that there are messages. If you want the server to "push" this alert to the phone, you'll have to figure out what push methods you have available in iPhone apps.
But once you know how the server will alert the user/app/phone, you can eliminate the user's need to hit an update button, and just have the app replace the sqlite file with the updated sqlite file from the server. Since the sqlite file just reflects what is in the MySQL DB, you can avoid the headache of updating the app's file by just replacing it with an updated version.