0

I know that there are many questions about which database method is the best for PhoneGap but it is very difficult to decide which one to use, because I am new to mobile development, new to Phonegap and related to databases I've only worked with SQL Server and MySql before for websites and local softwares for the computer.

My mobile application is being implementing using Phonegap 2.9 and Eclipse for Android. (Later I'm gonna make the IOS version).
It will have many users and each of them can add new things to my database's tables. All the data that the users will add, are going to be viewable in my app. So, I am talking for a really big amount of data.
Also, I don't want the size of my application to be very big.

So according to my requirements which one is the best? To be honest I was going to use this one but I am confused about the differences between SQLite and WebSql, or about the max limit that they can have or if it is better to use another method. And I want a simple way for insert, update, delete and find functions just like the normal SQL Server .

  • maria, visit this link: http://stackoverflow.com/questions/10329842/why-to-use-sqlite-database-in-android – Pratik Dasa Oct 07 '14 at 12:16
  • I just suggest you to use SQLite because its light weighted database. Easy to use and fast processing to store data. – Pratik Dasa Oct 07 '14 at 12:16
  • What do you mean by large amount of data? Can you specify the data amount range (e.g 1MB-5MB) that you are looking for? – frank Oct 07 '14 at 12:35
  • @frank sorry for the delay but i had to write down all my tables to calculate. I need around **500MB**. I have in mind that my app is going to be famous so my numbers are much higher from the ones my app is going to have for now. So, I would prefer the method to have unlimited size or at least _1GB_ and to be of course okay with both IOS and Android. –  Oct 07 '14 at 20:04
  • @marialena You do not have to be sorry :). I understand. 500MB is a large data set. Is this amount of data backend data or data for a particular user. Since you are familiar with SQL it is better you stick with SQLite. WebSQL is a standard that allows you to use JavaScript functions to make SQL calls. It is independent of the database used for storing data. The WebSQL provider can use any database SQLite, MySQL etc for storing data. Your interface/code will remain the same IF you use the webSQL standard for writing your code. – frank Oct 08 '14 at 08:15
  • So there is no differences in the way of coding between WebSQL And SQLite??? –  Oct 08 '14 at 08:25
  • @marialena Yes. No Difference. – frank Oct 08 '14 at 09:24
  • Ok... so to conclude: - WebSQL / SQLite are the same. - Both, they have no interface. I have to write their code in JavaScript ONLY. - I don't have to make installations or call plugins to use them. - It is going to work for both IOS and Android. -I will not have a limitation problem with the size of the db even though my DB someday is about 1GB. --Am I right to all of that? And btw have you used SQLite and needed the same requirements as me?-- –  Oct 08 '14 at 09:29
  • @marialena If you are using Cordova than JavaScript is the language for accessing WebSQL. You do not have to install anything for WebSQL. SQLite can handle more than 1GB of data. I am not sure whether there are limitation on the size of database on IOS/Android phonee. I have used SQLite for a simple application using cordova with WebSQL/SQLite and it worked fine on Android. Do not have a iphone for testing. – frank Oct 08 '14 at 10:50
  • Ok then I will give it a try. Thanks for helping. I can't upvote your comment btw.. –  Oct 08 '14 at 11:14

1 Answers1

0

I think, SQLite is an embeddable database system that uses flat files. It does not need to be started, stopped, configured, or managed like other SQL databases. It is lightweight, fast, and compact. And it works completely out of the box without any configuration.

Pratik Dasa
  • 7,439
  • 4
  • 30
  • 44
  • So I can just write my code inside the JavaScript without any plugin or installation. Btw what is it's difference from _WebSql_ ? As I saw their code in JavaScript, I couldn't find any difference. –  Oct 07 '14 at 20:07
  • @marialena yes you have to write code directly, no need to install any plugins and all. Just use it directly, I dont have much idea about the limit, but as I have did one app some time ago, I was have lots of data like 8000 entries with lots of sub entries then also database will work fine. – Pratik Dasa Oct 10 '14 at 06:08
  • have you used it with IOS too? Because in the future I wanna test it there too –  Oct 10 '14 at 14:41
  • btw what about [this](https://github.com/brodysoft/Cordova-SQLitePlugin) ? What do I have to do??? –  Oct 10 '14 at 15:22
  • @marialena ya it will work with IOS too, not to worry with it. – Pratik Dasa Oct 11 '14 at 04:05
  • @marialena ya you can use above given apis as well, because in backend of it, they itself also used native sqlite. If these apis will perfectly fit to your requirements then no problem to use it. – Pratik Dasa Oct 11 '14 at 04:07
  • So there is no need to use them. I mean if there is no need I don't want to call additional plugins. Let's say I am not going to use it.. I only have to include this ( `` ) in the `config.xml` and write [this](https://gist.github.com/edwardtoday/2204864) code for example without including anything in the `.html` file? –  Oct 11 '14 at 06:47
  • @marialena dear, I am an native android developer, so not, much idea about this, but I know that this will work in any case, that's why I suggest you. Anyway may I have your contact details? We can be in touch for future??? – Pratik Dasa Oct 11 '14 at 06:51
  • you can may send me your email or facebook or something like that to contact you in case that I need anything? –  Oct 11 '14 at 06:54
  • SQLite is on the internet? I mean it's global and shared by every one that will download my database? Where is it stored ? –  Oct 16 '14 at 22:46
  • @marialena no its not on internet, its just your local database which always stays in your device itself, you can download the data from internet and can store in SQLite and use it. – Pratik Dasa Oct 17 '14 at 04:22
  • So what I have to do to synchronize my SQLite with an online database so that every user can have access to the same db? Because my db has to be online and I totally forgot to describe it in my requirements. –  Oct 17 '14 at 07:36
  • @marialena ya if you have database online then you dont need to use SQLite, untill and unless you are giving offline support. Secondly, you just need to use online database with using Webservice, just call your database and get data from server and use it whatever you want. That's it, you have done. – Pratik Dasa Oct 17 '14 at 08:44