# Local Database with Ionic app

**URL:** <https://forum.ionicframework.com/t/local-database-with-ionic-app/65196>\
**Category:** ionic-v1\
**Created:** [September 30, 2016, 1:30pm UTC](https://forum.ionicframework.com/t/local-database-with-ionic-app/65196 "2016-09-30T13:30:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matisapatta](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@matisapatta](https://forum.ionicframework.com/u/matisapatta)\
**Post date:** [September 30, 2016, 1:30pm UTC](https://forum.ionicframework.com/t/local-database-with-ionic-app/65196/1 "2016-09-30T13:30:48Z")

</div>

Hi all,  
I am new to Ionic. I want to create an app that saves some data to the device. Because I want the data to be “always” available, local storage is not an option.  
In Android native development, I would create a new DataBase object and store my data. I want to do the same, but it needs to work in iOS as well.  
I’ve read about Cordova SQLite plugin, does anyone know if it works with both Android and iOS? As far as I know, iOS does not use SQLite in Native DB.  
Thanks

---

<div class="post-metadata">

**Author:** ![lujakob](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lujakob/32/103496_2.png) [@lujakob](https://forum.ionicframework.com/u/lujakob)\
**Post date:** [September 30, 2016, 1:47pm UTC](https://forum.ionicframework.com/t/local-database-with-ionic-app/65196/2 "2016-09-30T13:47:25Z")

</div>

You could use PouchDB. A tutorial on how to use it with ionic is found here:

> **[How To Use PouchDB + SQLite For Local Storage In Ionic 2+](https://gonehybrid.com/how-to-use-pouchdb-sqlite-for-local-storage-in-ionic-2/)**
>
> A year ago I wrote a tutorial on how to use PouchDB + SQLite for an Ionic 1 app. Now that Ionic 2 is in beta, I've updated the tutorial for Ionic 2 and the recently released Cordova SQLite Plugin 2. Update: The code in this tutorial is now up to

---

<div class="post-metadata">

**Author:** ![pliablepixels](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/pliablepixels/32/112372_2.png) [@pliablepixels](https://forum.ionicframework.com/u/pliablepixels)\
**Post date:** [September 30, 2016, 2:02pm UTC](https://forum.ionicframework.com/t/local-database-with-ionic-app/65196/3 "2016-09-30T14:02:05Z")

</div>

Yup it works well (Cordova SQLite). I prefer to use localForage with a driver for SQLite. That way you can abstract the interface out and in future replace the driver with something else. See [this](https://forum.ionicframework.com/t/localstorage-is-empty-at-app-launch-on-ios-10/65098) post where I posted an example of how I use it.

I suspect a lot of people using localStorage on IOS 10 will suddenly notice their data being deleted much more often without notice.
