Local DB for app?

I going to create a app but trying to work out the base way of storing the data locally. This will be a simple game and will have the following:

  • Users (basic info like name and age)
  • Catergories (Game Categories)
  • Games (linked to the user, also may look at storing images locally)

I thought about using pouchdb which would allow syncing in the future (not required initially). What I would like to know if it would be better to have 1 pouchdb to store all the information or 1 pouchdb for each section of data I need to store.

Also are the better alternatives to pouchdb which can support syncing?

There is this local storage called SQL lite storage. Check it out…3

Hi, Refer to this 100% working App that illustrates the proper way to install a pre-populated database (SQLite) file in your App and also have the ability to run it under Chrome/WebSQL. The app comes with 37 PDF documentation as well as all the code commented.

http://codecanyon.net/item/quizionic-a-quiz-app-template-for-ionic-framework-with-sqlite-database/14205904

Don’t hesitate to use SQL lite storage. 1 database for all your category and … in your application.

If you use MongoDB in your backend then you can use PouchDB since they are both NoSQL type of databases.

If you are going to use SQL or MySQL in your backend then stick with SQL Lite

You may try Loki.JS It’s in-memory fast Javascript based database.

1 Like

You can use pouchdb to store all of that information and sync it with a couchdb server later on in development/after release. As for storing the data there is no need to create different databases. If nessecary you can use the “type” field to differentiate between documents and their purpose.

1 Like

Got to love how people absolutely refuse to answer these types of questions :unamused:

Meanwhile I’m trying to fucking figure out how to use ANY database at all and there is just nothing. Even ionic’s own documentation on how to use the cordova sqlite plugin is completely inadequate.

Protip for any doc writer: don’t just fucking put the exact code people can already see by opening their files. For each nonstandard line of code you need to explain what it does, why it’s there, and how to use it.

I like this one too. Is version 1 still being supported as opposed to version 2? I been checking the github repository and it hasn’t been updated in awhile and it seems they move to version 2.