# Best method Storing and retrieving data both locally and online?

**URL:** <https://forum.ionicframework.com/t/best-method-storing-and-retrieving-data-both-locally-and-online/37384>\
**Category:** ionic-v1\
**Created:** [November 18, 2015, 10:33pm UTC](https://forum.ionicframework.com/t/best-method-storing-and-retrieving-data-both-locally-and-online/37384 "2015-11-18T22:33:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rude](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@rude](https://forum.ionicframework.com/u/rude)\
**Post date:** [November 18, 2015, 10:33pm UTC](https://forum.ionicframework.com/t/best-method-storing-and-retrieving-data-both-locally-and-online/37384/1 "2015-11-18T22:33:53Z")

</div>

Hello what is the best/simplest ionic/angular method for storing data both locally (on device) and/or online? This method should work for both ios and android.

---

<div class="post-metadata">

**Author:** ![bengtler](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bengtler/32/98565_2.png) [@bengtler](https://forum.ionicframework.com/u/bengtler)\
**Post date:** [November 19, 2015, 6:56am UTC](https://forum.ionicframework.com/t/best-method-storing-and-retrieving-data-both-locally-and-online/37384/2 "2015-11-19T06:56:30Z")

</div>

the simplest way is using CouchDB as your dbs and PouchDB on clientside, if you need synchronization.

If you only want to get information from the backend and store them locally (without chaning data only on frontend and push the changes to the server, if the app is back online) you can use everything. Use the databasesystem you want for your backend and on frontend side you can use pouchdb, sqlite, …

But you need an api (hopefully a restful api 😉 ) which connects your app with your data (database)

---

<div class="post-metadata">

**Author:** ![rude](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@rude](https://forum.ionicframework.com/u/rude)\
**Post date:** [November 19, 2015, 11:02pm UTC](https://forum.ionicframework.com/t/best-method-storing-and-retrieving-data-both-locally-and-online/37384/3 "2015-11-19T23:02:25Z")

</div>

Great thanks, I was hoping to store JSON docs so that’s perfect. If you could point me to an example of a good ionic app storing and retrieving data using couchDB and PouchDB that would be super helpful and appreciated!!

I’d like to start out (version 1) with storing user data/results locally on the device only, then for version 2 work on the restful API and the connection/integration with web application’s database. Does it still make sense to start with PouchDB for version 1?

Thanks very much,

Renee

---

<div class="post-metadata">

**Author:** ![bengtler](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bengtler/32/98565_2.png) [@bengtler](https://forum.ionicframework.com/u/bengtler)\
**Post date:** [November 20, 2015, 6:49am UTC](https://forum.ionicframework.com/t/best-method-storing-and-retrieving-data-both-locally-and-online/37384/4 "2015-11-20T06:49:30Z")

</div>

yep i think so.

This seems to be an example pouchdb app.

> **[Synchronizing Offline App Data with PouchDB — SitePoint](https://www.sitepoint.com/synchronizing-offline-app-data-with-pouchdb/)**
>
> Jay Raj looks at using PouchDB and the Ionic framework to synchronize local app data with remote central databases.

---

<div class="post-metadata">

**Author:** ![rude](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@rude](https://forum.ionicframework.com/u/rude)\
**Post date:** [November 20, 2015, 4:57pm UTC](https://forum.ionicframework.com/t/best-method-storing-and-retrieving-data-both-locally-and-online/37384/5 "2015-11-20T16:57:22Z")

</div>

I’ll check that out thanks for your help.
