简体   繁体   中英

Cordova/Phonegap best and most efficient way to store a lot of data?

I am working on a cordova/phonegap android and ios application. I am using the latest versions of cordova and jquery mobile. I am currently using sqlite3 to store data. Basically I need to know the best way and also the most efficient way to store hundreds of values. The way it is, I need to store roughly 100 city names, and for each city, I need to store 5-10 restaurant names and some of their menu items as well. So... in total im going to have upwards of 500 values, some being properties of others... making sqlite not the most practical storage method. PLEASE ANY SUGGESTIONS/HELP ? THANK YOU SO MUCH IN ADVANCE.

I have two database for you. First one is I'm using for almost over a year. Didn't face any issue. Brodysoft SQL wrapper plugin It's use is just like web sql.

function onDeviceReady() {
  var db = window.sqlitePlugin.openDatabase({name: "my.db"});
  // ...
}

I didn't use the second one but saw the reference in SO. Read that it's very efficient. HTML5SQL

$.get('Setup-Tables.SQL',function(sqlStatements){
    html5sql.process(
        //This is the text data from the SQL file you retrieved
        sqlStatements,
        function(){
            // After all statements are processed this function
            //   will be called.
        },
        function(error){
            // Handle any errors here
        }
    );
});

Between this two choice has to be yours. 500+ values should not be a problem for databases like this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM