Still my app uses Parse for storing user details for my existing application, since Parse announced that shutdown date for their service, we planned to use Firebase,
Shall we import parse users into my Firebase framework, if yes please suggest way to migrate parse to Firebase.
This question is not easy to answer on stack overflow completely since it highly depends on what your data is like and what your source code is like. The first question I would have is why are you not using the suggested migration path which is using open source parse-server and mongodb?
If you do actually switch to firebase, then Frank's link is a great place to start. Switching from parse to firebase will not be a 5 minute process however, since the backends are completely different (although they seem very similar on the surface).
You can retrieve all your data from parse, including the user collection by going to the parse dashboard - App Settings - Export App Data. This will export JSON files of all your classes. You can find a way to import this into Firebase, but this will be done offline and then (if your app is live), the data will not be synchronized between the 2 backends.
The link suggests 2 approaches for this:
Migrate Your Data
After you decide how to structure your data in Firebase, you need to
plan how to handle the period during which your app needs to write to
both databases. Your choices are:
Background Sync
In this scenario, you have two versions of the app: the old version
that uses Parse and a new version that uses Firebase. Syncs between
the two databases are handled by Parse Cloud Code (Parse to Firebase),
with your code listening to changes on Firebase and syncing those
changes with Parse. Before you can start using the new version, you
must:
Convert your existing Parse Data to the new Firebase structure, and
write it to the Firebase Realtime Database. Write Parse Cloud Code
functions that use the Firebase REST API to write to the Firebase
Realtime Database changes made in the Parse Data by old clients. Write
and deploy code that listens to changes on Firebase and syncs them to
the Parse database. This scenario ensures a clean separation of old
and new code, and keeps the clients simple. The challenges of this
scenario are handling big datasets in the initial export, and ensuring
that the bidirectional sync doesn't generate infinite recursion.
Double Write
In this scenario, you write a new version of the app that uses both
Firebase and Parse, using Parse Cloud Code to sync changes made by old
clients from the Parse Data to the Firebase Realtime Database. When
enough people have migrated from the Parse-only version of the app,
you can remove the Parse code from the double write version.
This scenario doesn't require any server side code. Its disadvantages
are that data that is not accessed is not migrated, and that the size
of your app is increased by the usage of both SDKs.
Related
There's a chapter called Maintaining Local Cache of CloudKit Records in CloudKit documentation on Apple's web site. However, everywhere online people say it's close to impossible to store offline data with CloudKit. I'm relatively new iOS developer. Did anybody tried implementing offline data storage (on device) as per Apple's docs?
If you want true, offline-first data for your app, then yes, you need to add a database of some kind.
Every time you update a record, save it to your database and push the updated record to CloudKit. You can also subscribe to CloudKit changes and update your local database as record changes come in.
Core Data and SQLite are common options. I happen to use the Realm database, which I consider to be a bit simpler to use than Core Data or SQLite. I set it up so that my app's UI only interacts with the offline data in the database (so that it's always available). CloudKit and my Realm database work together to keep the data up-to-date, but my UI never tries to rely on the presence of transitory CloudKit records.
I hope that helps.
I meet a problem when I import data in an ios app.
The data is stored with coredata. I was trying to import the data with a button. After it is clicked, the data, which is firstly stored in a txt file in JSON format will be stored in the sqllite file.
My question is this, it is very slow to import such amount of data and it is not friendly for user to click button or wait to import the initial data. Is there a better way to import data?
Thanks.
It depends. For example you could just import data in – applicationDidFinishLaunching:or when the user touches a specific button.
In both cases I would import data in background. This allows you to avoid UI freeze (if you have a lot amount of data) and to display a sort of progress indicator. Maybe the user could be more happy to know what is going on.
To import data in background, you could just use new iOS 5 API for Core Data or follow Marcus Zarra tutorial on importing-and-displaying-large-data-sets-in-core-data/.
Another way could be to start with a pre-populated db. Create a dummy project where you populate that db (with your JSON file) and then use that db in your real application project.
Hope that helps.
Edit
It is not user friendly to import the data when the app begins.
Why not?
So I was trying to put the data - the db file into the archive and
send it to app store. In this way, I was wondering if I could get the
db file during test, which is finished importing the data and the
initial data is acceptable. And put this test db file in the archive
and publish on appstore. So user do not need to import the data at
first. Just use the copy of the testing data
I'm not sure I got the point here. Here what I mean with preload and import existing data. You need to ship the db file with your app when you submit it to the app store. For example within the application directory. You could ship it also within the bundle. But in this case pay attention since the db file it is read-only (you need to move somewhere elese if you want to modify).
I suggested you to create a dummy project since it's my personal way to do thing when I need to create a prepolutade db. This allows you to maintain cleaner your project. But you can also populated that db in your real project. If you follow the first way you can simply move the sql file in the application directory for your app and say to core data to read that.
I am currently working on Parse integration for one of my iOS applications where in I need to pull some records (Customer Feedback from existing table) from Parse and show them in mob-app.With Parse iOS SDK 1.6.1 I realized that I could also use LocalDataStore to provide include the offline support, however going through the following articles appCoda , raywenderlich and Parse documents I could not figure out a solution which could solve the use case I am dealing with.
Step 1: Show all records pulling from server (Initially Sync - but I also realized that I need to enable [Parse enableLocalDatastore]; which is now interfering with initial data pull )
Step 2: Allow user to perform certain modification and sync this data back with server.
Step 3:Keep the local data store in sync with online data all the time (provided I have internet as and when needed).
I was able to implement the ALL-ONLINE version of the app and achieve all features as needed but I would also like to include the Offline support. A few question that raises doubt are
does LocalDataStore only support offline usage of the application that
has to be manually synced with Parse backend ?
The data fetch from Parse localDataStore via [query fromLocalDatastore]; doesn't return anything on first call (I know because there isn't anything on device). Do I need to write the logic to pull down data from backend every time and keep local datastore in sync ?)
Can someone correct me if I am using it the wrong way? or give me some pointers for correct usage, then it will be really helpful.
Yes, you have to query the data online first(without "[query fromLocalDatastore];"). And "pin' it for local usage.
Usefull hint can be to use "UpdatedAt" to get only the new stuff.
Once done, you can get data online and offline. The sync should be automatic.
'Red flag' : Don't forget to update to sdk 1.6.2, as they solve a lot of big bugs related to LocalDataStore.
I've searched about best iPhone backend services and best recommended are parse.com, stackmob... But what I'm interested is which one is best for storing own data by hand and then using that data for iOS ?
As I read the docs on all of these sites they are always refering to saving games data or any other data from the iPhone to the backend. But I would like to store my own data manually (so on www.parse.com website for example) on that backend and then use it/retrieve it on iPhone. Is that good aproach? Are those backends even used for those kind of stuff or should I create my own database for that?
If they are used, which one is the best? From all the recommendations and reviews looks like parse.com is prolly the best one.
Thanks.
Hmm, manually typing into Parse.com could be tedious although it is allowed with a clean UI. I suggest you put all your data in an Excel sheet, write an Excel formula to generate CURL commands and run the CURL command in a terminal that would save the data to your Parse.com account.
https://www.parse.com/docs/rest#objects-creating
EDIT
This question is old and parse.com is dead but there are many more options now.
Firebase
Use Swift Vapor/Perfect to create your own backend on AWS
Parse.com is good you can update data manually in parse.com table.
steps create parse.com account-> create your app -> click on the dashboard-> left side click to add class analogous to table-> add rows in your class manually or through API->fill data in columns.
Best part you don't have to pay till you generate enough traffic. so if your app is not a success you save on back-end development.
If on a later date you want higher capacity you can upgrade or you can export your database and port it to your own server.
We are trying to create an iPhone application that will automatically receive data from a database. Which is a database that will work with Xcode. Our goal is that users can go to our website and input information. That data will be recorded to a database. Once the user downloads our app, the info should then be retrieved from the database and included in the app. We are wondering what database is suitable. It must be able to receive information from a website AND submit it to an application.
You're unlikely to find a iOS "aware" database that can automatically sync content over the internet.
However, you can of course obtain the data over the internet yourself and then insert it into the local database on the device, in which case the popular (and supported out of the box) SQLite would seem like an obvious choice.
As #Deepak also suggests, you could use Core Data which is a (sort-of, ish) ORM that can automatically use SQLite as it's underlying storage mechanism.
The solution that most people use in this case is to use an RDBMS like MySQL and build a web-service layer on top of the database for the entities that your iPhone app is interested in.
This way, when a user goes to the web-app, they can add the data that you allow them to add there, and later on they can access the same data from the iPhone app via the web-service layer also.
Couchbase's new iOS-Couchbase framework is in beta right now - all the functionality of Apache CouchDB on your favourite developer platform - at https://github.com/couchbaselabs/iOS-Couchbase. the iOS release is new but we're looking for it to go places!
Its awesome sync abilities would allow you to pull down any relevant content from your website via HTTP/JSON, or further formats using shows and lists if needed. Pushing data the other way is just as easy. Sync can be continuous, or on demand, bidirectional or one way.
Take a look at some of the Couch App frameworks (not for iOS but for your website)
http://techzone.couchbase.com/community/articles/couchdb/recipes
http://www.mail-archive.com/user#couchdb.apache.org/msg13928.html lots of comments on this thread
A+
Dave