Recently started with electron. Can any one please help me with the database selection. It seems like there is no straight forward choice for it.
Suggest a database for medium size project.
In Electron app, you can use the database of your choice :
https://github.com/louischatriot/nedb
https://github.com/pouchdb/pouchdb
http://lokijs.org
https://github.com/kripken/sql.js
https://github.com/pubkey/rxdb
https://github.com/amark/gun
https://github.com/typicode/lowdb
https://github.com/google/leveldb
According to your purpose, a single JSON file can be used as a database.
You can use CouchDB, which is the non-sql database, in that you can store data in JSON format, they have inbuilt sync functionality, that means, you just need to store data locally in HTML storage provider and CouchDB will automatically sync that with the server.
Related
I am going to display list of cities and countries. I have to get it from server using web service. but city and country are not changed every time. so we don't need to call that web service every time. so we can store all the information locally. what is the best way to handle this situation?
Yes you are right we don't need to call web service every time. You can use coredata in this situation. Using coredata you can manage all data locally and retrive back from coredata.
Core Data is the best one to use for non-trivial data storage. It can reduce the memory overhead of your app, increase responsiveness, and save you from writing a lot of boilerplate code.
Refer this link : http://www.raywenderlich.com/934/core-data-tutorial-for-ios-getting-started
You can do this in several ways
you can use nsurl session caching
store data in local db (coredata or sqlite) http://www.raywenderlich.com/934/core-data-tutorial-for-ios-getting-started
For simple data you should use NSUserDefaults
use plist file http://www.theappcodeblog.com/?tag=ios-saving-data-to-plist-tutorial
http://code.tutsplus.com/tutorials/ios-sdk-working-with-nsuserdefaults--mobile-6039
please check the following also
storing data locally on the iphone
Store data locally IOS
There is some more option to locally
1. Using LocalDB - its little bit pain but not bad that much
2. Using XML file - you should have the method to retrieve the data.Its pretty easy
3. Using Plist - This is also very easy can done through few lines.
4. NSUserDefaults - This can be use only as few cases like User information, store tokens.
Got it!
I'm trying to build my first Swift app and I think Realm may be a good option for my database. This might be a totally stupid question, but will my users be able to access the data on my database without an internet connection? I'm fairly certain that the answer is yes, but I just want to make sure.
As a side note, I want the data to be stored on the users phone (not a server or anything like that)
Thanks for the help
Yep! Realm is a completely offline, local database solution. There's no online component, but if you do decide to, you can sync data from Realm online using third party cloud services like Parse (Or just literally copying the database file to Dropbox).
By default, all data saved with Realm is stored in a file called 'default.realm' in the Documents directory of your app, but you can easily explicitly set where you want the data to be saved.
Is it using core data?
Is the data encrypted in any way? Is there a way a user could maliciously modify it easily?
I have been trying to look for this answer since LDB was announced for iOS, and have not found any information regarding this other than 'it is just like our android implementation'. If this information is stored in plaintext I cannot store sensitive information in it, which is why I would like to know.
I've just created an app that uses the local database, and here's what I've found.
Inside <app sandbox directory>/Library/Private Documents/Parse there is a file called ParseOfflineStore. This is a sqlite database. There are 2 relevant tables inside (ParseObjects and Dependencies), and pinned objects are stored inside ParseObjects.
To answer your questions:
1) No, it does not use CoreData, but it is sqlite (the same db backing store as CoreData).
2) No, it is not encrypted. It's in the clear, stored in the ParseObjects table, in the json column as cleartext json.
It would be relatively trivial for anyone who can hook up iExplorer to the app to download, change, and upload the local database. However, if you have a user who can do that, it's likely they could proxy your app with Charles anyway ;-)
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.
I am currently building an iPhone app that is using Core Data and sqlite databases where the user will be reading static information from the database throughout the app. I have the issue where we may update the information in the database but not want to do a full update of the app, just the database. Can someone please help me out with either a easy function or a tutorial of how to go to a website or server and download the file which will replace the database that we have already put into the app? I'm new in xcode and I`m doing my first app.... thanks for your help
I think what would be a good idea is for your website to publish the data that must be stored in sqllite over REST, possibly in JSON or XML format.
This blog post describes how you could do just that. I must say that its approach to retrieving the content from the webservice is kind of low-level but it'll get the job done. Maybe RestKit can help you take care of all the low-level networking/http stuff.
I assume you want the static data locally so you don't require a constant internet connection for your app to work. Another option is to request the static data from the web and persist it in a file (NSUserDefaults etc...). But, that depends on how complicated the static data is and whether you have to query into that data. If you need to issue queries on that static data, a DB is definitely better.
You can also do a combination where you download updated DB if available async while your app works. You could have a setting in user defaults which is the current static data DB. If updated, you switch the current setting and re-establish the DB connection under a lock.
Here's how to make an http request using iOS.
rest web services in iphone
If you're downloading db data, don't convert the NSData to a string like in that sample ...
Also, ASI-HTTP-Request is popular. Here's samples on how to download a file:
http://allseeing-i.com/ASIHTTPRequest/How-to-use
http://www.cocoadev.com/index.pl?NSUserDefaults