Database with authorization

Hi, I’ve recently made simple app using ionic framework (also with phonegap android/ios). I needed to store some user data in database. I found out about firebase and successfully integrated it in my app. I’ve let user log in anonymously or by google. In my case each user should see only his content so I’ve added rules - and they work. However my app needs to run without internet connection on mobile platforms (android/ios) and firebase doesn’t provide full offline storage (only temponary) in javascript (it’s for now implemented in native only). So basically I hit the wall. I’ve been told about CouchDB/PouchDB and they indeed support offline storage and sync with remote server. I’ve created an account on cloudant, but then I remembered I need user authorization. So let’s say guest have only local database and user logged in with google have database also on remote server so he can switch device and work with the same data. Is there any other solution, which works with ionic smoothly and provides:

  • offline database,
  • authorization with google,
  • remote database with sync (with local db) after successful authorization,
  • remote database is hosted on some server (may be paid, but trial needed :D) - i don’t want to worry about server - client only.