Local database and remote server or RESTful API


#1

Hi, i’m a web developer interested in building a hybrid app; at the moment i’m learning angularjs and im using ionic framework, this tools provides me enough resources to make a front development; my problem is, i really don’t know how to implement a database management for my app, as i want my users to be able to store data in a local database and synchronize it to server, do you have any recommendation on wich tools should i use? i’ve been searching but there are lots of them, pouchdb, sqlite, couchdb, etc… wich of them should i use knowing that i use php and mysql? Thank you for your help.


#2

I will not suggest you to use local database. Because its mostly use for user specific settings.
You need to store information into database with the help of API.

See for hybrid mobile application development like Ionic you need to learn

AngularJs, Ionic Framework, SASS for frontend development.

But Every mobile application need to communicate with server to store information. for that you need to learn

Php+mysql
Nodejs + mongodb
Asp.net + Sql server

You can use any server side programming language and database. For communication from mobile application to server you need a API , You can design RESTful API to communicate with server.

If you are beginner then I will suggest you go with NodeJs+MongoDb.

For learn AngularJs, Ionic Framework and Hybrid application Development Join , Google+, LinkedIn etc groups like


https://plus.google.com/communities/115075198106324277896

https://plus.google.com/communities/110804611015818557615
https://plus.google.com/communities/114446967559705874250

https://www.linkedin.com/grp/home?gid=7010976&trk=my_groups-tile-grp
https://www.linkedin.com/grp/home?gid=7016327&trk=my_groups-tile-grp
https://www.linkedin.com/grp/home?gid=8235324&trk=my_groups-tile-grp
https://www.linkedin.com/grp/home?gid=7019475&trk=my_groups-tile-grp
https://www.linkedin.com/grp/home?gid=7012220&trk=my_groups-tile-grp
https://www.linkedin.com/grp/home?gid=7010976&trk=my_groups-tile-grp



https://www.facebook.com/groups/172759346398307/?ref=bookmarks
https://www.facebook.com/groups/538670512952089/?ref=bookmarks

Note: Ionic 2 launched , Its better to start Ionic 2 now.


#3

False… the first official alpha was released… so there will be some time until it is final ;).
Even angularJS is still in alpha phase.

If someone will use this in production … good night

There will be a guide to transform your ionic app to an ionic2 app.
Before starting ionic2 everybody should make experiences with pure typescript…

Back to topic.

It depends how your app will be used. If you need offline synchronization out of the box --> use couchDB/pouchDB as dbs. If this is not necessary. but you have thousands of users parallel using your app. or you need to write many data --> use a NoSQL dbs like mongodb (it plays well with nodejs, but can be used with many script/programming languages). If you only want to play around and it is an app for a small range of users you can use everything. Even PHP and MySQL.

But keep in mind… you can use the fastest dbs and programming language … if your code sucks --> your backend will be crap ^^


#4

You right Angular 2 and Ionic 2 still in Alpha phase. But I think for beginner its better to start learn TypeScript, Angular 2 and Ionic 2. If they don’t want use Alpha version into production.


#5

Hi, i really want to thank both of you for having taken the time to give me your answers, as my app must save data locally and synchronize with the server, and i told you i have experience with php and mysql; i’m thinking about using pouchDB for synchronization as @bengtler advised; i kind of need to be able to make queries to the database to print some reports. I’m thinking about making the RESTful API myself with php and mysql and use pouchDB for offline database and synchronize it with my API. Is that a good approach?

Pd. thanks @virender i’ll be looking all those groups.


#6

Hey,

this should work:
pouchdb works together with the cordova sqlite plugin
http://pouchdb.com/adapters.html


#7

Thank you @bengtler :grin:


#8

@manuel_arango

I know its been sometime since you replied here. Seems like I am in a similar situation as yours. I am planning to use pouchDB for my app, but later I need to sync this data to myremote MYQL DB in my servers. Did you solve this problem, and if so how did you do it? A little light on this would help us in moving ahead!


#9

Hi, i really haven’t continued this project but I managed to use the cordova SQLite plugin for local database storage wich to me seems like a really good place to start, it has been easy to use and i only need to make my RESTful API with php and mysql using json to communicate.
I really am a beginner in Ionic so i couldn´t tell you wich approach is better, just telling you that worked for me.

Anything i can help you, just ask.
:+1:


#10

can u post us the code how u achieved it.did u follow the alogrithm http://havrl.blogspot.in/2013/08/synchronization-algorithm-for.html


#11

Hello @manuel_arango, how did you do with the project, I would like to do something similar to what you reference, regards!