# Best Database for ionic

**URL:** <https://forum.ionicframework.com/t/best-database-for-ionic/102594>\
**Category:** ionic-v1\
**Created:** [August 20, 2017, 7:37am UTC](https://forum.ionicframework.com/t/best-database-for-ionic/102594 "2017-08-20T07:37:15Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahir04](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@sahir04](https://forum.ionicframework.com/u/sahir04)\
**Post date:** [August 20, 2017, 7:37am UTC](https://forum.ionicframework.com/t/best-database-for-ionic/102594/1 "2017-08-20T07:37:15Z")

</div>

Hi , i am new in this platform and want to use database in my app , i am confused which database is best for my app  
the scenario is like this.

```auto
user will search for medicine name and in response
user will get pharmacy name and quantity of that particular medicine

```

so this is very short description to get idea what i want to achieve please guide  
and if there is complete example of using database from scratch then please provide  
i’ll be very thankful

---

<div class="post-metadata">

**Author:** ![AaronSterling](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AaronSterling](https://forum.ionicframework.com/u/AaronSterling)\
**Post date:** [August 20, 2017, 7:41am UTC](https://forum.ionicframework.com/t/best-database-for-ionic/102594/2 "2017-08-20T07:41:30Z")

</div>

This question gets asked a lot. You might want to search the forum. Lots of advice.

Edit: also, if you are new to the platform, it’s not a good idea to focus on Ionic v1.

---

<div class="post-metadata">

**Author:** ![kocei](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@kocei](https://forum.ionicframework.com/u/kocei)\
**Post date:** [August 21, 2017, 3:20pm UTC](https://forum.ionicframework.com/t/best-database-for-ionic/102594/3 "2017-08-21T15:20:15Z")

</div>

Why not ? Can you be more talkative about your edit ?  
I don’t see any problems to be honest.  
😃

---

<div class="post-metadata">

**Author:** ![matt4759](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/matt4759/32/112613_2.png) [@matt4759](https://forum.ionicframework.com/u/matt4759)\
**Post date:** [August 21, 2017, 3:34pm UTC](https://forum.ionicframework.com/t/best-database-for-ionic/102594/4 "2017-08-21T15:34:55Z")

</div>

You have a couple options dependent on how big of a database you mean here.  
Ionic has a native SQLITE plugin([https://ionicframework.com/docs/native/sqlite/](https://ionicframework.com/docs/native/sqlite/)) or one of the strongest web options right now is firebase.  
[https://firebase.google.com/docs/web/setup](https://firebase.google.com/docs/web/setup)

---

<div class="post-metadata">

**Author:** ![AaronSterling](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AaronSterling](https://forum.ionicframework.com/u/AaronSterling)\
**Post date:** [August 21, 2017, 4:44pm UTC](https://forum.ionicframework.com/t/best-database-for-ionic/102594/5 "2017-08-21T16:44:20Z")

</div>

Ionic v1 is barely supported. Ionic 4 is coming out soon. Why stay with version 1? Also, Ionic 1 is based on AngularJS, which is much less performant than Angular.

---

<div class="post-metadata">

**Author:** ![sahir04](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@sahir04](https://forum.ionicframework.com/u/sahir04)\
**Post date:** [August 21, 2017, 5:57pm UTC](https://forum.ionicframework.com/t/best-database-for-ionic/102594/6 "2017-08-21T17:57:15Z")

</div>

Thanks for reply 🙂  
i have only two tables in my database and the records around 3k in each table, the data which will be response to user will be fetched from both table  
as i mention above  
`one table is pharmacy table which contain 4 cols id,name,latitude,longitude`

```auto
 second table is medicine table which contain 3 cols id,name,quantity of medicine

```

so this is my scenario, which one is best for this particular prob ?

---

<div class="post-metadata">

**Author:** ![matt4759](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/matt4759/32/112613_2.png) [@matt4759](https://forum.ionicframework.com/u/matt4759)\
**Post date:** [August 21, 2017, 7:52pm UTC](https://forum.ionicframework.com/t/best-database-for-ionic/102594/7 "2017-08-21T19:52:20Z")

</div>

Well i’m pretty partial to firebase just due to ease of use. See : [https://www.joshmorony.com/building-a-crud-ionic-2-application-with-firebase-angularfire/](https://www.joshmorony.com/building-a-crud-ionic-2-application-with-firebase-angularfire/) for a good example of firebase.

However if you know SQL the ionic native plugin would probably be easier for you.

EDIT: I have only used these with Ionic 2+

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [August 21, 2017, 10:40pm UTC](https://forum.ionicframework.com/t/best-database-for-ionic/102594/8 "2017-08-21T22:40:28Z")

</div>

The first crucial question here is whether you want the data to be included in the app or stored on a server.

If stored in app, SQLite is hands down your best option. This allows offline usage, yet data cannot be changed/updated without reving the app.

If stored on server, everybody can have their religious arguments. I like PostgreSQL. This requires network access, but is easily updatable without changing the app, and you can also do access control and easy statistic gathering if desired.

---

<div class="post-metadata">

**Author:** ![sahir04](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@sahir04](https://forum.ionicframework.com/u/sahir04)\
**Post date:** [August 22, 2017, 2:48pm UTC](https://forum.ionicframework.com/t/best-database-for-ionic/102594/9 "2017-08-22T14:48:19Z")

</div>

no matter it is stored in app or on a server because i dont want to alter data later till rest of my life 😃  
the best tutorials for sqlite ??? and for server too as i am looking for the easiest way to do this.

---

<div class="post-metadata">

**Author:** ![sahir04](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@sahir04](https://forum.ionicframework.com/u/sahir04)\
**Post date:** [August 22, 2017, 2:50pm UTC](https://forum.ionicframework.com/t/best-database-for-ionic/102594/10 "2017-08-22T14:50:04Z")

</div>

yeah this blog is great so far whatever i did in this app i got help from this blog, but this time it seems little tough ☹ honestly i am looking for the most easiest way to achieve this 🙂

---

<div class="post-metadata">

**Author:** ![matt4759](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/matt4759/32/112613_2.png) [@matt4759](https://forum.ionicframework.com/u/matt4759)\
**Post date:** [August 22, 2017, 11:21pm UTC](https://forum.ionicframework.com/t/best-database-for-ionic/102594/11 "2017-08-22T23:21:13Z")

</div>

If i understand this right It should be pretty easy to achieve in either one but for example, if you were to do firebase

```auto
public DBref = firebase.database.Refrence;
pushpharmtable(id,name,latitude,longitude){
this.DBref.push({
       id: id,
name: name, //etc
    })
}

```

So you can achieve that for establishing either of the two nodes you would need to create for your data.  
Calling lists from firebase is pretty easily achievable, I believe Josh Morony has a tutorial on that as well.
